Yeah, there's no way to get the locale at the moment. I've filed a feature request for that (FB9747367) and I suggest you do the same.
For now, I load a product using the original StoreKit APIs and pull the locale from that. It's kind of annoying, and seems a little silly, but it gets the job done and gets the correct locale.
The big use case for this for me is to show the monthly price for a yearly subscription. There's no way to format that correctly without knowing the locale.
Post
Replies
Boosts
Views
Activity
I've had the same problem with the 16.0 RC but while using my own custom AlignmentID. Unfortunately, removing explicit checks for == nil didn't work, but I did eventually figure out I could make the Alignment nonisolated and that appears to have fixed the problem.
extension HorizontalAlignment {
private enum MyAlignment: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
context[HorizontalAlignment.center]
}
}
nonisolated // Crashes without this
static let myAlignment = HorizontalAlignment(MyAlignment.self)
}