Post

Replies

Boosts

Views

Activity

Reply to Finding source for SwiftData array behaviour
The question is about the content ordering of @Model array. The employee case, [Employee] will behave like a set. i.e. random ordering The [String] case, it will behave like a normal standard array. Where do I find this in any documentation? Do you have a link to this? Thanks in advance!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’25
Reply to Ghost Padding on NavigationBarPlatterContainer
Here's an sample code that can produce the problem. It happens on rotate in simulator, only in iOS 26.* Expectation: should have the same lead spacing regardless of the rotation of the device. struct ContentView: View { @State private var showingSharePopover = false var body: some View { NavigationStack { VStack { Button { showingSharePopover = true } label: { Label("Show Share Options", systemImage: "square.and.arrow.up") .font(.title2) .padding(.vertical, 10) .padding(.horizontal, 20) } .buttonStyle(.borderedProminent) .tint(.indigo) .controlSize(.large) .shadow(radius: 5) .sheet(isPresented: $showingSharePopover, content: { }) } .navigationBarBackButtonHidden(false) .toolbar { ToolbarItem(placement: .topBarLeading) { Button { } label: { HStack { Image(systemName: "square.and.arrow.left") Text("Done") } } } } .padding() } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’25
Reply to Sharelink dismisses Parent View
Here's a sharelinkDropin for those who needs it. The following would not dismiss the presenting view when save to photos. // // SharelinkDropin.swift // import SwiftUI struct SharelinkDropin<Label: View>: View { let item: URL @ViewBuilder let label: Label @State var isPresented: Bool = false var body: some View { Button { self.isPresented.toggle() } label: { self.label } .sheet(isPresented: self.$isPresented, content: { ActivityViewController(activityItems: [self.item]) }) } } fileprivate struct ActivityViewController: UIViewControllerRepresentable { var activityItems: [Any] var applicationActivities: [UIActivity]? = nil func makeUIViewController(context: UIViewControllerRepresentableContext<ActivityViewController>) -> UIActivityViewController { let controller = UIActivityViewController(activityItems: activityItems, applicationActivities: applicationActivities) return controller } func updateUIViewController(_ uiViewController: UIActivityViewController, context: UIViewControllerRepresentableContext<ActivityViewController>) {} } #Preview { SharelinkDropin(item: URL.placeholderIcon, label: { Text("Share") }) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to SwiftData ModelContext Fetch Crashing
let id = model.persistentModelID let descriptor = FetchDescriptor<cache>( predicate: #Predicate { $0.cacheOf.persistentModelID == id } // predicate: #Predicate { $0.cacheOf.id == id } or this ) let result = (try? self.modelContext.fetch(descriptor) // 💥 crash here! .first) return result Some update on this! So turns out, I was fetching a model that was just created. The system can't find the model. I guess this was a cache miss in swiftData?! To Fix This: In your modelActor try? self.modelContext.save() basically, you want the modelContext to write into disk to create the persistentModelID Good luck!
Nov ’24
Reply to How to delete rogue iOS simulators and reclaim disk space?
That did not work. No permission. Also, I’m trying to remove the AssetsV2 simulators. Those are dead weights, but they’re being protected by SIP. Any ways to delete those?
Replies
Boosts
Views
Activity
Mar ’26
Reply to How to delete rogue iOS simulators and reclaim disk space?
FB number: https://feedbackassistant.apple.com/feedback/22225154 Feel free to adjust accordingly.
Replies
Boosts
Views
Activity
Mar ’26
Reply to Finding source for SwiftData array behaviour
yeap, here's the link to it, https://feedbackassistant.apple.com/feedback/20751909
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to Finding source for SwiftData array behaviour
The question is about the content ordering of @Model array. The employee case, [Employee] will behave like a set. i.e. random ordering The [String] case, it will behave like a normal standard array. Where do I find this in any documentation? Do you have a link to this? Thanks in advance!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to Ghost Padding on NavigationBarPlatterContainer
Here's an sample code that can produce the problem. It happens on rotate in simulator, only in iOS 26.* Expectation: should have the same lead spacing regardless of the rotation of the device. struct ContentView: View { @State private var showingSharePopover = false var body: some View { NavigationStack { VStack { Button { showingSharePopover = true } label: { Label("Show Share Options", systemImage: "square.and.arrow.up") .font(.title2) .padding(.vertical, 10) .padding(.horizontal, 20) } .buttonStyle(.borderedProminent) .tint(.indigo) .controlSize(.large) .shadow(radius: 5) .sheet(isPresented: $showingSharePopover, content: { }) } .navigationBarBackButtonHidden(false) .toolbar { ToolbarItem(placement: .topBarLeading) { Button { } label: { HStack { Image(systemName: "square.and.arrow.left") Text("Done") } } } } .padding() } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to SwiftData ModelCoders.swift:1069 Unable to decode
I wrote an extension for MKMapPoint to extend Codable It was working all the way to iOS 26 rc, not sure what changed.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to Sharelink dismisses Parent View
Here's a sharelinkDropin for those who needs it. The following would not dismiss the presenting view when save to photos. // // SharelinkDropin.swift // import SwiftUI struct SharelinkDropin<Label: View>: View { let item: URL @ViewBuilder let label: Label @State var isPresented: Bool = false var body: some View { Button { self.isPresented.toggle() } label: { self.label } .sheet(isPresented: self.$isPresented, content: { ActivityViewController(activityItems: [self.item]) }) } } fileprivate struct ActivityViewController: UIViewControllerRepresentable { var activityItems: [Any] var applicationActivities: [UIActivity]? = nil func makeUIViewController(context: UIViewControllerRepresentableContext<ActivityViewController>) -> UIActivityViewController { let controller = UIActivityViewController(activityItems: activityItems, applicationActivities: applicationActivities) return controller } func updateUIViewController(_ uiViewController: UIActivityViewController, context: UIViewControllerRepresentableContext<ActivityViewController>) {} } #Preview { SharelinkDropin(item: URL.placeholderIcon, label: { Text("Share") }) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Sharelink dismisses Parent View
x-posted on reddit: https://www.reddit.com/r/SwiftUI/comments/1mtm9cn/bug_or_feature_sharelink_smart_dismiss_presenting/?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to MapKit Not Updating MapContentBuilder after each mapCameraKeyframeAnimator keyframe
For some reason I can't extract the issue into a sample project. Thank you for your reply, I will regroup.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Apple Developer Program complain expired card, but it's NOT!
some update on this. turns out. This update doesn't work on apple web, this only works on iOS/iPadOS operation system. I was able to update only on my test phone.
Replies
Boosts
Views
Activity
Jul ’25
Reply to Importing Data into SwiftData in the Background Using ModelActor and @Query
IS this fixed? I'm still experiencing this in 18.4 GM version of the iOS OS
Replies
Boosts
Views
Activity
Jun ’25
Reply to Location streaming onto Live Activity
yes, my app is a workout app. The workout session link didn't work for me. Could you paste the URL as txt?
Replies
Boosts
Views
Activity
Jun ’25
Reply to Persist OSLog in "Analytics & Improvements"
From the looks of it, I need to implement the following. Apple don't have the facility for the items below. use the Logger api for logging and writing to the system log use OSLogStore on a separate thread to write to disk in my app space collect the log and analyze the performance issue
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Persist OSLog in "Analytics & Improvements"
ops, no, I'm not interested in the deviceActivity framework. Looks like I can't remove tags neither. I want to use the Logger/OSLog framework to write logs to disk. So that I can understand the performance issue with the app.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to SwiftData ModelContext Fetch Crashing
let id = model.persistentModelID let descriptor = FetchDescriptor<cache>( predicate: #Predicate { $0.cacheOf.persistentModelID == id } // predicate: #Predicate { $0.cacheOf.id == id } or this ) let result = (try? self.modelContext.fetch(descriptor) // 💥 crash here! .first) return result Some update on this! So turns out, I was fetching a model that was just created. The system can't find the model. I guess this was a cache miss in swiftData?! To Fix This: In your modelActor try? self.modelContext.save() basically, you want the modelContext to write into disk to create the persistentModelID Good luck!
Replies
Boosts
Views
Activity
Nov ’24