Post

Replies

Boosts

Views

Activity

Reply to New Swiftui Text timer not counting down
Text(.now, format:.timer(countingDownIn: Date.now..<Date.now.addingTimeInterval(120), showsHours: true, maxFieldCount: 2, maxPrecision: .seconds(60)) ) Using Date.now here confused me 🤔. The first argument .now will be evaluated when the view body is updated, in a very unpredictable way. The text will stay on the last view update time. I think this new API should be used in this way: @State private var date: Date = .now var body: some View { Text(date, format: .timer(...)) .onReceive(Timer.publish(/* on every seconds */)) { date = $0 } } UPDATE: Found: https://developer.apple.com/documentation/swiftui/timedatasource/currentdate Simply change Date.now to TimeDataSource<Date>.currentDate.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’24
Reply to JSONEncoder: How to sort keys using "localizedStandardCompare"? (just like how Xcode 16 serialize a xcstrings file)
PS: Only Xcode 16 serializes the String Catalog files into the "Finder-like" order. In Xcode 15, the String Catalog files are in lexicographic order. So, this is a new in Xcode 16.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Tab button's ax identifier is missing when using `.sidebarAdaptable` TabViewStyle
FB15125912 @DTS Engineer Thanks!!🙏
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Unable to scroll the list under View.safeAreaInset()
FB15078533
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Unable to Launch Tests/UITests in Xcode 16 with iOS 18 Simulator
xcrun simctl delete all This resolved the issue. However, you need to manually add all the simulators after this.
Replies
Boosts
Views
Activity
Sep ’24
Reply to Tapping tab icon causes incorrect navigation title layout in SwiftUI on iOS 18
FB15038185
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to App is crashing when using "withCheckedContinuation" in Xcode 16 beta 5
Same here. But seems only happening on previous iOS 18.0 22A5307f and 22A5316j.
Replies
Boosts
Views
Activity
Sep ’24
Reply to New Swiftui Text timer not counting down
Text(.now, format:.timer(countingDownIn: Date.now..<Date.now.addingTimeInterval(120), showsHours: true, maxFieldCount: 2, maxPrecision: .seconds(60)) ) Using Date.now here confused me 🤔. The first argument .now will be evaluated when the view body is updated, in a very unpredictable way. The text will stay on the last view update time. I think this new API should be used in this way: @State private var date: Date = .now var body: some View { Text(date, format: .timer(...)) .onReceive(Timer.publish(/* on every seconds */)) { date = $0 } } UPDATE: Found: https://developer.apple.com/documentation/swiftui/timedatasource/currentdate Simply change Date.now to TimeDataSource<Date>.currentDate.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Wrong unit in HIG > Components > System Experiences > Widget > watchOS widget dimensions
FB14985926
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Emojis are not properly rendered in accented widgets on iOS 18
Workaround: Convert to image. // widgetRenderingMode == .accented Image(uiImage: "😄".toImage(fontSize: size)) .resizable() .scaledToFit() .luminanceToAlpha()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to WidgetBundleBuilder crash on #available(iOS 18.0) check: WidgetBundleBuilder includes an unknown OS version
Workaround: Check #available(iOS 18.0, *) at the top level, without using WidgetBundleBuilder.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to View.popover(isPresented:) does not show up above TabView on iOS 18
Update Moving the .popover(isPresented:) insides TabView works around the issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Does HealthKit in iOS 17 provide any APIs related to mood tracking?
State of Mind API is available on iOS/watchOS/visionOS beta now.
Replies
Boosts
Views
Activity
Jul ’24
Reply to Xcode 15.3 AppIntentsSSUTraining warning: missing the definition of locale # variables.1.definitions
Reproducible in Xcode 16 beta. It seems that AppIntentsSSUTraining emits warnings for locales that don't support flexible matching. The thing is broken. So I disabled flexible matching in the build settings, and the warnings are gone.
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to Migrating to WidgetKit, issues with editing Watch Faces on iPhone
@simonfromhelix iOS 18 and watchOS 11 are comming! Looking forward to the new features and new bugs 😂
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Dynamic call blocking
Hope is a good thing. 😂 WWDC24, let’s wait and see!
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’24