Following up my previous comment (still being approved)
A more type-safe version:
enum UnitSymbol: String {
case month
case week
case day
}
func localizedUnit(for unitSymbol: UnitSymbol, locale: Locale) -> String {
let numberFormatter = NumberFormatter()
numberFormatter.notANumberSymbol = ""
let formatter = MeasurementFormatter()
formatter.unitStyle = .long
formatter.numberFormatter = numberFormatter
formatter.locale = locale
return formatter.string(from: Measurement(value: .nan, unit: Unit(symbol: unitSymbol.rawValue)))
}
Post
Replies
Boosts
Views
Activity
I managed to do it using this:
func localizedUnit(for unit: Unit, locale: Locale) -> String {
let numberFormatter = NumberFormatter()
numberFormatter.notANumberSymbol = ""
let formatter = MeasurementFormatter()
formatter.unitStyle = .long
formatter.numberFormatter = numberFormatter
formatter.locale = locale
return formatter.string(from: Measurement(value: .nan, unit: unit))
}
Hey guys, isn't there any solution to this yet? I can't find any more information about this problem. Provisional notifications are useless to me, right now.
I just solved it! 🙌🏻
NSApp.setAccessibilityChildren([view])
I have exactly the same problem 😞