Search results for

“swiftui”

17,495 results found

Post

Replies

Boosts

Views

Activity

Rejected a couple of time for 5.1.1/5.1.2 - AI consent screen not seen by reviewers despite being first screen on launch
I've been rejected a couple of times for Guidelines 5.1.1(i) and 5.1.2(i) regarding third-party AI data sharing consent. Each time, the reviewer states they cannot see the consent prompt, even though it is the first screen displayed on every app launch. My app (GymFusion) uses Anthropic's Claude AI for features like meal scanning, body composition analysis, and workout coaching. Here is exactly what I've implemented: IN-APP CONSENT (embedded in view hierarchy, not a sheet/popup): In my RootView.swift, the consent is a conditional view that blocks the entire app: } else if !consentManager.hasConsented && !consentManager.hasSeenConsent { AIConsentView() } else if auth.isAuthenticated { MainTabView() } The hasSeenConsent flag is reset to false on every app launch in the App's init(), so the consent screen appears on every launch until the user accepts: init() { UserDefaults.standard.set(false, forKey: user_ai_consent_seen) AIConsentManager.shared.hasSeenConsent = false FirebaseApp.configure() } THE CONSE
4
0
363
Mar ’26
Reply to EASession(accessory:forProtocol:) always returns nil — MFI accessory iAP2
Since I have already ruled out SwiftUI lifecycle interference and simulator limitations, are there specific logging categories in Console.app or internal ExternalAccessory states you recommend I monitor to diagnose why the connection is failing? There isn't a lot that can go wrong from the app side, assuming your app is properly configured and functional. As one more confirmation test, I would suggest testing with the old EADemo sample. The code is fairly old, but you should still be able to get it working without too much effort. If that's failing, then that's pretty strong evidence that it's either a bug in the system or a problem with the accessory. Has your accessory passed certification? And have you ever been able to work with the ExternalAccessory framework/app? Finally, have you filed a bug on this and, if so, what's the bug number? __ Kevin Elliott DTS Engineer, CoreOS/Hardware
Topic: App & System Services SubTopic: Hardware Tags:
Mar ’26
Reply to Maps: opening hours API / Property
You can't access this data directly through the API, but you can ask MapKit to display all of a location's detail on your behalf with the mapItemDetailSelectionAccessory API. There is a sample code project with both SwiftUI and UIKit examples that you can play with to see what I mean. — Ed Ford,  DTS Engineer
Mar ’26
Reply to Section(isExpanded:) in sidebar List, inconsistent row animation on collapse/expand
Thanks for your post. This is interesting. 🧐 Do you mind filing a report using Feedback Assistant that I can share with the relevant engineering team? Share as much details as you can about affected platforms and versions. I would love to know if this started happening with a specific update or has always been there. As for workarounds, you can try handling the animation directly instead of letting it be handled implicitly or under the hood. For example, you can disable the animation entirely with .animation(.none, value: sectionExpanded) or create your own custom Section with a dropdown and animating content. You can also build the sidebar content in AppKit and display it with SwiftUI using NSViewControllerRepresentable Once complete, reply with the FB number below. Thank you.  Travis
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’26
Reply to State loss and sheets dismiss on backgrounding app
@DTS Engineer I was wondering if you have any updates about this? I've updated the Feedback with some deeper details on what might be the issue. Unfortunately in the real case of where this is happening I'm unable to push the state all the way up the hierarchy. This sample project is a true representation of a large SwiftUI project. Thanks
Topic: UI Frameworks SubTopic: SwiftUI
Mar ’26
Reply to EASession(accessory:forProtocol:) always returns nil — MFI accessory iAP2
Hi Kevin, Thank you for the troubleshooting steps. To clarify the current state of the environment: Testing Environment: I am testing exclusively on a physical iOS device (iPhone [Model] running iOS [Version]); I am not using the simulator for these tests. Framework: The implementation is already built using UIKit. I am managing the accessory lifecycle within a standard UIViewController and AppDelegate structure. Integration Status: Despite being in a pure UIKit environment, I am still facing the issue where [mention the specific symptom, e.g., the accessory is not appearing in the picker / the session fails to open]. Since I have already ruled out SwiftUI lifecycle interference and simulator limitations, are there specific logging categories in Console.app or internal ExternalAccessory states you recommend I monitor to diagnose why the connection is failing?
Topic: App & System Services SubTopic: Hardware Tags:
Mar ’26
Section(isExpanded:) in sidebar List, inconsistent row animation on collapse/expand
When using Section(_:isExpanded:) inside a List with .listStyle(.sidebar) in a NavigationSplitView, some rows don't animate with the others during collapse and expand. Specific rows (often in the middle of the section) snap in/out instantly while the rest animate smoothly. I've reproduced this with both static views and ForEach. Minimal reproduction: struct SidebarView: View { @State private var sectionExpanded = true @State private var selection: Int? var body: some View { NavigationSplitView { List(selection: $selection) { Section(Section, isExpanded: $sectionExpanded) { ForEach(1...3, id: .self) { index in NavigationLink(value: index) { Label(Item (index), systemImage: (index).circle) } } } } .listStyle(.sidebar) .navigationTitle(Sidebar) } detail: { if let selection { Text(Selected item (selection)) } else { Text(Select an item) } } } } Environment: macOS 26.3, Xcode 26.3, SwiftUI Steps to reproduce: Run the above code in a macOS app Click the section disclosure chevron to collapse Observe that s
2
0
403
Mar ’26
Xcode 26.3 Simulator renders SwiftUI app only inside a rounded rectangle instead of full screen
Hi everyone, I’m seeing a strange rendering issue in Xcode 26.3 that seems to affect only the iOS Simulator. Environment: Xcode 26.3 SwiftUI app Reproduces in Simulator only Reproduces across multiple simulator device models My code is just a minimal example Expected behavior: The view should fill the entire screen. Actual behavior: The app content is rendered only inside a centered rounded rectangle/card-like area, with black space around it, as if the app canvas is being clipped incorrectly. Minimal reproduction: import SwiftUI @main struct LayoutShowcaseApp: App { var body: some Scene { WindowGroup { Color.green.ignoresSafeArea() } } } I also tried wrapping it in a ZStack and using: .frame(maxWidth: .infinity, maxHeight: .infinity) .background(...) .ignoresSafeArea() but the result is the same. What I already tried: Clean Build Folder Switching simulator device models Resetting simulator content/settings Rebuilding from a fresh minimal SwiftUI project Since this happens with such
Topic: UI Frameworks SubTopic: SwiftUI
1
0
439
Mar ’26
iOS 26: Toolbar button background flashes black during NavigationStack transitions (dark mode)
I’m seeing a visual glitch with toolbar buttons when building with Xcode 26 for iOS 26. During transitions (both pushing in a NavigationStack and presenting a .sheet with its own NavigationStack), the toolbar button briefly flashes the wrong background colour (black in dark mode, white in light mode) before animating to the correct Liquid Glass appearance. This happens even in a minimal example and only seems to affect system toolbar buttons. A custom view with .glassEffect() doesn’t have the issue. I’ve tried: .tint(...), UINavigationBarAppearance/UIToolbarAppearance, and setting backgrounds on hosting/nav/window but none of those made any difference. Here’s a minimal reproducible example: import SwiftUI struct ContentView: View { @State private var showingSheet = false var body: some View { NavigationStack { List { NavigationLink(Push (same stack — morphs)) { DetailView() } Button(Sheet (separate stack — flashes)) { showingSheet = true } } .navigationTitle(Root) .scrollContentBackground(.hidden) .b
1
0
692
Mar ’26
Now Available: Wishlist Sample Code for SwiftUI
We’ve just added a new sample code project to the SwiftUI Essentials documentation! If you attended the recent SwiftUI foundations: Build great apps with SwiftUI activity, you might recognize Wishlist, our travel-planning sample app. You can now explore and download the complete project here
0
0
93
Mar ’26
Glass Effect Label Shadow Clipping During Morph Animation
Hi all, I’m experiencing a visual bug when applying the glass effect to a Label in Liquid Glass (current version 26.2 on simulator; also reproducible in 26.3.1 on device). Issue: On a label with .glassEffect(.regular), when collapsing via morph animation, the shadow is clipped during the animation, and then suddenly pops back to its un-clipped state, resulting in a jarring visual effect. Minimal Example: import SwiftUI struct ContentView: View { var body: some View { Menu { Button(Duplicate, action: {}) Button(Rename, action: {}) Button(Delete…, action: {}) } label: { Label(PDF, systemImage: doc.fill) .padding() .glassEffect(.regular) } } } #Preview { ContentView() } I am not sure if I am misusing the .glassEffect() on the label and maybe there is another more native way of achieving this look? Any advice or workaround suggestions would be greatly appreciated!
2
0
340
Mar ’26
Simulator was shutdown during an update
I am trying to preview my SwiftUI views but Xcode Preview Canvas failing. I tried everything that I found at internet but nothing works. Finally I created a new iOS project that contains only a view import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundStyle(.tint) Text(Hello, world!) } .padding() } } #Preview { ContentView() } Even this view cannot be previewed The error is Simulator was shutdown during an update Simulator [3E0DB935-C4C2-4566-BA48-8E21564C207C] failed to boot and may have crashed. I tried to restart xCode, restart Mac, download ios 26.0 sdk and created a simulator with that sdk but nothing helped. Do you have an idea?
1
0
281
Mar ’26
Reply to Xcode 26.3 not rendering Unicode/Emoji in Simulator or Canvas
Thanks so much for this post and thanks for your patience on my replay. When Unicode characters and emojis render perfectly on a physical device but appear as blank spaces or empty boxes in the Simulator and SwiftUI Canvas, in my opinion it means the Color Emoji font is missing and this is corrupted, or failing to load inside the Simulator Runtime. Because the SwiftUI Canvas uses the exact same underlying simulator infrastructure as the standalone Simulator app, both break at the same time. We identified this a bug and I would encourage you to use the physical device or to download the latest beta simulators iOS 24.4 RC https://developer.apple.com/download/os/ and let me know it the issue has been fixed. Here are the most effective ways to resolve this issue: Open Xcode and go to Xcode > Settings (or Preferences) > Platforms. Find the iOS Simulator runtime you are currently using (e.g., iOS 26.3). Right-click (or Control-click) it and select Delete. Once deleted, click the + button at
Mar ’26
Rejected a couple of time for 5.1.1/5.1.2 - AI consent screen not seen by reviewers despite being first screen on launch
I've been rejected a couple of times for Guidelines 5.1.1(i) and 5.1.2(i) regarding third-party AI data sharing consent. Each time, the reviewer states they cannot see the consent prompt, even though it is the first screen displayed on every app launch. My app (GymFusion) uses Anthropic's Claude AI for features like meal scanning, body composition analysis, and workout coaching. Here is exactly what I've implemented: IN-APP CONSENT (embedded in view hierarchy, not a sheet/popup): In my RootView.swift, the consent is a conditional view that blocks the entire app: } else if !consentManager.hasConsented && !consentManager.hasSeenConsent { AIConsentView() } else if auth.isAuthenticated { MainTabView() } The hasSeenConsent flag is reset to false on every app launch in the App's init(), so the consent screen appears on every launch until the user accepts: init() { UserDefaults.standard.set(false, forKey: user_ai_consent_seen) AIConsentManager.shared.hasSeenConsent = false FirebaseApp.configure() } THE CONSE
Replies
4
Boosts
0
Views
363
Activity
Mar ’26
Reply to EASession(accessory:forProtocol:) always returns nil — MFI accessory iAP2
Since I have already ruled out SwiftUI lifecycle interference and simulator limitations, are there specific logging categories in Console.app or internal ExternalAccessory states you recommend I monitor to diagnose why the connection is failing? There isn't a lot that can go wrong from the app side, assuming your app is properly configured and functional. As one more confirmation test, I would suggest testing with the old EADemo sample. The code is fairly old, but you should still be able to get it working without too much effort. If that's failing, then that's pretty strong evidence that it's either a bug in the system or a problem with the accessory. Has your accessory passed certification? And have you ever been able to work with the ExternalAccessory framework/app? Finally, have you filed a bug on this and, if so, what's the bug number? __ Kevin Elliott DTS Engineer, CoreOS/Hardware
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to Maps: opening hours API / Property
You can't access this data directly through the API, but you can ask MapKit to display all of a location's detail on your behalf with the mapItemDetailSelectionAccessory API. There is a sample code project with both SwiftUI and UIKit examples that you can play with to see what I mean. — Ed Ford,  DTS Engineer
Replies
Boosts
Views
Activity
Mar ’26
Reply to Section(isExpanded:) in sidebar List, inconsistent row animation on collapse/expand
Thanks for your post. This is interesting. 🧐 Do you mind filing a report using Feedback Assistant that I can share with the relevant engineering team? Share as much details as you can about affected platforms and versions. I would love to know if this started happening with a specific update or has always been there. As for workarounds, you can try handling the animation directly instead of letting it be handled implicitly or under the hood. For example, you can disable the animation entirely with .animation(.none, value: sectionExpanded) or create your own custom Section with a dropdown and animating content. You can also build the sidebar content in AppKit and display it with SwiftUI using NSViewControllerRepresentable Once complete, reply with the FB number below. Thank you.  Travis
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to State loss and sheets dismiss on backgrounding app
@DTS Engineer I was wondering if you have any updates about this? I've updated the Feedback with some deeper details on what might be the issue. Unfortunately in the real case of where this is happening I'm unable to push the state all the way up the hierarchy. This sample project is a true representation of a large SwiftUI project. Thanks
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Mar ’26
Reply to EASession(accessory:forProtocol:) always returns nil — MFI accessory iAP2
Hi Kevin, Thank you for the troubleshooting steps. To clarify the current state of the environment: Testing Environment: I am testing exclusively on a physical iOS device (iPhone [Model] running iOS [Version]); I am not using the simulator for these tests. Framework: The implementation is already built using UIKit. I am managing the accessory lifecycle within a standard UIViewController and AppDelegate structure. Integration Status: Despite being in a pure UIKit environment, I am still facing the issue where [mention the specific symptom, e.g., the accessory is not appearing in the picker / the session fails to open]. Since I have already ruled out SwiftUI lifecycle interference and simulator limitations, are there specific logging categories in Console.app or internal ExternalAccessory states you recommend I monitor to diagnose why the connection is failing?
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Mar ’26
Section(isExpanded:) in sidebar List, inconsistent row animation on collapse/expand
When using Section(_:isExpanded:) inside a List with .listStyle(.sidebar) in a NavigationSplitView, some rows don't animate with the others during collapse and expand. Specific rows (often in the middle of the section) snap in/out instantly while the rest animate smoothly. I've reproduced this with both static views and ForEach. Minimal reproduction: struct SidebarView: View { @State private var sectionExpanded = true @State private var selection: Int? var body: some View { NavigationSplitView { List(selection: $selection) { Section(Section, isExpanded: $sectionExpanded) { ForEach(1...3, id: .self) { index in NavigationLink(value: index) { Label(Item (index), systemImage: (index).circle) } } } } .listStyle(.sidebar) .navigationTitle(Sidebar) } detail: { if let selection { Text(Selected item (selection)) } else { Text(Select an item) } } } } Environment: macOS 26.3, Xcode 26.3, SwiftUI Steps to reproduce: Run the above code in a macOS app Click the section disclosure chevron to collapse Observe that s
Replies
2
Boosts
0
Views
403
Activity
Mar ’26
Reply to multiple .searchable on same View
I have never done it, but isn't it just the matter of constructing SwiftUI View consisting of multiple View, each of which has its own body?
Replies
Boosts
Views
Activity
Mar ’26
Xcode 26.3 Simulator renders SwiftUI app only inside a rounded rectangle instead of full screen
Hi everyone, I’m seeing a strange rendering issue in Xcode 26.3 that seems to affect only the iOS Simulator. Environment: Xcode 26.3 SwiftUI app Reproduces in Simulator only Reproduces across multiple simulator device models My code is just a minimal example Expected behavior: The view should fill the entire screen. Actual behavior: The app content is rendered only inside a centered rounded rectangle/card-like area, with black space around it, as if the app canvas is being clipped incorrectly. Minimal reproduction: import SwiftUI @main struct LayoutShowcaseApp: App { var body: some Scene { WindowGroup { Color.green.ignoresSafeArea() } } } I also tried wrapping it in a ZStack and using: .frame(maxWidth: .infinity, maxHeight: .infinity) .background(...) .ignoresSafeArea() but the result is the same. What I already tried: Clean Build Folder Switching simulator device models Resetting simulator content/settings Rebuilding from a fresh minimal SwiftUI project Since this happens with such
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
439
Activity
Mar ’26
iOS 26: Toolbar button background flashes black during NavigationStack transitions (dark mode)
I’m seeing a visual glitch with toolbar buttons when building with Xcode 26 for iOS 26. During transitions (both pushing in a NavigationStack and presenting a .sheet with its own NavigationStack), the toolbar button briefly flashes the wrong background colour (black in dark mode, white in light mode) before animating to the correct Liquid Glass appearance. This happens even in a minimal example and only seems to affect system toolbar buttons. A custom view with .glassEffect() doesn’t have the issue. I’ve tried: .tint(...), UINavigationBarAppearance/UIToolbarAppearance, and setting backgrounds on hosting/nav/window but none of those made any difference. Here’s a minimal reproducible example: import SwiftUI struct ContentView: View { @State private var showingSheet = false var body: some View { NavigationStack { List { NavigationLink(Push (same stack — morphs)) { DetailView() } Button(Sheet (separate stack — flashes)) { showingSheet = true } } .navigationTitle(Root) .scrollContentBackground(.hidden) .b
Replies
1
Boosts
0
Views
692
Activity
Mar ’26
Now Available: Wishlist Sample Code for SwiftUI
We’ve just added a new sample code project to the SwiftUI Essentials documentation! If you attended the recent SwiftUI foundations: Build great apps with SwiftUI activity, you might recognize Wishlist, our travel-planning sample app. You can now explore and download the complete project here
Replies
0
Boosts
0
Views
93
Activity
Mar ’26
Glass Effect Label Shadow Clipping During Morph Animation
Hi all, I’m experiencing a visual bug when applying the glass effect to a Label in Liquid Glass (current version 26.2 on simulator; also reproducible in 26.3.1 on device). Issue: On a label with .glassEffect(.regular), when collapsing via morph animation, the shadow is clipped during the animation, and then suddenly pops back to its un-clipped state, resulting in a jarring visual effect. Minimal Example: import SwiftUI struct ContentView: View { var body: some View { Menu { Button(Duplicate, action: {}) Button(Rename, action: {}) Button(Delete…, action: {}) } label: { Label(PDF, systemImage: doc.fill) .padding() .glassEffect(.regular) } } } #Preview { ContentView() } I am not sure if I am misusing the .glassEffect() on the label and maybe there is another more native way of achieving this look? Any advice or workaround suggestions would be greatly appreciated!
Replies
2
Boosts
0
Views
340
Activity
Mar ’26
Simulator was shutdown during an update
I am trying to preview my SwiftUI views but Xcode Preview Canvas failing. I tried everything that I found at internet but nothing works. Finally I created a new iOS project that contains only a view import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundStyle(.tint) Text(Hello, world!) } .padding() } } #Preview { ContentView() } Even this view cannot be previewed The error is Simulator was shutdown during an update Simulator [3E0DB935-C4C2-4566-BA48-8E21564C207C] failed to boot and may have crashed. I tried to restart xCode, restart Mac, download ios 26.0 sdk and created a simulator with that sdk but nothing helped. Do you have an idea?
Replies
1
Boosts
0
Views
281
Activity
Mar ’26
Reply to Xcode 26.3 not rendering Unicode/Emoji in Simulator or Canvas
Thanks so much for this post and thanks for your patience on my replay. When Unicode characters and emojis render perfectly on a physical device but appear as blank spaces or empty boxes in the Simulator and SwiftUI Canvas, in my opinion it means the Color Emoji font is missing and this is corrupted, or failing to load inside the Simulator Runtime. Because the SwiftUI Canvas uses the exact same underlying simulator infrastructure as the standalone Simulator app, both break at the same time. We identified this a bug and I would encourage you to use the physical device or to download the latest beta simulators iOS 24.4 RC https://developer.apple.com/download/os/ and let me know it the issue has been fixed. Here are the most effective ways to resolve this issue: Open Xcode and go to Xcode > Settings (or Preferences) > Platforms. Find the iOS Simulator runtime you are currently using (e.g., iOS 26.3). Right-click (or Control-click) it and select Delete. Once deleted, click the + button at
Replies
Boosts
Views
Activity
Mar ’26