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

Activity

A Summary of the WWDC25 Group Lab - UI Frameworks
At WWDC25 we launched a new type of Lab event for the developer community - Group Labs. A Group Lab is a panel Q&A designed for a large audience of developers. Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the WWDC25 Group Lab for UI Frameworks. How would you recommend developers start adopting the new design? Start by focusing on the foundational structural elements of your application, working from the "top down" or "bottom up" based on your application's hierarchy. These structural changes, like edge-to-edge content and updated navigation and controls, often require corresponding code modifications. As a first step, recompile your application with the new SDK to see what updates are automatically applied, especially if you've been using standard controls. Then, carefully analyze where the new design elements can be applied to your UI, paying particular attention to custom controls or UI that could benefit from a refresh. Address the large structural items first then focus on smaller details is recommended. Will we need to migrate our UI code to Swift and SwiftUI to adopt the new design? No, you will not need to migrate your UI code to Swift and SwiftUI to adopt the new design. The UI frameworks fully support the new design, allowing you to migrate your app with as little effort as possible, especially if you've been using standard controls. The goal is to make it easy to adopt the new design, regardless of your current UI framework, to achieve a cohesive look across the operating system. What was the reason for choosing Liquid Glass over frosted glass, as used in visionOS? The choice of Liquid Glass was driven by the desire to bring content to life. The see-through nature of Liquid Glass enhances this effect. The appearance of Liquid Glass adapts based on its size; larger glass elements look more frosted, which aligns with the design of visionOS, where everything feels larger and benefits from the frosted look. What are best practices for apps that use customized navigation bars? The new design emphasizes behavior and transitions as much as static appearance. Consider whether you truly need a custom navigation bar, or if the system-provided controls can meet your needs. Explore new APIs for subtitles and custom views in navigation bars, designed to support common use cases. If you still require a custom solution, ensure you're respecting safe areas using APIs like SwiftUI's safeAreaInset. When working with Liquid Glass, group related buttons in shared containers to maintain design consistency. Finally, mark glass containers as interactive. For branding, instead of coloring the navigation bar directly, consider incorporating branding colors into the content area behind the Liquid Glass controls. This creates a dynamic effect where the color is visible through the glass and moves with the content as the user scrolls. I want to know why new UI Framework APIs aren’t backward compatible, specifically in SwiftUI? It leads to code with lots of if-else statements. Existing APIs have been updated to work with the new design where possible, ensuring that apps using those APIs will adopt the new design and function on both older and newer operating systems. However, new APIs often depend on deep integration across the framework and graphics stack, making backward compatibility impractical. When using these new APIs, it's important to consider how they fit within the context of the latest OS. The use of if-else statements allows you to maintain compatibility with older systems while taking full advantage of the new APIs and design features on newer systems. If you are using new APIs, it likely means you are implementing something very specific to the new design language. Using conditional code allows you to intentionally create different code paths for the new design versus older operating systems. Prefer to use if #available where appropriate to intentionally adopt new design elements. Are there any Liquid Glass materials in iOS or macOS that are only available as part of dedicated components? Or are all those materials available through new UIKit and AppKit views? Yes, some variations of the Liquid Glass material are exclusively available through dedicated components like sliders, segmented controls, and tab bars. However, the "regular" and "clear" glass materials should satisfy most application requirements. If you encounter situations where these options are insufficient, please file feedback. If I were to create an app today, how should I design it to make it future proof using Liquid Glass? The best approach to future-proof your app is to utilize standard system controls and design your UI to align with the standard system look and feel. Using the framework-provided declarative API generally leads to easier adoption of future design changes, as you're expressing intent rather than specifying pixel-perfect visuals. Pay close attention to the design sessions offered this year, which cover the design motivation behind the Liquid Glass material and best practices for its use. Is it possible to implement your own sidebar on macOS without NSSplitViewController, but still provide the Liquid Glass appearance? While technically possible to create a custom sidebar that approximates the Liquid Glass appearance without using NSSplitViewController, it is not recommended. The system implementation of the sidebar involves significant unseen complexity, including interlayering with scroll edge effects and fullscreen behaviors. NSSplitViewController provides the necessary level of abstraction for the framework to handle these details correctly. Regarding the SceneDelagate and scene based life-cycle, I would like to confirm that AppDelegate is not going away. Also if the above is a correct understanding, is there any advice as to what should, and should not, be moved to the SceneDelegate? UIApplicationDelegate is not going away and still serves a purpose for application-level interactions with the system and managing scenes at a higher level. Move code related to your app's scene or UI into the UISceneDelegate. Remember that adopting scenes doesn't necessarily mean supporting multiple scenes; an app can be scene-based but still support only one scene. Refer to the tech note Migrating to the UIKit scene-based life cycle and the Make your UIKit app more flexible WWDC25 session for more information.
Topic: UI Frameworks SubTopic: General
0
0
688
Jun ’25
iOS 26 + UINavigationBar crash in layoutSubViews - new observation tracking
My #1 crash report since iOS 26 is the following: 1 libobjc.A.dylib objc_exception_throw 2 Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 3 UIKitCore -[UINavigationBar layoutSubviews] 4 UIKitCore UIView._layoutSubviewsWithObservationTracking() 5 UIKitCore @objc UIView._layoutSubviewsWithObservationTracking() Thread 0 9 libobjc.A.dylib objc_exception_throw 10 Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 11 UIKitCore -[UINavigationBar layoutSubviews] 12 UIKitCore UIView._layoutSubviewsWithObservationTracking() 13 UIKitCore @objc UIView._layoutSubviewsWithObservationTracking() I tried many things, without success so far. It seemed related to the new view update with observation tracking: link to documentation Any lead on how I should investigate this? Many thanks in advance!!
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
8
3h
Setting `navigationItem.standardAppearance` overrides backButtonImage setting
Hello everybody. I need your help with configuring navigationItem properly. I want to use its appearance properties to configure how the navigation bar looks on per-screen basis without interacting with UINavigationBar directly (the API has been implemented for this specific use case, right?) What I'm confused about is that setting any appearance property resets back button image to the default chevron. What I do now: Inside my app delegate let navigationBarAppearance = UINavigationBar.appearance() navigationBarAppearance.backIndicatorImage = UIImage() navigationBarAppearance.backIndicatorTransitionMaskImage = UIImage() I do this to hide the default chevron to customize back button appearance on per-view-controller basis Then in my presenting view controller: override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "Root" navigationItem.backBarButtonItem = UIBarButtonItem( title: nil, image: nil, primaryAction: UIAction( title: "", image: UIImage(systemName: "square.and.arrow.up"), identifier: nil, discoverabilityTitle: nil, attributes: [], state: .on, handler: { [weak self] _ in self?.navigationController?.popViewController(animated: true) } ), menu: nil ) let appearance = UINavigationBarAppearance() appearance.configureWithTransparentBackground() appearance.backgroundColor = UIColor.red appearance.titleTextAttributes = [ .foregroundColor: UIColor.purple ] appearance.largeTitleTextAttributes = [ .foregroundColor: UIColor.purple ] navigationItem.standardAppearance = appearance navigationItem.compactAppearance = appearance navigationItem.scrollEdgeAppearance = appearance navigationItem.compactScrollEdgeAppearance = appearance } The colors are set up as expected, however the default chevron image appears on the next view controller next to square.and.arrow.up. If I don't touch navigation item appearance properties - only square.and.arrow.up is displayed, as I want, but obviously I loose all the customization. Can anyone please explain how to set things up properly? Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
11
4h
On macOS, how do you place a toolbar item on the trailing edge of the window's toolbar when an Inspector view is open?
Using SwiftUI on macOS, how can I add a toolbar item on the right-most (trailing) edge of the window's toolbar when an Inspector is used? At the moment, the toolbar items are all left-of (leading) the split view tracking separator. I want the inspector toolbar item to be placed similar to where Xcode's Inspector toolbar item is placed: always as far right (trailing) as possible. NavigationSplitView { // ... snip } detail: { // ... snip } .inspector(isPresented: $isInspectorPresented) { InspectorContentView() } .toolbar { // What is the correct placement value here? ToolbarItem(placement: .primaryAction) { Button { isInspectorPresented.toggle() } label: { Label("Toggle Inspector", systemImage: "sidebar.trailing") } } } See the attached screenshot. When the InspectorView is toggled open, the toolbar item tracks leading the split view tracking separator, which is not consistent with how Xcode works.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
5
0
136
6h
AppIntents default value
Hi, I have created an AppIntent in which there is a parameter called price, I have set the default value as 0. @Parameter(title: "Price", default: 0) var price: Int Problem When the shortcut is run this parameter is skipped Aim I still want to price to be asked however it needs to be pre-filled with 0 Question What should I do that the shortcut can still ask the price but be pre-filled with 0?
0
0
31
7h
AppIntents
Overview I have a custom type Statistics that has 3 properties inside it I am trying to return this as part of the AppIntent's perforrm method struct Statistics { var countA: Int var countB: Int var countC: Int } I would like to implement the AppIntent to return Statistics as follows: func perform() async throws -> some IntentResult & ReturnsValue<Statistics> { ... ... } Problem It doesn't make much sense to make Statistics as an AppEntity as this is only computed as a result. Statistics doesn't exist as a persisted entity in the app. Questions How can I implement Statistics? Does it have to be AppEntity (I am trying to avoid this)? (defaultQuery would never be used.) What is the correct way tackle this?
0
0
42
8h
Sheet background in share extension ignores Liquid Glass effect in iOS 26/Xcode 26
I’m developing a share extension for iOS 26 with Xcode 26. When the extension’s sheet appears, it always shows a full white background, even though iOS 26 introduces a new “Liquid Glass” effect for partial sheets. Expected: The sheet background should use the iOS 26 glassmorphism effect as seen in full apps. Actual behavior: Custom sheets in my app get the glass effect, but the native system sheet in the share extension always opens as plain white. Steps to reproduce: Create a share extension using UIKit Present any UIViewController as the main view Set modalPresentationStyle = .pageSheet (or leave as default) Observe solid white background, not glassmorphism Sample code: swift override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear preferredContentSize = CGSize(width: UIScreen.main.bounds.width, height: 300) } Troubleshooting attempted: Tried adding UIVisualEffectView with system blur/materials Removed all custom backgrounds Set modalPresentationStyle explicitly Questions: Is it possible to enable or force the Liquid Glass effect in share extensions on iOS 26? Is this a limitation by design or a potential bug? Any workaround to make extension sheet backgrounds match system glass appearance?
6
1
399
9h
Sheet background in share extension ignores Liquid Glass effect in iOS 26/Xcode 26
I’m developing a share extension for iOS 26 with Xcode 26. When the extension’s sheet appears, it always shows a full white background, even though iOS 26 introduces a new “Liquid Glass” effect for partial sheets. Expected: The sheet background should use the iOS 26 glassmorphism effect as seen in full apps. Actual behavior: Custom sheets in my app get the glass effect, but the native system sheet in the share extension always opens as plain white. Steps to reproduce: Create a share extension using UIKit Present any UIViewController as the main view Set modalPresentationStyle = .pageSheet (or leave as default) Observe solid white background, not glassmorphism Sample code: swift override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear preferredContentSize = CGSize(width: UIScreen.main.bounds.width, height: 300) } Troubleshooting attempted: Tried adding UIVisualEffectView with system blur/materials Removed all custom backgrounds Set modalPresentationStyle explicitly Questions: Is it possible to enable or force the Liquid Glass effect in share extensions on iOS 26? Is this a limitation by design or a potential bug? Any workaround to make extension sheet backgrounds match system glass appearance?
2
0
128
9h
iOS app crash at -[UIView _wrappedProcessTraitChanges:withBehavior:] + 1288 (UIView.m:0)
Hello Apple engineers, could you help me understand whether this crash is a UIKit bug or something in our code that causes it. Based on the documentation it is an invalid fetch instruction, that's why I suspect UIKit. I've found a similar crash here on the forums reported a year ago, it seemed to be a UIKit bug - https://forums.developer.apple.com/forums/thread/729448. I've attached the full crash report (the app name was replaced with ): Thread 0 Crashed: 0 libobjc.A.dylib 0x000000019daf7c20 objc_msgSend + 32 (:-1) 1 UIKitCore 0x00000001a3020c50 -[UIView _wrappedProcessTraitChanges:withBehavior:] + 1288 (UIView.m:0) 2 UIKitCore 0x00000001a3020720 -[UIView _processChangesFromOldTraits:toCurrentTraits:withBehavior:] + 196 (UIView.m:7840) 3 UIKitCore 0x00000001a3020618 -[UIView _updateTraitCollectionAndProcessChangesWithBehavior:previousCollection:] + 112 (UIView.m:7831) 4 UIKitCore 0x00000001a2fa90c0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 944 (UIView.m:19850) 5 QuartzCore 0x00000001a22dfc28 CA::Layer::layout_if_needed(CA::Transaction*) + 496 (CALayer.mm:10944) 6 QuartzCore 0x00000001a22df7b4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 (CALayer.mm:2638) 7 QuartzCore 0x00000001a2336914 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 472 (CAContextInternal.mm:2613) 8 QuartzCore 0x00000001a22b57c4 CA::Transaction::commit() + 648 (CATransactionInternal.mm:420) 9 QuartzCore 0x00000001a22f8a0c CA::Transaction::flush_as_runloop_observer(bool) + 88 (CATransactionInternal.mm:928) 10 UIKitCore 0x00000001a303f568 _UIApplicationFlushCATransaction + 52 (UIApplication.m:3326) 11 UIKitCore 0x00000001a303cb64 __setupUpdateSequence_block_invoke_2 + 332 (_UIUpdateScheduler.m:1652) 12 UIKitCore 0x00000001a303c9d8 _UIUpdateSequenceRun + 84 (_UIUpdateSequence.mm:136) 13 UIKitCore 0x00000001a303c628 schedulerStepScheduledMainSection + 172 (_UIUpdateScheduler.m:1171) 14 UIKitCore 0x00000001a303d59c runloopSourceCallback + 92 (_UIUpdateScheduler.m:1334) 15 CoreFoundation 0x00000001a080c328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1970) 16 CoreFoundation 0x00000001a080c2bc __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2014) 17 CoreFoundation 0x00000001a0809dc0 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2051) 18 CoreFoundation 0x00000001a0808fbc __CFRunLoopRun + 840 (CFRunLoop.c:2969) 19 CoreFoundation 0x00000001a0808830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434) 20 GraphicsServices 0x00000001ec7e81c4 GSEventRunModal + 164 (GSEvent.c:2196) 21 UIKitCore 0x00000001a336eeb0 -[UIApplication _run] + 816 (UIApplication.m:3844) 22 UIKitCore 0x00000001a341d5b4 UIApplicationMain + 340 (UIApplication.m:5496) 23 UIKitCore 0x00000001a3757fa8 UIApplicationMain(_:_:_:_:) + 104 (UIKit.swift:565) 24 <Redacted> 0x00000001028bde64 specialized static UIApplicationDelegate.main() + 28 (/<compiler-generated>:16) 25 <Redacted> 0x00000001028bde64 static AppDelegate.$main() + 28 (AppDelegate.swift:0) 26 <Redacted> 0x00000001028bde64 main + 116 27 dyld 0x00000001c61f6ec8 start + 2724 (dyldMain.cpp:1334) 2024-12-27_20-53-28.2129_-0500-353aaa194e6232c0d1fae767296bdb8c47c30498.crash
3
1
568
9h
SwiftUI navigationTransition(.zoom) glitches during interactive swipe-back
Hi everyone 👋 I’m fairly new to iOS development and I’ve been stuck on a SwiftUI issue for a while now, so I’m hoping someone here can spot what I’m doing wrong. I’m using navigationTransition(.zoom) together with matchedTransitionSource to animate navigation between views. The UI consists of a grid of items (currently a LazyVGrid, though the issue seems unrelated to laziness). Tapping an item zooms it into its detail view, which is structurally the same view type and can contain further items. All good expect that interactive swipe-back sometimes causes the item to disappear from the grid once the parent view is revealed. This only happens when dismissing via the drag gesture; it does not occur when using the back button. I’ve attached a short demo showing the issue and the Swift file containing the relevant view code. Is there something obvious I’m doing wrong with navigationTransition / matchedTransitionSource, or is this a known limitation or bug with interactive swipe-back? Thanks in advance. import SwiftUI struct TestFileView: View { @Namespace private var ns: Namespace.ID let nodeName: String let children: [String] let pathPrefix: String private func transitionID(for childName: String) -> String { "Zoom-\(pathPrefix)->\(childName)" } private let columns = Array(repeating: GridItem(.flexible(), spacing: 12), count: 3) var body: some View { ScrollView { VStack(alignment: .leading, spacing: 12) { Text(nodeName) .font(.title.bold()) .padding(.bottom, 6) LazyVGrid(columns: columns, spacing: 12) { ForEach(children, id: \.self) { childName in let id = transitionID(for: childName) NavigationLink { TestFileView( nodeName: childName, children: childrenFor(childName), pathPrefix: "\(pathPrefix)/\(childName)" ) .navigationTransition(.zoom(sourceID: id, in: ns)) } label: { TestFileCard(title: childName) .matchedTransitionSource(id: id, in: ns) } .buttonStyle(.plain) } } } .padding() } } private func childrenFor(_ name: String) -> [String] { switch name { case "Lorem": return ["Ipsum", "Dolor", "Sit"] case "Ipsum": return ["Amet", "Consectetur"] case "Dolor": return ["Adipiscing", "Elit", "Sed"] case "Sit": return ["Do", "Eiusmod"] case "Amet": return ["Tempor", "Incididunt", "Labore"] case "Adipiscing": return ["Magna", "Aliqua"] case "Elit": return ["Ut", "Enim", "Minim"] case "Tempor": return ["Veniam", "Quis"] case "Magna": return ["Nostrud", "Exercitation"] default: return [] } } } struct TestFileCard: View { let title: String var body: some View { VStack(alignment: .leading, spacing: 8) { Image(systemName: "square.stack.3d.up") .symbolRenderingMode(.hierarchical) .font(.headline) Text(title) .font(.subheadline.weight(.semibold)) .lineLimit(2) .minimumScaleFactor(0.85) Spacer(minLength: 0) } .padding(12) .frame(maxWidth: .infinity, minHeight: 90, alignment: .topLeading) .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 14, style: .continuous)) } } private struct TestRoot: View { var body: some View { NavigationStack { TestFileView( nodeName: "Lorem", children: ["Ipsum", "Dolor", "Sit"], pathPrefix: "Lorem" ) } } } #Preview { TestRoot() }
Topic: UI Frameworks SubTopic: SwiftUI
2
0
196
1d
MacCatalyst and the User's Documents Folder
I have a SwiftUI-based universal app which creates a file that it stores in documentsDirectory. On iOS/iPadOS, this file is stored in the application's Documents directory and is accessible via the Files app. On MacCatalyst, this operation does the same thing — it creates the file and stores it in ~/Library/Containers/<app directory>/Data/Documents. However what I want is for the document to be stored in ~/Documents, so that it is easily accessible to the user. How can I do that? I'd like it to occur without (for example) having to show a SaveFile panel...
3
0
197
1d
SwiftUI ScrollView blocked when content contains a drag gesture
I am porting my app to SwiftUI and I am hitting a wall when using ScrollView. In my application, I have nested scrollViews to represent a scheduler. outer vertical scroll view inner horizontal scroll view that allows to horizontally scroll multiple columns in the scheduler each column in the inner scroll view is a view that needs to allow for a drag to initiate the creation of a new appointment on macOS, I do a mouse-down drag, so it does not affect the scroll view and works fine on iOS, if I add a drag gesture to the column, it short circuits the scroll view and scrolling becomes disabled. To initiate the drag, there is a long-press, and that gesture is fine, only the subsequent drag gesture is problematic. I have attached URL to a test app. The UI allows you to toggle the drag gesture. Hopefully, someone can help to get it to work since I would eventually like to port the macOS target to Catalyst. Download Test App
Topic: UI Frameworks SubTopic: SwiftUI
1
0
115
1d
SwiftUI List cell reuse / view lifecycle behavior when scrolling
I’m trying to understand how SwiftUI List handles row lifecycle and reuse during scrolling. I have a list with around 60 card views; on initial load, only about 7 rows are created, but after scrolling to the bottom all rows appear to be created, and when scrolling back to the top I again observe multiple updates and apparent re-creation of rows. I confirmed this behavior using Instruments by profiling my app. Even though each row has a stable identifier, the row views still seem to be destroyed and recreated, which doesn’t resemble UIKit’s cell reuse model. I’d like clarity on how List uses identifiers internally, what actually gets reused versus recreated, and how developers should reason about performance and view lifetime in this case.
0
1
39
1d
help() view modifier
I have a bunch of Buttons with a .help(Text("Help text")) modifier, inside of a VStack which has its own .help() modifier describing the entire section. The VStack help shows up only when I hover over the buttons, and the Button help never shows at all. If I comment out the VStack help, the individual button helps show. How do I get both to show up properly? I want the VStack to show if I am in the roundedBorder, unless I am over a Button with its own .help modifier. import SwiftUI struct BugReport: View { @State private var testp1 = false @State private var testp2 = false var body: some View { VStack { Text("Hello, World!") Button("Test1") { testp1.toggle() } .help("Change the test1") Button("Test2") { testp2.toggle() } .help("Change the test2") } .help("Testing stuff") .roundedBorder(color: .black) } } #Preview { BugReport() }
Topic: UI Frameworks SubTopic: SwiftUI
3
0
304
2d
Slow rendering List backed by SwiftData @Query
Hello, I've a question about performance when trying to render lots of items coming from SwiftData via a @Query on a SwiftUI List. Here's my setup: // Item.swift: @Model final class Item: Identifiable { var timestamp: Date var isOptionA: Bool init() { self.timestamp = Date() self.isOptionA = Bool.random() } } // Menu.swift enum Menu: String, CaseIterable, Hashable, Identifiable { var id: String { rawValue } case optionA case optionB case all var predicate: Predicate<Item> { switch self { case .optionA: return #Predicate { $0.isOptionA } case .optionB: return #Predicate { !$0.isOptionA } case .all: return #Predicate { _ in true } } } } // SlowData.swift @main struct SlowDataApp: App { var sharedModelContainer: ModelContainer = { let schema = Schema([Item.self]) let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false) return try! ModelContainer(for: schema, configurations: [modelConfiguration]) }() var body: some Scene { WindowGroup { ContentView() } .modelContainer(sharedModelContainer) } } // ContentView.swift struct ContentView: View { @Environment(\.modelContext) private var modelContext @State var selection: Menu? = .optionA var body: some View { NavigationSplitView { List(Menu.allCases, selection: $selection) { menu in Text(menu.rawValue).tag(menu) } } detail: { DemoListView(selectedMenu: $selection) }.onAppear { // Do this just once // (0..<15_000).forEach { index in // let item = Item() // modelContext.insert(item) // } } } } // DemoListView.swift struct DemoListView: View { @Binding var selectedMenu: Menu? @Query private var items: [Item] init(selectedMenu: Binding<Menu?>) { self._selectedMenu = selectedMenu self._items = Query(filter: selectedMenu.wrappedValue?.predicate, sort: \.timestamp) } var body: some View { // Option 1: touching `items` = slow! List(items) { item in Text(item.timestamp.description) } // Option 2: Not touching `items` = fast! // List { // Text("Not accessing `items` here") // } .navigationTitle(selectedMenu?.rawValue ?? "N/A") } } When I use Option 1 on DemoListView, there's a noticeable delay on the navigation. If I use Option 2, there's none. This happens both on Debug builds and Release builds, just FYI because on Xcode 16 Debug builds seem to be slower than expected: https://indieweb.social/@curtclifton/113273571392595819 I've profiled it and the SwiftData fetches seem blazing fast, the Hang occurs when accessing the items property from the List. Is there anything I'm overlooking or it's just as fast as it can be right now?
5
4
1.3k
2d
WebView makes website content unaccessible on the top/bottom edges
I'm being faced with an issue when using SwiftUI's WebView on iOS 26. In many websites, the top/bottom content is unaccessible due to being under the app's toolbars. It feels like the WebView doesn't really understand the safe areas where it's being shown, because the content should start right below the navigation bar, and only when the user scrolls down, the content should move under the bar (but it's always reachable if the users scroll back up). Here's a demo of the issue: Here's a 'fix' by ensuring that the content of the WebView never leaves its bounds. But as you can see, it feels out of place on iOS 26 (would be fine on previous OS versions if you had a fully opaque toolbar): Code: struct ContentView: View { var body: some View { NavigationStack { WebView(url: URL(string: "https://apple.com")).toolbar { ToolbarItem(placement: .primaryAction) { Button("Top content covered, unaccessible.") {} } } } } } Does anyone know if there's a way to fix it using some sort of view modifier combination or it's just broken as-is?
14
1
468
2d
listRowBackground vs swipeActions ios26 compatibility
Hi! On iOS 26, Apple’s Mail app shows an effect where a list row gets rounded corners while you’re swiping (so the row visually “matches” the rounded swipe buttons). In my app I’m using SwiftUI List + .swipeActions. I also need a custom row tint (e.g. subtle red/gray highlight based on state). The problem is: If I apply my tint using .background / .clipShape, it moves with the row content during swipe and looks wrong. If I use .listRowBackground(...), I keep the tint, but I don’t get the same rounded-corners “morphing” effect as in Mail (or it looks inconsistent). Question: What’s the correct way in iOS 26 to keep a custom row tint and get the system-style rounded corners / liquid-glass effect while swiping?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
49
2d
Why is ScreenCaptureKit throttled to about 7 fps?
I have an app that records a 32 x 32 rect under the cursor as the user moves it around and it sends it to Flutter. It suffers from major lag. Instead of getting 30 fps, I get about 7 fps. That is, there are significant lags between screen grabs. This on an Intel Mac mini x64 with 15.7.3 and one display. flutter: NATIVE: ExplodedView framesIn=2 timeSinceStart=1115.7ms gapSinceLastFrame=838.8ms flutter: NATIVE: ExplodedView framesIn=4 timeSinceStart=1382.6ms gapSinceLastFrame=149.9ms flutter: NATIVE: ExplodedView framesIn=5 timeSinceStart=1511.0ms gapSinceLastFrame=128.4ms flutter: NATIVE: ExplodedView framesIn=7 timeSinceStart=1698.3ms gapSinceLastFrame=102.9ms flutter: NATIVE: ExplodedView STOP polling totalTime=4482.6ms framesIn=28 framesSent=28 acks=28 Here's a testable excerpt: import ScreenCaptureKit import CoreMedia import CoreVideo import QuartzCore final class Test: NSObject, SCStreamOutput, SCStreamDelegate { private let q = DispatchQueue(label: "cap.q") private var stream: SCStream? private var lastFrameAt: CFTimeInterval = 0 private var frames = 0 func start() { SCShareableContent.getExcludingDesktopWindows(false, onScreenWindowsOnly: true) { content, err in guard err == nil, let display = content?.displays.first else { print("shareableContent error: \(String(describing: err))"); return } let filter = SCContentFilter(display: display, excludingWindows: []) let config = SCStreamConfiguration() config.showsCursor = false config.queueDepth = 1 config.minimumFrameInterval = CMTime(value: 1, timescale: 30) config.pixelFormat = kCVPixelFormatType_32BGRA config.width = 32 config.height = 32 config.sourceRect = CGRect(x: 100, y: 100, width: 32, height: 32) let s = SCStream(filter: filter, configuration: config, delegate: self) try! s.addStreamOutput(self, type: .screen, sampleHandlerQueue: self.q) self.stream = s s.startCapture { startErr in print("startCapture err=\(String(describing: startErr))") } // Optional: move sourceRect at 30Hz (cursor-follow simulation) Timer.scheduledTimer(withTimeInterval: 1.0/30.0, repeats: true) { _ in let c2 = SCStreamConfiguration() c2.showsCursor = false c2.queueDepth = 1 c2.minimumFrameInterval = CMTime(value: 1, timescale: 30) c2.pixelFormat = kCVPixelFormatType_32BGRA c2.width = 32 c2.height = 32 let t = CACurrentMediaTime() c2.sourceRect = CGRect(x: 100 + (sin(t) * 50), y: 100, width: 32, height: 32) s.updateConfiguration(c2) { _ in } } } } func stream(_ stream: SCStream, didOutputSampleBuffer sb: CMSampleBuffer, of type: SCStreamOutputType) { guard type == .screen else { return } let now = CACurrentMediaTime() let gapMs = (lastFrameAt == 0) ? 0 : (now - lastFrameAt) * 1000 lastFrameAt = now frames += 1 if frames <= 10 || frames % 60 == 0 { print("frames=\(frames) gapMs=\(String(format: "%.1f", gapMs))") } } }
0
0
91
2d
UISlider valueChanged has uninitialized UIEvent
This issue was in the first iOS 26 beta and it still there with Xcode 26 beta 6 (17A5305f). Feedback is FB18581605 and contains sample project to reproduce the issue. I assign a target and action to a UISlider for the UIControl.Event.valueChanged value: addTarget(self, action: #selector(sliderValueDidChange), for: .valueChanged) Here’s the function. @objc func sliderValueDidChange(_ sender: UISlider, event: UIEvent) { print(event) } When printing the event value, there is a crash. When checking the event value with lldb, it appears uninitialized.
Topic: UI Frameworks SubTopic: UIKit Tags:
12
6
1.1k
2d
Navigation title flickers when tab is changed when used with a List / Form
Problem When a List / Form is added inside a TabView and navigationTitle is set, then switching between tabs causes the navigation title to flicker. Feedback: FB21436493 Environment Xcode: 26.2 (17C52) iOS: 26.2 (23C55) Reproducible on: Both simulator and device Root cause When List / Form is commented out, issue doesn't occur Steps to Reproduce Run app on iOS Switch between tabs Notice that the navigation title flickers Code ContentView import SwiftUI struct ContentView: View { @State private var selectedTab = TabItem.red var body: some View { NavigationStack { TabView(selection: $selectedTab) { ForEach(TabItem.allCases, id: \.self) { tab in Tab(tab.rawValue, systemImage: tab.systemImageName , value: tab) { // Problem occurs with a List / Form // Commenting out list works without flickering title List { Text(tab.rawValue) } } } } .navigationTitle(selectedTab.rawValue) } } } TabItem enum TabItem: String, CaseIterable { case red case green case blue var systemImageName: String { switch self { case .red: "car" case .green: "leaf" case .blue: "bus" } } } Screen recording:
Topic: UI Frameworks SubTopic: SwiftUI
3
0
249
3d