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 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
Reply to Is there a `isiOSAppOnVision` flag to check iOS app on Vision Pro at runtime?
https://medium.com/@timonus/low-hanging-fruit-for-ios-apps-running-on-visionos-08a85db0fb31
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to UITextView select All is broken on Mac Catalyst 16
Same here on macOS Sonoma 14.4.1. =。=
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Xcode 15.3 AppIntentsSSUTraining warning: missing the definition of locale # variables.1.definitions
FB13682631
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to `WCSession.isComplicationEnabled` is `false` when complication is in Smart Stack
Well, it seems I've completely missed the point.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’24
Reply to Xcode Organizer unable to get crash logs from physical Vision Pro
Update Selecting specific app version instead of "All Version" solved the problem.
Replies
Boosts
Views
Activity
Jan ’24
Reply to Xcode Cloud still lacks the Xcode 15.2 version
Solved.
Replies
Boosts
Views
Activity
Jan ’24