Search results for

“swiftui”

17,110 results found

Post

Replies

Boosts

Views

Activity

Charts performance issue
Hi, I want to recreate a chart from Apple Health and I have code like this. When I scroll - especially the week and month charts, there are performance issues. If I remove .chartScrollPosition(x: $scrollChartPosition), it runs smoothly, but I need to know which part of the chart is currently displayed. Can you help me? import Charts import SwiftUI struct MacroChartView: View { var selectedRange: ChartRange var binnedPoints: [MacroBinPoint] @State private var scrollChartPosition: Date = .now var body: some View { VStack { Text((selectedRange.rangeLabel(for: scrollChartPosition))) Chart(binnedPoints) { point in BarMark( x: .value(Date, point.date, unit: selectedRange.binComponent), y: .value(Calories, point.calories) ) } .frame(height: 324) .chartXVisibleDomain(length: selectedRange.visibleDomainLength()) .chartScrollableAxes(.horizontal) .chartScrollPosition(x: $scrollChartPosition) .chartScrollTargetBehavior(.valueAligned(matching: selectedRange.scrollAlignmentComponents)) .chartXAxis { switch select
2
0
557
Mar ’26
Reply to 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
Thank you for the feedback. Let me clarify: My app is a SwiftUI iOS fitness app called GymFusion. It uses Anthropic's Claude AI API to power features like meal photo scanning, body composition analysis, and workout coaching. The rejection is solely about Guidelines 5.1.1(i) and 5.1.2(i) — the app shares user data with a third-party AI service (Anthropic) and Apple says the app doesn't clearly disclose this or ask for permission. There are no in-app purchase issues — apologies for any confusion. Here's what I've implemented: The app's entry point (RootView) shows the AI consent screen as the first view on every launch. It's not a sheet or popup — it's embedded in the view hierarchy: if auth.isLoading { // Loading screen } else if !consentManager.hasConsented && !consentManager.hasSeenConsent { AIConsentView() // Consent blocks the entire app } else if auth.isAuthenticated { MainTabView() } else { AuthView() } The consent screen: Lists all data shared (photos, workout history, body measurements
Mar ’26
Scrolling to row with a pinned header view
Hi, I have a list with section headers as pinned views. I'm trying to programmatically scroll to a view inside a section using a proxy.scrollTo(id, anchor: .top). I was expecting the view to be aligned to the top of the scroll view but after the pinned header. Instead, it's aligned to the top of the scroll view overlapping with the header, hiding most of the row. Here is a code snippet to reproduce: import SwiftUI struct ContentView: View { var body: some View { ScrollViewReader { proxy in ScrollView { LazyVStack( pinnedViews: .sectionHeaders ){ ForEach(1...10, id: .self) { count1 in Section(content: { Text(First row) .id((count1), row1) Text(second row) Text(third row) }, header: { Text(Section (count1)).font(.title) .background(.red) }) } } } .safeAreaInset(edge: .bottom) { Button(Tap me) { proxy.scrollTo(3, row1, anchor: .top) } .padding() } } } } Any idea how this could be solved?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
55
Mar ’26
UIView + CATiledLayer + SwiftUI Hosting + iOS 26 = Crash?
Our app uses a UIView backed by a CATiledLayer that is embedded in a UIScrollView, to represent a large document viewer. (PDF data, actually.) It needs to be big - far too big to allocate a single layer, and it needs to be able to reveal more detail as you zoom in. This is the exact use case for a CATiledLayer. CATiledLayer does its drawing on a background thread, as you know, and we've always taken care to make our draw method thread-safe. It has worked great for us, for over a decade now. However, starting with iOS 26, we've been having some surprising crashes. It looks like our CATiledLayer (I think?) is trying to trigger a layout on the background thread as well. This is frustrating because it doesn't have any subviews or sublayers - there's no reason for it. I'm suspecting the CATiledLayer because it does its drawing on a thread, so maybe it would also do other things there, but honestly, I'm not sure - it's hard to tell. Here's the crash. Normally with a crash like this, the solution is to bounce your l
Topic: UI Frameworks SubTopic: UIKit
2
0
245
Mar ’26
swift: Calling "/usr/bin/defaults" returns no data
I'd like to create a small helper app for new students do read/write User default settings. Since it was not possible using the UserDefaults class I decided to use the /usr/bin/defaults. Unfortuntely it seems not to return anything. Debug output shows Got data: 0 bytes Here is a sample code: import SwiftUI func readDefaults(domain : String, key :String) -> String { let cmdPath = /usr/bin/defaults //let cmdPath = /bin/ls let cmd = Process() let pipe = Pipe() cmd.standardOutput = pipe cmd.standardError = pipe cmd.executableURL = URL(fileURLWithPath: cmdPath, isDirectory: false, relativeTo: nil) cmd.arguments = [read, domain, key] //cmd.arguments = [/, /Library] print(Shell command: (cmdPath) (cmd.arguments?.joined(separator: ) ?? )) var d : Data? do { try cmd.run() d = pipe.fileHandleForReading.readDataToEndOfFile() cmd.waitUntilExit() } catch let e as NSError { return ERROR (e.code): (e.localizedDescription) } catch { return ERROR: call failed! } // get pipe output and write is to stdout guard let
5
0
209
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
4
0
244
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
249
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
0
0
248
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
400
Mar ’26
Charts performance issue
Hi, I want to recreate a chart from Apple Health and I have code like this. When I scroll - especially the week and month charts, there are performance issues. If I remove .chartScrollPosition(x: $scrollChartPosition), it runs smoothly, but I need to know which part of the chart is currently displayed. Can you help me? import Charts import SwiftUI struct MacroChartView: View { var selectedRange: ChartRange var binnedPoints: [MacroBinPoint] @State private var scrollChartPosition: Date = .now var body: some View { VStack { Text((selectedRange.rangeLabel(for: scrollChartPosition))) Chart(binnedPoints) { point in BarMark( x: .value(Date, point.date, unit: selectedRange.binComponent), y: .value(Calories, point.calories) ) } .frame(height: 324) .chartXVisibleDomain(length: selectedRange.visibleDomainLength()) .chartScrollableAxes(.horizontal) .chartScrollPosition(x: $scrollChartPosition) .chartScrollTargetBehavior(.valueAligned(matching: selectedRange.scrollAlignmentComponents)) .chartXAxis { switch select
Replies
2
Boosts
0
Views
557
Activity
Mar ’26
Reply to 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
Thank you for the feedback. Let me clarify: My app is a SwiftUI iOS fitness app called GymFusion. It uses Anthropic's Claude AI API to power features like meal photo scanning, body composition analysis, and workout coaching. The rejection is solely about Guidelines 5.1.1(i) and 5.1.2(i) — the app shares user data with a third-party AI service (Anthropic) and Apple says the app doesn't clearly disclose this or ask for permission. There are no in-app purchase issues — apologies for any confusion. Here's what I've implemented: The app's entry point (RootView) shows the AI consent screen as the first view on every launch. It's not a sheet or popup — it's embedded in the view hierarchy: if auth.isLoading { // Loading screen } else if !consentManager.hasConsented && !consentManager.hasSeenConsent { AIConsentView() // Consent blocks the entire app } else if auth.isAuthenticated { MainTabView() } else { AuthView() } The consent screen: Lists all data shared (photos, workout history, body measurements
Replies
Boosts
Views
Activity
Mar ’26
Scrolling to row with a pinned header view
Hi, I have a list with section headers as pinned views. I'm trying to programmatically scroll to a view inside a section using a proxy.scrollTo(id, anchor: .top). I was expecting the view to be aligned to the top of the scroll view but after the pinned header. Instead, it's aligned to the top of the scroll view overlapping with the header, hiding most of the row. Here is a code snippet to reproduce: import SwiftUI struct ContentView: View { var body: some View { ScrollViewReader { proxy in ScrollView { LazyVStack( pinnedViews: .sectionHeaders ){ ForEach(1...10, id: .self) { count1 in Section(content: { Text(First row) .id((count1), row1) Text(second row) Text(third row) }, header: { Text(Section (count1)).font(.title) .background(.red) }) } } } .safeAreaInset(edge: .bottom) { Button(Tap me) { proxy.scrollTo(3, row1, anchor: .top) } .padding() } } } } Any idea how this could be solved?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
55
Activity
Mar ’26
UIView + CATiledLayer + SwiftUI Hosting + iOS 26 = Crash?
Our app uses a UIView backed by a CATiledLayer that is embedded in a UIScrollView, to represent a large document viewer. (PDF data, actually.) It needs to be big - far too big to allocate a single layer, and it needs to be able to reveal more detail as you zoom in. This is the exact use case for a CATiledLayer. CATiledLayer does its drawing on a background thread, as you know, and we've always taken care to make our draw method thread-safe. It has worked great for us, for over a decade now. However, starting with iOS 26, we've been having some surprising crashes. It looks like our CATiledLayer (I think?) is trying to trigger a layout on the background thread as well. This is frustrating because it doesn't have any subviews or sublayers - there's no reason for it. I'm suspecting the CATiledLayer because it does its drawing on a thread, so maybe it would also do other things there, but honestly, I'm not sure - it's hard to tell. Here's the crash. Normally with a crash like this, the solution is to bounce your l
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
0
Views
245
Activity
Mar ’26
swift: Calling "/usr/bin/defaults" returns no data
I'd like to create a small helper app for new students do read/write User default settings. Since it was not possible using the UserDefaults class I decided to use the /usr/bin/defaults. Unfortuntely it seems not to return anything. Debug output shows Got data: 0 bytes Here is a sample code: import SwiftUI func readDefaults(domain : String, key :String) -> String { let cmdPath = /usr/bin/defaults //let cmdPath = /bin/ls let cmd = Process() let pipe = Pipe() cmd.standardOutput = pipe cmd.standardError = pipe cmd.executableURL = URL(fileURLWithPath: cmdPath, isDirectory: false, relativeTo: nil) cmd.arguments = [read, domain, key] //cmd.arguments = [/, /Library] print(Shell command: (cmdPath) (cmd.arguments?.joined(separator: ) ?? )) var d : Data? do { try cmd.run() d = pipe.fileHandleForReading.readDataToEndOfFile() cmd.waitUntilExit() } catch let e as NSError { return ERROR (e.code): (e.localizedDescription) } catch { return ERROR: call failed! } // get pipe output and write is to stdout guard let
Replies
5
Boosts
0
Views
209
Activity
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
244
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
249
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
0
Boosts
0
Views
248
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
400
Activity
Mar ’26