Post

Replies

Boosts

Views

Activity

Reply to SwiftData app always at 100% cpu when idle after upgrading to Xcode 15.3
I am seeing something similar, but not exactly the same. My app is also using SwiftUI + SwiftData. When running debug on Xcode 15.3 (release) + iOS 17.4 simulator I'm seeing 100% (or greater) CPU when typing into a TextEditor that is bound to a SwiftData model object. That model object is part of a @Query. If I'm not typing, however, the CPU returns to 0%. I just tried the same using Xcode 15.2 (release) + simulator on iOS 17.4 and the CPU is much more in line with expectations. I have not tried this on a device (rather than simulator). I'll try the device when I get to my desk. Frustrating.
Mar ’24
Reply to Why tabView jumps one view back on orientation change?
The above frame(width:) work-around did not work for me (iOS 16 beta 3). I was getting jerky animations and sometimes incorrect sizes. What did work was to set the selectedTab back to the proper tab, as follows: .onReceive(NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification)) { info in   let currentTab = selectedTab     DispatchQueue.main.async {      if currentTab != selectedTab {        selectedTab = currentTab       }      } } In the code above, selectedTab is my @State variable that is bound to the TabView's selection. The value of selectedTab when the onReceive is executed is the current value -- the value before this bug changes the selection. Dispatching and setting selectedTab back corrects the change from the bug. This seems to work well for me. Filed as FB10871235.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to CGImageDestinationCopyImageSource no longer merges metadata on iOS 15
I was having the same issue as the original poster. I realized that in my code, as well as in their code, I don't actually need to merge the metadata, as I've actually created an updated version using the mutable copy of the original metadata. Once I removed the following line: let options = [       kCGImageDestinationMetadata as String : mutableMetadata,       // kCGImageDestinationMergeMetadata as String : true // <-- remove this line       ] as [String : Any] it works as expected. The full metadata in mutableMetadata is written properly. I've only tested on jpg and heic files. I do agree that kCGImageDestinationMergeMetadata = true should work as expected, but this work-around is a decent fix. The full code for my working example is here: https://gist.github.com/rob-secondstage/99d30f4e9804c5f250dcb063f779fd87
Topic: Media Technologies SubTopic: General Tags:
Jul ’22