Post

Replies

Boosts

Views

Activity

Reply to App Tracking Transparency Alert not Showing and status .notDetermined
I can reproduce this issue in a macOS app I have added NSUserTrackingUsageDescription to my info.plist I call requestTrackingAuthorization(completionHandler:) No dialog is shown, and trackingAuthorizationStatus remains "notDetermined" Interestingly, System Preferences doesn't seem to have anything related to this. macOS 11.6 Big Sur Xcode 13.0 (13A233) On iOS... Settings > Privacy > Tracking If the user turns off "Allow Apps to Request to Track"... ...then the dialog will never be shown... ...and "all new app tracking requests are automatically denied." (This case must be considered, but presumably, this is not happening to you, as you still see "notDetermined")
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to iOS 15 - New JSONDecoding Decimals issue
Also interesting: struct DTO: Decodable { let amount: Double var decimal: Decimal { Decimal(amount) } } amount and decimal both print as 9.21 Or (better) try this: struct DTO: Decodable { let amount: Decimal enum CodingKeys: CodingKey { case amount } init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let doubleValue = try container.decode(Double.self, forKey: .amount) amount = Decimal(doubleValue) } } This is basically keeping it simple for the JSON... JSON can do Doubles... ...then we convert to the Decimal that we really want. Plug-in this updated DTO to your project, and the rest of your code remains as-is.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to DateFormatter vs leap seconds
Leap seconds are a long-running saga on macOS (and all Unix OSes). If you periodically sync your time with a server, then things are generally fine. But if you need to-the-second accuracy, while a leap-second is added, and you are performing date maths, then maybe not so good! If you have developed a workaround, please share it here!
Topic: App & System Services SubTopic: General Tags:
Oct ’21
Reply to Alert isn't presenting when we use confirmationDialog in a View Xcode 13
Try this: @State private var showingOptions = false @State private var showingAlert = false var body: some View { VStack { Button("Show Options") { showingOptions = true } .alert(isPresented: $showingAlert) { Alert(title: Text("Alert"), message: Text("Message"), dismissButton: .default(Text("OK"))) } .confirmationDialog("Select option", isPresented: $showingOptions, titleVisibility: .visible) { Button("Show Alert") { self.showingAlert = true } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Cannot convert value of type '[Double]' to expected argument type 'Double'
@H957169 some friendly tips: Please remember always to respond, when people try to help you. Include enough information in your question to allow people to understand your problem. When one of your questions is answered, remember to mark the question as answered. Then the forum will work as intended, and people will be more likely to help you in future.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21