Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Created

Crash in PDFView / PDFPageAnalyzerV2
Hello. Some users of my app experience crashes that mention PDFKit. I managed to find out what specific PDF file caused the crash and created a sample that demonstrates the issue and created a bug report in Feedback Assistant (FB22409977). Unfortunately I didn't get any answer for over a month, hence I'm writing it here so others can see that this is a known issue. The crash repro sample is very simple, it's just a PDFView that opens a bundled PDF file upon application lanunch. To cause the crash it is only needed to zoom-in and move around the page that has a table. The crash happens when the system tries to do some sort of OCR. The original crash report came from iPhone 11 user running iOS 26.3.1. Recently another user with iPhone 16 Pro Max running 26.5 experienced the same crash. Thread 12 Queue : PDFKWit.PDFDocument.formFillingQueue (serial) #0 0x000000018d320bd8 in PageLayout::GetBoundsForRangeWithinLine () #1 0x000000018d320c88 in PageLayout::GetBoundsForTextRange () #2 0x000000018d393028 in CGPDFTaggedNodeCreateCopyWithStringRange () #3 0x000000018d316630 in invocation function for block in TaggedParser::InsertLinkAnnotationsIntoStructureTree(CGPDFTaggedNode*, CGPDFPage*, PageLayout&) () #4 0x000000018d104f00 in CGPDFPageEnumerateAnnotations () #5 0x000000018d106968 in CGPDFPageCopyRootTaggedNode () #6 0x000000018d106710 in CGPDFPageInsertTableDescriptions () #7 0x00000001957a65b8 in +[PDFPageAnalyzerV2 addTablesFromVisionDocument:documentImage:toPage:withBox:] () #8 0x00000001957a3030 in +[PDFPageAnalyzerV2 analyzePage:withBox:requestTypes:] () #9 0x000000019584c018 in __31-[PDFView visiblePagesChanged:]_block_invoke () When CG_PDF_VERBOSE env variable is set, "New text range needs to be within the original node's text range." warning is printed to console several times before the crash happens.
1
0
123
1w
Why doesn't .glassEffect tint render on a Menu in an iOS 26 toolbar?
This is what I am trying to achieve (from the Phone app, similar one is also in Photos) I have a standard SwiftUI Menu in a toolbar with a glass tint applied to indicate the filter is active: Menu { // …filter options } label: { Label("Filter", systemImage: "line.3.horizontal.decrease") } .glassEffect(.regular.tint(.accentColor).interactive()) The glass effect doesn't render at all, no tint. The button looks completely unstyled. If I switch the label from Label to Image, the glass renders, but as a stretched oblong pill. I have tried several other combinations too: Also in the Apple's version during hover (iPad) the highlight aligns with the tint itself (see second image above) rather than outside it like in example 3 from the list above: Is there a way to get a Menu's trigger inset tint to look as in the Phone app example?
0
0
55
1w
"any View cannot conform to View"
Hello, What is the solution to this problem, assuming that you are not supposed to use AnyView, which I hear over and over again? Given this protocol: protocol MyProtocol { associatedtype V: View var content: () -> V { get } } if I want to store a heterogenous collection of MyProtocol, let collection: [any MyProtocol], then the underlying V type of each is erased to any View, which (supposedly) does not conform to View. Is there no way to "unbox" the existential any View to get the underlying View back? That unboxing idea is something I heard in a few WWDC videos but it seems like it does not apply to View.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
48
1w
SwiftData in-memory ModelContainer causes DefaultStore validation errors on consecutive xcodebuild test runs
When running parallel Swift Testing tests that each create their own in-memory ModelContainer, the first xcodebuild test run succeeds but all subsequent runs fail with DefaultStore save failed validation errors — unless DerivedData is deleted between runs. Setup Each test suite creates an isolated in-memory container with a unique name: ModelConfiguration(UUID().uuidString, schema: schema, isStoredInMemoryOnly: true) The @Model class has non-optional properties (e.g. var v: String, var entityDicMoveNr: Int) that are always set in init. Symptoms on second run SwiftData.DefaultStore save failed with error: Error Domain=NSCocoaErrorDomain Code=1560 "Multiple validation errors occurred." NSValidationErrorKey=v, NSValidationErrorValue=null NSValidationErrorKey=entityDicMoveNr, NSValidationErrorValue=null NSValidationErrorKey=historyBackup, NSValidationErrorValue=null The errors appear before test code executes — during SwiftData's internal DefaultStore auto-save. Properties that are always initialized in Swift show as nil in the Core Data layer. What we verified Each run uses a fresh xctest process (different PIDs) Container creation succeeds (no errors in our ModelContainer init) The @Model init always sets all fields — confirmed with debug prints Deleting DerivedData before each run fixes it (but forces a full rebuild) What didn't help Using ModelContext(container) instead of container.mainContext Setting autosaveEnabled = false on both mainContext and custom contexts Using /dev/null URL instead of isStoredInMemoryOnly: true build-for-testing + test-without-building Clearing only Logs/Test or TestResults subdirectories Why not run via swift test? We can't fall back to swift test because our project uses RealityKit custom components, which silently fail to decode in CLI swift test. So xcodebuild test is our only option, making the DerivedData workaround especially costly. Workaround Delete DerivedData before each xcodebuild test invocation. Environment macOS 15.5, Xcode 16.4, Swift Testing with @Suite @MainActor parallel test suites. Question Is there a way to fully isolate in-memory ModelContainer instances so that no metadata leaks between xcodebuild test runs without requiring a full DerivedData clean?
4
0
167
1w
iOS 26.0+: Liquid Glass views don't respect named colors
Hello, I'm a bit new to iOS development, so this could be something I've overlooked, but I've tried a bunch of things on my own and with the help of Copilot, as well as some senior engineers here at my company. I let AI summarize what the problem is, what I've tried, what doesn't work, and also some information on the system: Problem: UITabBarAppearance Custom Colors Ignored - All Diagnostics Show Correct Configuration Environment: iOS Deployment Target: 13.4 Xcode: Latest (26.4.1 as of writing) Device/Simulator: Both affected Language: Swift UI: UIKit with Storyboards Description: Tab bar selected item displays system default colors (gray in light mode, white in dark mode) instead of my custom named color from asset catalog. System colors like .systemBlue work correctly, but custom asset catalog colors are completely ignored. Expected behavior: Selected tab bar item should display BlueTVColor2 (RGB 0, 0.173, 0.38 in light mode; RGB 0, 0.569, 1.0 in dark mode) Actual behaviour: Selected tab bar item displays gray/white/black system defaults What I've Verified Works Correctly: Color resolution: let color = UIColor(named: "BlueTVColor2") print(color) // Resolves correctly print(color?.resolvedColor(with: .init(userInterfaceStyle: .light))) // RGB(0, 0.173, 0.38) print(color?.resolvedColor(with: .init(userInterfaceStyle: .dark))) // RGB(0, 0.569, 1.0) Asset Catalog Configuration: BlueTVColor2.colorset has both light and dark variants template-rendering-intent: template set on all tab bar images All images use .alwaysTemplate rendering mode (verified at runtime) UITabBarAppearance Configuration (Although I've also tried just directly in the storyboard, it didn't work, the below is in code-behind): override func viewDidLoad() { super.viewDidLoad() let selectedColor = UIColor(named: "BlueTVColor2")!.resolvedColor(with: traitCollection) let normalColor = UIColor.redTVColor.resolvedColor(with: traitCollection) let appearance = UITabBarAppearance() appearance.configureWithOpaqueBackground() let itemAppearance = UITabBarItemAppearance() itemAppearance.selected.iconColor = selectedColor itemAppearance.selected.titleTextAttributes = [.foregroundColor: selectedColor] itemAppearance.normal.iconColor = normalColor appearance.stackedLayoutAppearance = itemAppearance appearance.inlineLayoutAppearance = itemAppearance appearance.compactInlineLayoutAppearance = itemAppearance tabBar.isTranslucent = false tabBar.standardAppearance = appearance if #available(iOS 15.0, *) { tabBar.scrollEdgeAppearance = appearance } tabBar.tintColor = selectedColor tabBar.unselectedItemTintColor = normalColor } Runtime Diagnostics Confirm Everything is Set Correctly: Appearance selected iconColor: RGB(0, 0.569, 1) // Correct Tab bar standardAppearance selected iconColor: RGB(0, 0.569, 1) // Correct Tab bar tintColor: RGB(0, 0.569, 1) // Correct Tab bar unselectedItemTintColor: RGB(1, 0.259, 0.271) // Correct All tab bar item images: Rendering mode = 2 (.alwaysTemplate) // Correct Settings persist through viewDidAppear // Correct Yet the UI displays system default gray/white/black colors. What I've Tried (All Failed): Deprecated selectedImageTintColor property (returns nil when standardAppearance is set) Both configureWithDefaultBackground() and configureWithOpaqueBackground() Dynamic colors vs resolved fixed colors Configuring all layout appearances (stacked, inline, compactInline) Setting isTranslucent = false Re-applying appearance in viewDidAppear with delayed dispatch Manually re-applying template rendering mode to images at runtime Removing storyboard color configuration entirely Changing global accent color build setting System colors (.systemBlue) work fine; only custom asset catalog colors fail Additional Context: This is a legacy project originally created around 2013-2015, migrated to modern Swift/iOS (not everywhere, major parts are still using objc, UIKit/Storyboard) When I set tabBar.tintColor = .systemBlue it works perfectly The color BlueTVColor2 is used successfully elsewhere in the app (also if setting it as the background of the UITabBar, it works, just not as a tint for the icons/text) Storyboard has no selectedImageTintColor set (removed during debugging) No UITabBar.appearance() proxy calls anywhere in codebase Deployment target is iOS 13.4 (when UITabBarAppearance was introduced) Pre iOS 26.0, the adding of the tint color to the UITabBar worked as intended, so this has come as a result of the update to iOS 26.0 in some way Comparison with Working Test Project: Created a fresh iOS project with same setup - custom asset catalog colors work perfectly in tab bar with identical UITabBarAppearance configuration. Question: Why would UITabBarAppearance properties show correct colors in diagnostics but render with system defaults? Is there a known issue with asset catalog named colors in UITabBarAppearance on iOS 13.4+? Could legacy project settings interfere with modern appearance API? Any insights would be greatly appreciated. I'm running out of ideas and this seems like either a framework bug or some undocumented interaction between asset catalogs and tab bar appearance. Code Sample: I can't release much code besides just things I've worked on, so hopefully this full description of the problem and everything I've tried can help illuminate the issue at hand. I've tried all of the above and probably more the past week and can't make heads or tails of where the issue is located. The best I can come up with right now is some sort of compatibility issues but I have no way of determining where it is that I should investigate and fix.
1
0
111
1w
My macOS app is getting closed by the system
Hi, I've been trying to resolve an issue that my users are facing for about one year, but I haven't been able to so far. That's why I'm turning to you all for some ideas. Some of my users have noticed that my app suddenly exits. It runs in the background as a menu bar app, so when they go to use it, they realize it's no longer running. I've checked Crashlytics and asked users to check their Console app for crash reports, but there are none. The conclusion so far is that it's not a crash, but a silent termination. I haven't experienced this on my own machine, which makes it incredibly difficult to debug or identify the cause. Recently, I thought I'd pinned down the problem. My app was declaring: <key>NSSupportsSuddenTermination</key> <true/> Based on the documentation, this is intended to quickly terminate the app during logout or system shutdown, but I read it can also be triggered when the system needs resources. It seemed like the perfect root cause. However, even after turning it off, one of my users is still experiencing the problem. I'm officially running out of ideas. Does anyone have suggestions on what else I should check? My app currently declares: <key>LSUIElement</key> <true/> <key>NSSupportsAutomaticTermination</key> <false/> <key>NSSupportsSuddenTermination</key> <false/>
1
0
162
1w
SwiftUI NavigationSplitView sidebar toolbar has excessive top inset when embedded in TabView since iPadOS 26.4
I’m seeing a layout regression in SwiftUI on iPadOS 26.4 involving NavigationSplitView inside a TabView. When a NavigationSplitView is embedded in a TabView, the sidebar toolbar appears to reserve too much vertical space. There is a large vertical gap between the top edge of the sidebar and the sidebar collapse/toggle icon. It looks as if the sidebar toolbar itself has become much taller than expected. The same NavigationSplitView layout is rendered correctly when it is shown directly without being embedded in a TabView. Environment: iPadOS 26.4 or later SwiftUI iPad TabView NavigationSplitView inside one tab Expected behavior The sidebar toolbar should use its normal height, as it does when the same NavigationSplitView is shown without a surrounding TabView. The sidebar collapse/toggle icon should appear close to the top of the sidebar, without a large empty gap above it. Actual behavior When the NavigationSplitView is hosted inside a TabView, the sidebar toolbar area becomes excessively tall. A large empty space appears above the sidebar collapse/toggle icon. This only happens in the TabView setup. Rendering the same NavigationSplitView directly does not show the issue. Feedback I also filed this as Feedback Assistant report: FB22645938 Has anyone else seen this behavior since iPadOS 26.4? Is this an intentional layout change, or is there a supported way to avoid this additional top inset when using NavigationSplitView inside TabView? Reproduction import SwiftUI struct ContentView: View { enum AppTab { case first case second } @State private var selectedTab: AppTab = .first var body: some View { TabView(selection: $selectedTab) { Tab("First", systemImage: "sidebar.leading", value: .first) { NavigationSplitView { List { Section("Sidebar Content") { ForEach(1...20, id: \.self) { index in Text("Item \(index)") } } } .navigationTitle("Sidebar") .toolbar { ToolbarItem(placement: .topBarLeading) { Button { // action } label: { Image(systemName: "plus") } } } } detail: { Text("Detail") } } Tab("Second", systemImage: "doc", value: .second) { Text("Second tab") } } } }
0
0
138
1w
HSplitView resize cursor missing when split view is conditionally rendered (FB22712819)
Hey all, Ran into a fun one on macOS 26.4.1 / Xcode 26.4.1, and I think I've narrowed it down enough to be worth sharing. Symptom: HSplitView's divider drags fine, but the cursor never changes to the resize cursor on hover. Just stays as the regular arrow. The cause (in my case): the HSplitView was conditionally rendered via an outer if let: struct PlayerDetailsView: View { let theme: Theme var playerVM = PlayerViewModel.shared var body: some View { let grayscaleCM = ColorMap(table: .grayscale) ZStack { VStack(spacing: 0) { Rectangle() .fill(LinearGradient(colors: [Color.black.opacity(0.45), Color.black.opacity(0)], startPoint: .top, endPoint: .bottom)) .frame(height: 8) Spacer() Rectangle() .fill(LinearGradient(colors: [Color.black.opacity(0.45), Color.black.opacity(0)], startPoint: .bottom, endPoint: .top)) .frame(height: 8) } .allowsHitTesting(false) if let disc = playerVM.disc { HSplitView { DiscInfoView( disc: disc, theme: theme, ) .frame(minWidth: 720, alignment: .topLeading) .buttonShadow() .focusable(false) TrackListView( theme: theme, playbackSequence: playerVM.tracksInPlaybackSequence, bonusTrackStartIndex: playerVM.player.disc?.releaseMetadata?.firstBonusTrackIndex, bonusTracksTitle: playerVM.player.disc?.releaseMetadata?.bonusTracksTitle, bonusTracksDisabled: playerVM.bonusTracksDisabled, onBonusIconTap: { playerVM.player.bonusTracksDisabled.toggle() } ) .frame(minWidth: 512) .focusable(false) } } } .background( LinearGradient( colors: [ grayscaleCM.color(for: 0.23), grayscaleCM.color(for: 0.17), ], startPoint: .top, endPoint: .bottom ) ) } } The fix: move the conditional inside the HSplitView, so the split view itself is always present in the hierarchy (swap line 21 and 22 of code above): HSplitView { if let disc = playerVM.disc { DiscInfoView( disc: disc, theme: theme, ) .frame(minWidth: 720, alignment: .topLeading) .buttonShadow() .focusable(false) TrackListView( theme: theme, playbackSequence: playerVM.tracksInPlaybackSequence, bonusTrackStartIndex: playerVM.player.disc?.releaseMetadata?.firstBonusTrackIndex, bonusTracksTitle: playerVM.player.disc?.releaseMetadata?.bonusTracksTitle, bonusTracksDisabled: playerVM.bonusTracksDisabled, onBonusIconTap: { playerVM.player.bonusTracksDisabled.toggle() } ) .frame(minWidth: 512) .focusable(false) } } I asked Claude AI about it and its guess is that conditionally inserting the HSplitView causes its underlying NSSplitView to get torn down and rebuilt on view updates, and the tracking areas responsible for the resize cursor never get a chance to settle. But that would be great to have a confirmation from someone at Apple who knows what's happening under the hood. Is this a known issue or an Expected behavior? Filed as FB22712819 in case anyone wants to duplicate. I posted this in case anyone had the same very specific issue... Cheers!
Topic: UI Frameworks SubTopic: SwiftUI
0
0
113
1w
NSCollectionView's 'selection box' freezes if you right-click during dragging
So in NSCollectionView I left click the background and start dragging to make the 'selection box' (is that what we call it?) I have a mouse with separate left and right click buttons (i.e., not an Apple Magic Mouse). Now if I accidentally hit the right click while I'm still dragging the selection box..... the right click context menu shows up in the middle of mouse dragging and the selection box freezes on screen. Besides the visual disruption this sometimes results in weird behavior. Sometimes mouse clicks stop responding for awhile in the window and I gotta click around a bunch of times until I guess the run loop "unclogs." I'm able to reproduce in Finder Icon view so it isn't just me. Steps to Reproduce: A mouse with separate buttons for left and right click. Open Finder window in icon view. Left click the background and start dragging to make the gray selection box. While dragging the mouse as you are selecting click right-click in the middle of the drag. The selection box freezes on screen. Expected Behavior: -Right click event and left mouse drag event normally shouldn't overlap. If left mouse is being dragged the right click event should be blocked. Let me know if this is Feedback worthy.
5
0
76
1w
How can I intercept Shift+Tab in SwiftUI on macOS?
Hi everyone, I'm building a macOS SwiftUI app and I'm trying to intercept both: Tab Shift + Tab to perform custom actions (similar to how text editors indent/outdent items). Right now, plain Tab works fine, but Shift + Tab never reaches my .onKeyPress(.tab) handler. Here's what I'm currently trying: import SwiftUI struct ShiftTabNotIntercepted: View { @State private var shiftKeyPressed = false var body: some View { Text("Hello") .focusable() .onKeyPress(.tab) { print("tab pressed with shift: \(shiftKeyPressed)") return .handled } .onModifierKeysChanged(mask: .shift) { old, new in shiftKeyPressed = new.contains(.shift) } } } Behavior: Pressing Tab prints: tab pressed with shift: false Pressing Shift + Tab does nothing — .onKeyPress(.tab) never fires. I also noticed: if a sidebar is visible, Shift + Tab moves focus to the sidebar if no sidebar is visible, it still doesn't trigger the handler So it seems macOS is intercepting Shift + Tab for focus navigation before SwiftUI sees it. My goal is to fully own this keyboard behavior for a custom outline/tree editor UI. Questions: Is there a SwiftUI-native way to intercept Shift + Tab? Is .onKeyPress fundamentally unable to capture this combination? Do I need to drop down to AppKit (NSViewRepresentable, keyDown, etc.) to reliably handle it? Thanks!
1
0
119
1w
How to handle all the core AppleEvents
Glancing through the APIs, SwiftUI can handle the open app, reopen app, open doc, and quit core events (with the “aevt” suite ID). What about the print doc and open content events? If there are no hooks (yet), how can I implement them the traditional way without clashing with SwiftUI?
1
0
91
1w
Digital Wallet Verification Options
Good Morning all! I was wondering what the customization is in regard to Digital Wallet Verification. Currently we have Verify with Phone Call as the default option selected, then Verify within App as the second option. Is there a way or any documentation that can be looked at to see how we can have Verify within App be the defaulted option?
0
0
55
1w
iOS 18.6.2 issue with "let"
I am facing an issue in SwiftUI on iOS 18.6.2 where passing a value to a destination view during navigation is not working as expected. In my implementation, I pass a billerId as a constant (let) to the destination view (BillersItemView) using NavigationLink. This approach works correctly across all previous iOS versions. However, on iOS 18.6.2, the destination view does not receive the updated value properly. Before triggering navigation, the value is correctly updated in the ViewModel, but the destination view seems to receive an incorrect or stale value, which affects further API calls and UI rendering. This pattern of passing immutable (let) values is used throughout the app and has always worked reliably, so this behavior appears inconsistent and possibly related to changes in SwiftUI navigation handling in iOS 18.6.2. Could you please confirm if this is a known issue or if there are any recommended changes or workarounds to ensure correct data passing in this scenario? It can be very likely a SwiftUI navigation state timing issue that became more visible in iOS 18.x, especially with NavigationLink(isActive:) + external @ObservedObject updates. But i need to know why this is working in others. I have attached the relevant code for your reference. import SwiftUI struct CategoryBillersView: View { @ObservedObject var billPaymentsVM: BillPaymentsViewModel @State private var goToBillerItem = false var body: some View { NavigationView { VStack { NavigationLink(isActive: $goToBillerItem) { BillersItemView( billPaymentsVM: billPaymentsVM, billerId: billPaymentsVM.selectedBillerId ) } label: { EmptyView() } Button("Go to Biller") { billPaymentsVM.selectedBillerId = 123 goToBillerItem = true } } } } } struct BillersItemView: View { @ObservedObject var billPaymentsVM: BillPaymentsViewModel let billerId: Int var body: some View { Text("Biller ID: \(billerId)") .onAppear { billPaymentsVM.fetchBiller(billerId: billerId) } } } class BillPaymentsViewModel: ObservableObject { @Published var selectedBillerId: Int = 0 }
Topic: UI Frameworks SubTopic: SwiftUI
0
0
56
1w
Right Way of Positioning an Always Visible Overlay on Top of Navigation Bar That Aligns With Other Navigation Items
Starting with Liquid Glass, the navigation items seem not to be vertically centered within the navigation bar. This makes it very challenging to position an overlay on top of the navigation bar so that it aligns naturally with other elements such as the back button, dismiss button, and others. We want to achieve this for a progress bar so that it remains visible regardless of which views are pushed underneath. Therefore, we cannot add it as a navigation item on each screen, as doing so would cause the progress bar to animate repeatedly as new screens are pushed onto the stack. This used to be easier pre liquid glass since navigation items were centered vertically within the navigation bar. The approach I tried to center the progress bar in the navigation bar: Get access to the top safe area insets through GeometryReader Get access to the the status bar height through UIWindowScene's statusBarManager Subtract status bar height from top safe area inset to calculate the navigation bar height Update the padding of the progress bar accordingly to make sure it is centered within the navigation bar This works, but as I mentioned, now the navigation items are not centered, and the amount of vertical offset they have seems to differ from one screen to another, making it impossible to come up with an additional padding value to align across devices. See how the navigation item looks like within the navigation bar in the view debugger (doesn't matter if it is UINavigationController or NavigationStack the behaviour is the same, also please note that the positioning is the same for a view without an explicit leading toolbar item, where the default back button is provided by the system when a view is pushed): Existing code (without any hacky solutions) to add a progress bar on top as overlay: struct ContentView: View { @State var shouldShowOverlay = false var body: some View { NavigationStack { NavigationLink("Go to View2") { View2() } .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .topBarLeading) { Button { } label: { Image(systemName: "chevron.left") } } } } .overlay(alignment: .top) { ProgressView(value: 0.5) .frame(width: 200) // what to add as padding here // .padding(.top, 16.0) } } How it looks: Some additional observations for the navigation bar item here: There seems to be 4 _UINavigationBarPlatterAnimationViews in the view stack, prior to the bar button item:
 The first two seems to be fine, they both have (0, 0, 44, 44) for both frame and bounds
 The third one’s frame has height and width of 48.2, and x, y values of -2.1. The last one’s frame has 40,17 for height and width and 1.92 for x,y values. Both views have the following bounds: (0, 0, 44, 44). I also tried to access to the origin of the back bar button item so that I could calculate where the position the overlay, but that also didn't yield to something useful, not to mention it would also be a super hacky solution. So my ultimate question is, is there a clean way to position an overlay on top of the navigation bar that vertically aligns with other navigation bar items, or should we just position it elsewhere and do not mess with navigation bar anymore? Any input would be greatly appreciated.
0
1
156
1w
CarPlay voice-based-conversational app crashes when CarPlay scene activates before phone scene (React Native + Expo)
Hi all, I'm building a CarPlay app for the voice-based-conversational category (entitlement approved March 2026), and I've hit a crash I can't resolve through public documentation. Hoping someone here has seen this. Setup App: React Native via Expo SDK 54 (RN 0.81) CarPlay library: react-native-carplay@2.4.1-beta.0 iOS: 26.4.2 Entitlement: com.apple.developer.carplay-voice-based-conversation Architecture: ExpoAppDelegate subclass with two scene delegates declared in UIApplicationSceneManifest: PhoneSceneDelegate (UIWindowSceneDelegate) CarSceneDelegate (CPTemplateApplicationSceneDelegate) What works iPhone app launched first, CarPlay connects after: no crash. Placeholder CPListTemplate titled "Enough" displays. templateApplicationScene(_:didConnect:) is called. However the React Native side never receives the didConnect event from RNCarPlay — the placeholder is the only thing that ever shows. JS never gets a chance to call setRootTemplate(VoiceControlTemplate). What fails When CarPlay is the first scene to activate (iPhone app not running, user opens the app icon directly on the head unit), the app crashes immediately: Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x0000000190932800 Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Triggered by Thread: 0 Thread 0 Crashed: 0 libswiftCore.dylib _assertionFailure(...) AssertCommon.swift:171 1-5 Enough (our Swift code, in CarSceneDelegate path) 6 libdispatch.dylib _dispatch_call_block_and_release Thread 11 (in parallel): hermes evaluatePreparedJavaScript React ReactInstance::loadScript React RCTJSThreadManager runRunLoop So React Native is bootstrapping on Thread 11 (Hermes loading the bundle), but Thread 0 fires a Swift assertion in our code path immediately after factory.startReactNative(...). What we've tried ~16 builds with iterative hypotheses. Two key ones: Passing UIWindow(frame: UIScreen.main.bounds) to factory.startReactNative(in:): crashes because iOS 13+ requires every UIWindow to belong to a UIWindowScene, and we were creating one without scene association. Passing nil to factory.startReactNative(in:): the header RCTReactNativeFactory.h declares inWindow:(UIWindow *_Nullable)window, so nil should be valid. But the crash signature is identical — Swift assertion failure inside ExpoReactNativeFactory or RCTReactNativeFactory. Looks like an internal precondition that requires window != nil despite the header. Other hypotheses ruled out: linker stripping of scene delegate classes (verified with nm), wrong protocol method signature (we use didConnect: for voice-based-conversational, not didConnect:to: which is for navigation apps), AppDelegate vs SceneDelegate bootstrap conflict. One hypothesis we haven't tested: bootstrapping React Native fully in application:didFinishLaunchingWithOptions: before any scene activates, exposing the bridge via singleton. This is the pattern documented in RN issue #41777 and the Adapptor blog (2022). We haven't tried because ExpoReactNativeFactory is more opaque than the older RCTAppDelegate and we're unsure which internal initialization steps are safe to extract. Specific questions Is RCTReactNativeFactory.startReactNative(withModuleName:in:launchOptions:) actually supported with nil window? The _Nullable annotation suggests yes, but runtime says no. Is the annotation aspirational or am I missing a setup step? For React Native apps using voice-based-conversational, is there a recommended pattern to handle CarPlay-first launch? All public documentation I've found is either for legacy CPApplicationDelegate or for navigation apps with MapTemplate. Can VoiceControlTemplate be presented from native Swift without involving the JS bridge for the initial template? This would let us avoid the bridge bootstrap problem on the CarPlay scene path. Any insights, war stories, or pointers to documentation I might have missed would be hugely appreciated. Multi-week investigation here and I'd love to find the right pattern or confirm an upstream issue worth filing as feedback. Thanks!
1
0
147
1w
`safeAreaInsets` but for system bars?
Is there a safeAreaInsets equivalent that only tracks system bars (tab bars, status bars, side bars, toolbars, and navigation bars) and is not affected by notches? I'm asking this because the iPadOS tab bar can appear either on the top, bottom, or left (modally or non-modally) in various configurations, including sidebarAdaptable and when the window size is small on iPadOS; the tab bar's frame is not really reliable in this case, and while the safe area insets works, it also includes the notches / rounded window corners...
0
0
190
1w
MacCatalyst, UIScene and the green zoom/fullscreen button
Please show me where I’ve gone amiss in MacCatalyst and UIScenes with regard to the macOS green zoom/fullscreen button. Originally the MacCatalyst App used a secondary AppKit bundle for its NSWindow work, but at some point in time AppStore Connect complained about this secondary bundle which prevented new App uploads. To continue receiving green button notifications I switched to UINSWindow. That worked. Now that I’m forced to use UIScenes I’m in a pickle: a click on the green button forces an automatic jump to fullscreen, nothing I can do about it AFAIK. A poor, poor compromise would be to disable the green button but I have no idea how even to do that. I’d like my App to exist in two states, any suggestions? Thanks.
1
0
131
1w
How to achieve this vibrant background effect on iOS?
Hi everyone, I'm trying to reproduce an effect that Apple has created for the Contacts app on iOS, iPadOS and MacOS v26.4 where the contact card is displayed with a nice material frosted background that blends well with the underlying background. I love this effect and I want to use it in my app to display different information. As you can see in the screenshot, the list rows have a frosted background (probably thinMaterial) combined with a vibrant effect that adapts to the underlying view background. Additionally, the fields labels and icons also have a nice effect. I've tried everything but I'm unable to accurately recreate this effect. I tried applying a Rectangle with a material background listRowBackground but this resulted in something different than what Apple is using (either too light, too dark, or simply not vibrant). I've even tried SwiftUIVisualEffects swift package which can apply a vibrancy effect. However the result is still not the same as the one you see in the screenshot, with the correct contrast between background and labels. Any guidance would be appreciated. Thank you 🙏🏻
4
0
373
2w
Crash in PDFView / PDFPageAnalyzerV2
Hello. Some users of my app experience crashes that mention PDFKit. I managed to find out what specific PDF file caused the crash and created a sample that demonstrates the issue and created a bug report in Feedback Assistant (FB22409977). Unfortunately I didn't get any answer for over a month, hence I'm writing it here so others can see that this is a known issue. The crash repro sample is very simple, it's just a PDFView that opens a bundled PDF file upon application lanunch. To cause the crash it is only needed to zoom-in and move around the page that has a table. The crash happens when the system tries to do some sort of OCR. The original crash report came from iPhone 11 user running iOS 26.3.1. Recently another user with iPhone 16 Pro Max running 26.5 experienced the same crash. Thread 12 Queue : PDFKWit.PDFDocument.formFillingQueue (serial) #0 0x000000018d320bd8 in PageLayout::GetBoundsForRangeWithinLine () #1 0x000000018d320c88 in PageLayout::GetBoundsForTextRange () #2 0x000000018d393028 in CGPDFTaggedNodeCreateCopyWithStringRange () #3 0x000000018d316630 in invocation function for block in TaggedParser::InsertLinkAnnotationsIntoStructureTree(CGPDFTaggedNode*, CGPDFPage*, PageLayout&) () #4 0x000000018d104f00 in CGPDFPageEnumerateAnnotations () #5 0x000000018d106968 in CGPDFPageCopyRootTaggedNode () #6 0x000000018d106710 in CGPDFPageInsertTableDescriptions () #7 0x00000001957a65b8 in +[PDFPageAnalyzerV2 addTablesFromVisionDocument:documentImage:toPage:withBox:] () #8 0x00000001957a3030 in +[PDFPageAnalyzerV2 analyzePage:withBox:requestTypes:] () #9 0x000000019584c018 in __31-[PDFView visiblePagesChanged:]_block_invoke () When CG_PDF_VERBOSE env variable is set, "New text range needs to be within the original node's text range." warning is printed to console several times before the crash happens.
Replies
1
Boosts
0
Views
123
Activity
1w
Why doesn't .glassEffect tint render on a Menu in an iOS 26 toolbar?
This is what I am trying to achieve (from the Phone app, similar one is also in Photos) I have a standard SwiftUI Menu in a toolbar with a glass tint applied to indicate the filter is active: Menu { // …filter options } label: { Label("Filter", systemImage: "line.3.horizontal.decrease") } .glassEffect(.regular.tint(.accentColor).interactive()) The glass effect doesn't render at all, no tint. The button looks completely unstyled. If I switch the label from Label to Image, the glass renders, but as a stretched oblong pill. I have tried several other combinations too: Also in the Apple's version during hover (iPad) the highlight aligns with the tint itself (see second image above) rather than outside it like in example 3 from the list above: Is there a way to get a Menu's trigger inset tint to look as in the Phone app example?
Replies
0
Boosts
0
Views
55
Activity
1w
"any View cannot conform to View"
Hello, What is the solution to this problem, assuming that you are not supposed to use AnyView, which I hear over and over again? Given this protocol: protocol MyProtocol { associatedtype V: View var content: () -> V { get } } if I want to store a heterogenous collection of MyProtocol, let collection: [any MyProtocol], then the underlying V type of each is erased to any View, which (supposedly) does not conform to View. Is there no way to "unbox" the existential any View to get the underlying View back? That unboxing idea is something I heard in a few WWDC videos but it seems like it does not apply to View.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
48
Activity
1w
SwiftData in-memory ModelContainer causes DefaultStore validation errors on consecutive xcodebuild test runs
When running parallel Swift Testing tests that each create their own in-memory ModelContainer, the first xcodebuild test run succeeds but all subsequent runs fail with DefaultStore save failed validation errors — unless DerivedData is deleted between runs. Setup Each test suite creates an isolated in-memory container with a unique name: ModelConfiguration(UUID().uuidString, schema: schema, isStoredInMemoryOnly: true) The @Model class has non-optional properties (e.g. var v: String, var entityDicMoveNr: Int) that are always set in init. Symptoms on second run SwiftData.DefaultStore save failed with error: Error Domain=NSCocoaErrorDomain Code=1560 "Multiple validation errors occurred." NSValidationErrorKey=v, NSValidationErrorValue=null NSValidationErrorKey=entityDicMoveNr, NSValidationErrorValue=null NSValidationErrorKey=historyBackup, NSValidationErrorValue=null The errors appear before test code executes — during SwiftData's internal DefaultStore auto-save. Properties that are always initialized in Swift show as nil in the Core Data layer. What we verified Each run uses a fresh xctest process (different PIDs) Container creation succeeds (no errors in our ModelContainer init) The @Model init always sets all fields — confirmed with debug prints Deleting DerivedData before each run fixes it (but forces a full rebuild) What didn't help Using ModelContext(container) instead of container.mainContext Setting autosaveEnabled = false on both mainContext and custom contexts Using /dev/null URL instead of isStoredInMemoryOnly: true build-for-testing + test-without-building Clearing only Logs/Test or TestResults subdirectories Why not run via swift test? We can't fall back to swift test because our project uses RealityKit custom components, which silently fail to decode in CLI swift test. So xcodebuild test is our only option, making the DerivedData workaround especially costly. Workaround Delete DerivedData before each xcodebuild test invocation. Environment macOS 15.5, Xcode 16.4, Swift Testing with @Suite @MainActor parallel test suites. Question Is there a way to fully isolate in-memory ModelContainer instances so that no metadata leaks between xcodebuild test runs without requiring a full DerivedData clean?
Replies
4
Boosts
0
Views
167
Activity
1w
iOS 26.0+: Liquid Glass views don't respect named colors
Hello, I'm a bit new to iOS development, so this could be something I've overlooked, but I've tried a bunch of things on my own and with the help of Copilot, as well as some senior engineers here at my company. I let AI summarize what the problem is, what I've tried, what doesn't work, and also some information on the system: Problem: UITabBarAppearance Custom Colors Ignored - All Diagnostics Show Correct Configuration Environment: iOS Deployment Target: 13.4 Xcode: Latest (26.4.1 as of writing) Device/Simulator: Both affected Language: Swift UI: UIKit with Storyboards Description: Tab bar selected item displays system default colors (gray in light mode, white in dark mode) instead of my custom named color from asset catalog. System colors like .systemBlue work correctly, but custom asset catalog colors are completely ignored. Expected behavior: Selected tab bar item should display BlueTVColor2 (RGB 0, 0.173, 0.38 in light mode; RGB 0, 0.569, 1.0 in dark mode) Actual behaviour: Selected tab bar item displays gray/white/black system defaults What I've Verified Works Correctly: Color resolution: let color = UIColor(named: "BlueTVColor2") print(color) // Resolves correctly print(color?.resolvedColor(with: .init(userInterfaceStyle: .light))) // RGB(0, 0.173, 0.38) print(color?.resolvedColor(with: .init(userInterfaceStyle: .dark))) // RGB(0, 0.569, 1.0) Asset Catalog Configuration: BlueTVColor2.colorset has both light and dark variants template-rendering-intent: template set on all tab bar images All images use .alwaysTemplate rendering mode (verified at runtime) UITabBarAppearance Configuration (Although I've also tried just directly in the storyboard, it didn't work, the below is in code-behind): override func viewDidLoad() { super.viewDidLoad() let selectedColor = UIColor(named: "BlueTVColor2")!.resolvedColor(with: traitCollection) let normalColor = UIColor.redTVColor.resolvedColor(with: traitCollection) let appearance = UITabBarAppearance() appearance.configureWithOpaqueBackground() let itemAppearance = UITabBarItemAppearance() itemAppearance.selected.iconColor = selectedColor itemAppearance.selected.titleTextAttributes = [.foregroundColor: selectedColor] itemAppearance.normal.iconColor = normalColor appearance.stackedLayoutAppearance = itemAppearance appearance.inlineLayoutAppearance = itemAppearance appearance.compactInlineLayoutAppearance = itemAppearance tabBar.isTranslucent = false tabBar.standardAppearance = appearance if #available(iOS 15.0, *) { tabBar.scrollEdgeAppearance = appearance } tabBar.tintColor = selectedColor tabBar.unselectedItemTintColor = normalColor } Runtime Diagnostics Confirm Everything is Set Correctly: Appearance selected iconColor: RGB(0, 0.569, 1) // Correct Tab bar standardAppearance selected iconColor: RGB(0, 0.569, 1) // Correct Tab bar tintColor: RGB(0, 0.569, 1) // Correct Tab bar unselectedItemTintColor: RGB(1, 0.259, 0.271) // Correct All tab bar item images: Rendering mode = 2 (.alwaysTemplate) // Correct Settings persist through viewDidAppear // Correct Yet the UI displays system default gray/white/black colors. What I've Tried (All Failed): Deprecated selectedImageTintColor property (returns nil when standardAppearance is set) Both configureWithDefaultBackground() and configureWithOpaqueBackground() Dynamic colors vs resolved fixed colors Configuring all layout appearances (stacked, inline, compactInline) Setting isTranslucent = false Re-applying appearance in viewDidAppear with delayed dispatch Manually re-applying template rendering mode to images at runtime Removing storyboard color configuration entirely Changing global accent color build setting System colors (.systemBlue) work fine; only custom asset catalog colors fail Additional Context: This is a legacy project originally created around 2013-2015, migrated to modern Swift/iOS (not everywhere, major parts are still using objc, UIKit/Storyboard) When I set tabBar.tintColor = .systemBlue it works perfectly The color BlueTVColor2 is used successfully elsewhere in the app (also if setting it as the background of the UITabBar, it works, just not as a tint for the icons/text) Storyboard has no selectedImageTintColor set (removed during debugging) No UITabBar.appearance() proxy calls anywhere in codebase Deployment target is iOS 13.4 (when UITabBarAppearance was introduced) Pre iOS 26.0, the adding of the tint color to the UITabBar worked as intended, so this has come as a result of the update to iOS 26.0 in some way Comparison with Working Test Project: Created a fresh iOS project with same setup - custom asset catalog colors work perfectly in tab bar with identical UITabBarAppearance configuration. Question: Why would UITabBarAppearance properties show correct colors in diagnostics but render with system defaults? Is there a known issue with asset catalog named colors in UITabBarAppearance on iOS 13.4+? Could legacy project settings interfere with modern appearance API? Any insights would be greatly appreciated. I'm running out of ideas and this seems like either a framework bug or some undocumented interaction between asset catalogs and tab bar appearance. Code Sample: I can't release much code besides just things I've worked on, so hopefully this full description of the problem and everything I've tried can help illuminate the issue at hand. I've tried all of the above and probably more the past week and can't make heads or tails of where the issue is located. The best I can come up with right now is some sort of compatibility issues but I have no way of determining where it is that I should investigate and fix.
Replies
1
Boosts
0
Views
111
Activity
1w
My macOS app is getting closed by the system
Hi, I've been trying to resolve an issue that my users are facing for about one year, but I haven't been able to so far. That's why I'm turning to you all for some ideas. Some of my users have noticed that my app suddenly exits. It runs in the background as a menu bar app, so when they go to use it, they realize it's no longer running. I've checked Crashlytics and asked users to check their Console app for crash reports, but there are none. The conclusion so far is that it's not a crash, but a silent termination. I haven't experienced this on my own machine, which makes it incredibly difficult to debug or identify the cause. Recently, I thought I'd pinned down the problem. My app was declaring: <key>NSSupportsSuddenTermination</key> <true/> Based on the documentation, this is intended to quickly terminate the app during logout or system shutdown, but I read it can also be triggered when the system needs resources. It seemed like the perfect root cause. However, even after turning it off, one of my users is still experiencing the problem. I'm officially running out of ideas. Does anyone have suggestions on what else I should check? My app currently declares: <key>LSUIElement</key> <true/> <key>NSSupportsAutomaticTermination</key> <false/> <key>NSSupportsSuddenTermination</key> <false/>
Replies
1
Boosts
0
Views
162
Activity
1w
SwiftUI NavigationSplitView sidebar toolbar has excessive top inset when embedded in TabView since iPadOS 26.4
I’m seeing a layout regression in SwiftUI on iPadOS 26.4 involving NavigationSplitView inside a TabView. When a NavigationSplitView is embedded in a TabView, the sidebar toolbar appears to reserve too much vertical space. There is a large vertical gap between the top edge of the sidebar and the sidebar collapse/toggle icon. It looks as if the sidebar toolbar itself has become much taller than expected. The same NavigationSplitView layout is rendered correctly when it is shown directly without being embedded in a TabView. Environment: iPadOS 26.4 or later SwiftUI iPad TabView NavigationSplitView inside one tab Expected behavior The sidebar toolbar should use its normal height, as it does when the same NavigationSplitView is shown without a surrounding TabView. The sidebar collapse/toggle icon should appear close to the top of the sidebar, without a large empty gap above it. Actual behavior When the NavigationSplitView is hosted inside a TabView, the sidebar toolbar area becomes excessively tall. A large empty space appears above the sidebar collapse/toggle icon. This only happens in the TabView setup. Rendering the same NavigationSplitView directly does not show the issue. Feedback I also filed this as Feedback Assistant report: FB22645938 Has anyone else seen this behavior since iPadOS 26.4? Is this an intentional layout change, or is there a supported way to avoid this additional top inset when using NavigationSplitView inside TabView? Reproduction import SwiftUI struct ContentView: View { enum AppTab { case first case second } @State private var selectedTab: AppTab = .first var body: some View { TabView(selection: $selectedTab) { Tab("First", systemImage: "sidebar.leading", value: .first) { NavigationSplitView { List { Section("Sidebar Content") { ForEach(1...20, id: \.self) { index in Text("Item \(index)") } } } .navigationTitle("Sidebar") .toolbar { ToolbarItem(placement: .topBarLeading) { Button { // action } label: { Image(systemName: "plus") } } } } detail: { Text("Detail") } } Tab("Second", systemImage: "doc", value: .second) { Text("Second tab") } } } }
Replies
0
Boosts
0
Views
138
Activity
1w
HSplitView resize cursor missing when split view is conditionally rendered (FB22712819)
Hey all, Ran into a fun one on macOS 26.4.1 / Xcode 26.4.1, and I think I've narrowed it down enough to be worth sharing. Symptom: HSplitView's divider drags fine, but the cursor never changes to the resize cursor on hover. Just stays as the regular arrow. The cause (in my case): the HSplitView was conditionally rendered via an outer if let: struct PlayerDetailsView: View { let theme: Theme var playerVM = PlayerViewModel.shared var body: some View { let grayscaleCM = ColorMap(table: .grayscale) ZStack { VStack(spacing: 0) { Rectangle() .fill(LinearGradient(colors: [Color.black.opacity(0.45), Color.black.opacity(0)], startPoint: .top, endPoint: .bottom)) .frame(height: 8) Spacer() Rectangle() .fill(LinearGradient(colors: [Color.black.opacity(0.45), Color.black.opacity(0)], startPoint: .bottom, endPoint: .top)) .frame(height: 8) } .allowsHitTesting(false) if let disc = playerVM.disc { HSplitView { DiscInfoView( disc: disc, theme: theme, ) .frame(minWidth: 720, alignment: .topLeading) .buttonShadow() .focusable(false) TrackListView( theme: theme, playbackSequence: playerVM.tracksInPlaybackSequence, bonusTrackStartIndex: playerVM.player.disc?.releaseMetadata?.firstBonusTrackIndex, bonusTracksTitle: playerVM.player.disc?.releaseMetadata?.bonusTracksTitle, bonusTracksDisabled: playerVM.bonusTracksDisabled, onBonusIconTap: { playerVM.player.bonusTracksDisabled.toggle() } ) .frame(minWidth: 512) .focusable(false) } } } .background( LinearGradient( colors: [ grayscaleCM.color(for: 0.23), grayscaleCM.color(for: 0.17), ], startPoint: .top, endPoint: .bottom ) ) } } The fix: move the conditional inside the HSplitView, so the split view itself is always present in the hierarchy (swap line 21 and 22 of code above): HSplitView { if let disc = playerVM.disc { DiscInfoView( disc: disc, theme: theme, ) .frame(minWidth: 720, alignment: .topLeading) .buttonShadow() .focusable(false) TrackListView( theme: theme, playbackSequence: playerVM.tracksInPlaybackSequence, bonusTrackStartIndex: playerVM.player.disc?.releaseMetadata?.firstBonusTrackIndex, bonusTracksTitle: playerVM.player.disc?.releaseMetadata?.bonusTracksTitle, bonusTracksDisabled: playerVM.bonusTracksDisabled, onBonusIconTap: { playerVM.player.bonusTracksDisabled.toggle() } ) .frame(minWidth: 512) .focusable(false) } } I asked Claude AI about it and its guess is that conditionally inserting the HSplitView causes its underlying NSSplitView to get torn down and rebuilt on view updates, and the tracking areas responsible for the resize cursor never get a chance to settle. But that would be great to have a confirmation from someone at Apple who knows what's happening under the hood. Is this a known issue or an Expected behavior? Filed as FB22712819 in case anyone wants to duplicate. I posted this in case anyone had the same very specific issue... Cheers!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
113
Activity
1w
NSCollectionView's 'selection box' freezes if you right-click during dragging
So in NSCollectionView I left click the background and start dragging to make the 'selection box' (is that what we call it?) I have a mouse with separate left and right click buttons (i.e., not an Apple Magic Mouse). Now if I accidentally hit the right click while I'm still dragging the selection box..... the right click context menu shows up in the middle of mouse dragging and the selection box freezes on screen. Besides the visual disruption this sometimes results in weird behavior. Sometimes mouse clicks stop responding for awhile in the window and I gotta click around a bunch of times until I guess the run loop "unclogs." I'm able to reproduce in Finder Icon view so it isn't just me. Steps to Reproduce: A mouse with separate buttons for left and right click. Open Finder window in icon view. Left click the background and start dragging to make the gray selection box. While dragging the mouse as you are selecting click right-click in the middle of the drag. The selection box freezes on screen. Expected Behavior: -Right click event and left mouse drag event normally shouldn't overlap. If left mouse is being dragged the right click event should be blocked. Let me know if this is Feedback worthy.
Replies
5
Boosts
0
Views
76
Activity
1w
How can I intercept Shift+Tab in SwiftUI on macOS?
Hi everyone, I'm building a macOS SwiftUI app and I'm trying to intercept both: Tab Shift + Tab to perform custom actions (similar to how text editors indent/outdent items). Right now, plain Tab works fine, but Shift + Tab never reaches my .onKeyPress(.tab) handler. Here's what I'm currently trying: import SwiftUI struct ShiftTabNotIntercepted: View { @State private var shiftKeyPressed = false var body: some View { Text("Hello") .focusable() .onKeyPress(.tab) { print("tab pressed with shift: \(shiftKeyPressed)") return .handled } .onModifierKeysChanged(mask: .shift) { old, new in shiftKeyPressed = new.contains(.shift) } } } Behavior: Pressing Tab prints: tab pressed with shift: false Pressing Shift + Tab does nothing — .onKeyPress(.tab) never fires. I also noticed: if a sidebar is visible, Shift + Tab moves focus to the sidebar if no sidebar is visible, it still doesn't trigger the handler So it seems macOS is intercepting Shift + Tab for focus navigation before SwiftUI sees it. My goal is to fully own this keyboard behavior for a custom outline/tree editor UI. Questions: Is there a SwiftUI-native way to intercept Shift + Tab? Is .onKeyPress fundamentally unable to capture this combination? Do I need to drop down to AppKit (NSViewRepresentable, keyDown, etc.) to reliably handle it? Thanks!
Replies
1
Boosts
0
Views
119
Activity
1w
Prominent glass button in SwiftUI incorrect text style
How do you create a prominent glass button in SwiftUI? In UIKit it’s let button = UIButton(configuration: .prominentGlass()) button.configuration?.title = "Agree" I tried Button("Agree") {} .buttonStyle(.glassProminent) but the title text is white not glassified 🤨
Replies
0
Boosts
0
Views
66
Activity
1w
How to handle all the core AppleEvents
Glancing through the APIs, SwiftUI can handle the open app, reopen app, open doc, and quit core events (with the “aevt” suite ID). What about the print doc and open content events? If there are no hooks (yet), how can I implement them the traditional way without clashing with SwiftUI?
Replies
1
Boosts
0
Views
91
Activity
1w
Digital Wallet Verification Options
Good Morning all! I was wondering what the customization is in regard to Digital Wallet Verification. Currently we have Verify with Phone Call as the default option selected, then Verify within App as the second option. Is there a way or any documentation that can be looked at to see how we can have Verify within App be the defaulted option?
Replies
0
Boosts
0
Views
55
Activity
1w
iOS 18.6.2 issue with "let"
I am facing an issue in SwiftUI on iOS 18.6.2 where passing a value to a destination view during navigation is not working as expected. In my implementation, I pass a billerId as a constant (let) to the destination view (BillersItemView) using NavigationLink. This approach works correctly across all previous iOS versions. However, on iOS 18.6.2, the destination view does not receive the updated value properly. Before triggering navigation, the value is correctly updated in the ViewModel, but the destination view seems to receive an incorrect or stale value, which affects further API calls and UI rendering. This pattern of passing immutable (let) values is used throughout the app and has always worked reliably, so this behavior appears inconsistent and possibly related to changes in SwiftUI navigation handling in iOS 18.6.2. Could you please confirm if this is a known issue or if there are any recommended changes or workarounds to ensure correct data passing in this scenario? It can be very likely a SwiftUI navigation state timing issue that became more visible in iOS 18.x, especially with NavigationLink(isActive:) + external @ObservedObject updates. But i need to know why this is working in others. I have attached the relevant code for your reference. import SwiftUI struct CategoryBillersView: View { @ObservedObject var billPaymentsVM: BillPaymentsViewModel @State private var goToBillerItem = false var body: some View { NavigationView { VStack { NavigationLink(isActive: $goToBillerItem) { BillersItemView( billPaymentsVM: billPaymentsVM, billerId: billPaymentsVM.selectedBillerId ) } label: { EmptyView() } Button("Go to Biller") { billPaymentsVM.selectedBillerId = 123 goToBillerItem = true } } } } } struct BillersItemView: View { @ObservedObject var billPaymentsVM: BillPaymentsViewModel let billerId: Int var body: some View { Text("Biller ID: \(billerId)") .onAppear { billPaymentsVM.fetchBiller(billerId: billerId) } } } class BillPaymentsViewModel: ObservableObject { @Published var selectedBillerId: Int = 0 }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
56
Activity
1w
Remove MacOS Tahoe Sidebar + Inspector Chrome
Is it possible to remove the ugly sidebar and inspector chrome with AppKit? I don't care if it's a hack or a swizzle or something, but I need to get rid of this. I want to convert this: Into this (photoshopped): Thanks for your help!
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
0
Boosts
1
Views
168
Activity
1w
Right Way of Positioning an Always Visible Overlay on Top of Navigation Bar That Aligns With Other Navigation Items
Starting with Liquid Glass, the navigation items seem not to be vertically centered within the navigation bar. This makes it very challenging to position an overlay on top of the navigation bar so that it aligns naturally with other elements such as the back button, dismiss button, and others. We want to achieve this for a progress bar so that it remains visible regardless of which views are pushed underneath. Therefore, we cannot add it as a navigation item on each screen, as doing so would cause the progress bar to animate repeatedly as new screens are pushed onto the stack. This used to be easier pre liquid glass since navigation items were centered vertically within the navigation bar. The approach I tried to center the progress bar in the navigation bar: Get access to the top safe area insets through GeometryReader Get access to the the status bar height through UIWindowScene's statusBarManager Subtract status bar height from top safe area inset to calculate the navigation bar height Update the padding of the progress bar accordingly to make sure it is centered within the navigation bar This works, but as I mentioned, now the navigation items are not centered, and the amount of vertical offset they have seems to differ from one screen to another, making it impossible to come up with an additional padding value to align across devices. See how the navigation item looks like within the navigation bar in the view debugger (doesn't matter if it is UINavigationController or NavigationStack the behaviour is the same, also please note that the positioning is the same for a view without an explicit leading toolbar item, where the default back button is provided by the system when a view is pushed): Existing code (without any hacky solutions) to add a progress bar on top as overlay: struct ContentView: View { @State var shouldShowOverlay = false var body: some View { NavigationStack { NavigationLink("Go to View2") { View2() } .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .topBarLeading) { Button { } label: { Image(systemName: "chevron.left") } } } } .overlay(alignment: .top) { ProgressView(value: 0.5) .frame(width: 200) // what to add as padding here // .padding(.top, 16.0) } } How it looks: Some additional observations for the navigation bar item here: There seems to be 4 _UINavigationBarPlatterAnimationViews in the view stack, prior to the bar button item:
 The first two seems to be fine, they both have (0, 0, 44, 44) for both frame and bounds
 The third one’s frame has height and width of 48.2, and x, y values of -2.1. The last one’s frame has 40,17 for height and width and 1.92 for x,y values. Both views have the following bounds: (0, 0, 44, 44). I also tried to access to the origin of the back bar button item so that I could calculate where the position the overlay, but that also didn't yield to something useful, not to mention it would also be a super hacky solution. So my ultimate question is, is there a clean way to position an overlay on top of the navigation bar that vertically aligns with other navigation bar items, or should we just position it elsewhere and do not mess with navigation bar anymore? Any input would be greatly appreciated.
Replies
0
Boosts
1
Views
156
Activity
1w
CarPlay voice-based-conversational app crashes when CarPlay scene activates before phone scene (React Native + Expo)
Hi all, I'm building a CarPlay app for the voice-based-conversational category (entitlement approved March 2026), and I've hit a crash I can't resolve through public documentation. Hoping someone here has seen this. Setup App: React Native via Expo SDK 54 (RN 0.81) CarPlay library: react-native-carplay@2.4.1-beta.0 iOS: 26.4.2 Entitlement: com.apple.developer.carplay-voice-based-conversation Architecture: ExpoAppDelegate subclass with two scene delegates declared in UIApplicationSceneManifest: PhoneSceneDelegate (UIWindowSceneDelegate) CarSceneDelegate (CPTemplateApplicationSceneDelegate) What works iPhone app launched first, CarPlay connects after: no crash. Placeholder CPListTemplate titled "Enough" displays. templateApplicationScene(_:didConnect:) is called. However the React Native side never receives the didConnect event from RNCarPlay — the placeholder is the only thing that ever shows. JS never gets a chance to call setRootTemplate(VoiceControlTemplate). What fails When CarPlay is the first scene to activate (iPhone app not running, user opens the app icon directly on the head unit), the app crashes immediately: Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x0000000190932800 Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Triggered by Thread: 0 Thread 0 Crashed: 0 libswiftCore.dylib _assertionFailure(...) AssertCommon.swift:171 1-5 Enough (our Swift code, in CarSceneDelegate path) 6 libdispatch.dylib _dispatch_call_block_and_release Thread 11 (in parallel): hermes evaluatePreparedJavaScript React ReactInstance::loadScript React RCTJSThreadManager runRunLoop So React Native is bootstrapping on Thread 11 (Hermes loading the bundle), but Thread 0 fires a Swift assertion in our code path immediately after factory.startReactNative(...). What we've tried ~16 builds with iterative hypotheses. Two key ones: Passing UIWindow(frame: UIScreen.main.bounds) to factory.startReactNative(in:): crashes because iOS 13+ requires every UIWindow to belong to a UIWindowScene, and we were creating one without scene association. Passing nil to factory.startReactNative(in:): the header RCTReactNativeFactory.h declares inWindow:(UIWindow *_Nullable)window, so nil should be valid. But the crash signature is identical — Swift assertion failure inside ExpoReactNativeFactory or RCTReactNativeFactory. Looks like an internal precondition that requires window != nil despite the header. Other hypotheses ruled out: linker stripping of scene delegate classes (verified with nm), wrong protocol method signature (we use didConnect: for voice-based-conversational, not didConnect:to: which is for navigation apps), AppDelegate vs SceneDelegate bootstrap conflict. One hypothesis we haven't tested: bootstrapping React Native fully in application:didFinishLaunchingWithOptions: before any scene activates, exposing the bridge via singleton. This is the pattern documented in RN issue #41777 and the Adapptor blog (2022). We haven't tried because ExpoReactNativeFactory is more opaque than the older RCTAppDelegate and we're unsure which internal initialization steps are safe to extract. Specific questions Is RCTReactNativeFactory.startReactNative(withModuleName:in:launchOptions:) actually supported with nil window? The _Nullable annotation suggests yes, but runtime says no. Is the annotation aspirational or am I missing a setup step? For React Native apps using voice-based-conversational, is there a recommended pattern to handle CarPlay-first launch? All public documentation I've found is either for legacy CPApplicationDelegate or for navigation apps with MapTemplate. Can VoiceControlTemplate be presented from native Swift without involving the JS bridge for the initial template? This would let us avoid the bridge bootstrap problem on the CarPlay scene path. Any insights, war stories, or pointers to documentation I might have missed would be hugely appreciated. Multi-week investigation here and I'd love to find the right pattern or confirm an upstream issue worth filing as feedback. Thanks!
Replies
1
Boosts
0
Views
147
Activity
1w
`safeAreaInsets` but for system bars?
Is there a safeAreaInsets equivalent that only tracks system bars (tab bars, status bars, side bars, toolbars, and navigation bars) and is not affected by notches? I'm asking this because the iPadOS tab bar can appear either on the top, bottom, or left (modally or non-modally) in various configurations, including sidebarAdaptable and when the window size is small on iPadOS; the tab bar's frame is not really reliable in this case, and while the safe area insets works, it also includes the notches / rounded window corners...
Replies
0
Boosts
0
Views
190
Activity
1w
MacCatalyst, UIScene and the green zoom/fullscreen button
Please show me where I’ve gone amiss in MacCatalyst and UIScenes with regard to the macOS green zoom/fullscreen button. Originally the MacCatalyst App used a secondary AppKit bundle for its NSWindow work, but at some point in time AppStore Connect complained about this secondary bundle which prevented new App uploads. To continue receiving green button notifications I switched to UINSWindow. That worked. Now that I’m forced to use UIScenes I’m in a pickle: a click on the green button forces an automatic jump to fullscreen, nothing I can do about it AFAIK. A poor, poor compromise would be to disable the green button but I have no idea how even to do that. I’d like my App to exist in two states, any suggestions? Thanks.
Replies
1
Boosts
0
Views
131
Activity
1w
How to achieve this vibrant background effect on iOS?
Hi everyone, I'm trying to reproduce an effect that Apple has created for the Contacts app on iOS, iPadOS and MacOS v26.4 where the contact card is displayed with a nice material frosted background that blends well with the underlying background. I love this effect and I want to use it in my app to display different information. As you can see in the screenshot, the list rows have a frosted background (probably thinMaterial) combined with a vibrant effect that adapts to the underlying view background. Additionally, the fields labels and icons also have a nice effect. I've tried everything but I'm unable to accurately recreate this effect. I tried applying a Rectangle with a material background listRowBackground but this resulted in something different than what Apple is using (either too light, too dark, or simply not vibrant). I've even tried SwiftUIVisualEffects swift package which can apply a vibrancy effect. However the result is still not the same as the one you see in the screenshot, with the correct contrast between background and labels. Any guidance would be appreciated. Thank you 🙏🏻
Replies
4
Boosts
0
Views
373
Activity
2w