Post

Replies

Boosts

Views

Activity

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 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 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 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 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 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 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 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 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 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 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