FB15290642
Post
Replies
Boosts
Views
Activity
@Developer Tools Engineer
FB15244277
@DTS Engineer @Developer Tools Engineer
Thank you for your fast response and detailed information! ❤️
After further investigation, I found the implementation of JSONSerialization seems to be incorrect. When using .sortedKeys options with JSONSerialization, the keys are always sorted in the "Finder-like" order instead of lexicographic order. This is inconsistent with the documentation. But I'm not sure what is the expected behavior.
I can reproduce this issue with Xcode 16.0 on the latest macOS 15.0 and iOS 18.0. I've submitted a feedback FB15177571.
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.
FB15125912
@DTS Engineer Thanks!!🙏
FB15078533
xcrun simctl delete all
This resolved the issue. However, you need to manually add all the simulators after this.
FB15038185
Same here. But seems only happening on previous iOS 18.0 22A5307f and 22A5316j.
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.
Workaround:
Convert to image.
// widgetRenderingMode == .accented
Image(uiImage: "😄".toImage(fontSize: size))
.resizable()
.scaledToFit()
.luminanceToAlpha()
Workaround:
Check #available(iOS 18.0, *) at the top level, without using WidgetBundleBuilder.
Update
Moving the .popover(isPresented:) insides TabView works around the issue.
State of Mind API is available on iOS/watchOS/visionOS beta now.