Post

Replies

Boosts

Views

Activity

Reply to iOS 10 Temperature Unit
My use case for wanting to know what unit a user has selected is to be able to display a toggle that defaults to their selected unit. I found a hacky way to do this on iOS, but sadly not on macOS. let temp = Measurement(value: 9, unit: UnitTemperature.celsius) let formattedTemp = temp.formatted(.measurement(width: .abbreviated, usage: .person, numberFormatStyle: .number)) let unit = formattedTemp.firstIndex(of: "F") != nil ? UnitTemperature.fahrenheit : UnitTemperature.celsius This code relies on the usage: .person part that seems to format according to what temperature unit the user has selected. @yvsong Did you ever get a response on your enhancement request?
Jan ’24
Reply to iOS 10 Temperature Unit
My use case for wanting to know what unit a user has selected is to be able to display a toggle that defaults to their selected unit. I found a hacky way to do this on iOS, but sadly not on macOS. let temp = Measurement(value: 9, unit: UnitTemperature.celsius) let formattedTemp = temp.formatted(.measurement(width: .abbreviated, usage: .person, numberFormatStyle: .number)) let unit = formattedTemp.firstIndex(of: "F") != nil ? UnitTemperature.fahrenheit : UnitTemperature.celsius This code relies on the usage: .person part that seems to format according to what temperature unit the user has selected. @yvsong Did you ever get a response on your enhancement request?
Replies
Boosts
Views
Activity
Jan ’24
Reply to Is getting artist artwork from the Apple Music REST API disallowed from posting to the app store?
@snuff4 This is indeed from your blog post. Thanks for the update. Sorry I'm replying three months later. 🤪
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to ApplicationMusicPlayer.shared.state.objectWillChange publisher emits twice.
I'm running into the exact same issue and am a little disheartened to see no one has answered your question in 4 months.
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’22