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
639
Jun ’25
Incorrect system color on popover view, and does not update while switching dark mode on iOS 26 beta 3
All system colors are displayed incorrectly on the popover view. Those are the same views present as a popover in light and dark mode. And those are the same views present as modal. And there is also a problem that when the popover is presented, switching to dark/light mode will not change the appearance. That affected all system apps. The following screenshot is already in dark mode. All those problem are occured on iOS 26 beta 3.
6
0
508
4h
NSBox Basically Not Visible At All on macOS Tahoe in Light Mode?
I noticed that I cannot even tell that an NSBox is being used on macOS Tahoe when the system is in light mode. The 'box' background can't be seen so it makes it appear that the subviews in the box aren't positioned correctly (because they are inset from the subview outside the box). There is no visual indicator that that subviews inside this box are grouped together because well, you can't see the box at all. In Interface Builder the box looks fine at Design Time in "Light Mode". In Dark Mode the box looks fine at design time and at run time. Just figured I'd throw that out there.
Topic: UI Frameworks SubTopic: AppKit Tags:
2
0
77
9h
NSButtons disappear on macOS 26
I have attached 2 images of our Mac Apps user interface. The app is built for macOS 15.6 or newer. On macOS 15 and earlier everything looks fine. But the same App running on macOS 26 the controls disappear. We were able to temporarily resolve the problem by adding UIDesignRequiresCompatibility to the info.plist. This type of nonsense happens all over the app without the compatibility switch. Shouldn't all these legacy controls be backward compatible on Glass? This part of the app where the controls are disappearing is built in Swift (not swift ui) and uses standard programatic layout and visual constraints. On macOS 26, there are no Xcode warnings or layout errors on the console relative to the layout so we are confused as to how we would resolve this without the use of UIDesignRequiresCompatibility. Is this some kind of bug in NSControl glass compatibility? We are not likely to move the entire app into SwiftUI anytime soon. How would we resolve this?
3
0
113
13h
CoreAutoLayout -[NSISEngine _flushPendingRemovals] crash
crash stack: Crashed: com.apple.main-thread 0 libsystem_pthread.dylib 0x90c thread_chkstk_darwin + 60 1 libsystem_pthread.dylib 0x90c ___chkstk_darwin + 60 2 CoreAutoLayout 0x14c4 -[NSISEngine _flushPendingRemovals] + 56 3 CoreAutoLayout 0x2de08 -[NSISEngine _coreReplaceMarker:withMarkerPlusDelta:].cold.1 + 64 4 CoreAutoLayout 0x15d78 -[NSISEngine _coreReplaceMarker:withMarkerPlusDelta:] + 204 5 CoreAutoLayout 0x2ce38 -[NSISEngine constraintDidChangeSuchThatMarker:shouldBeReplacedByMarkerPlusDelta:] + 108 6 CoreAutoLayout 0x15f1c -[NSISEngine tryToChangeConstraintSuchThatMarker:isReplacedByMarkerPlusDelta:undoHandler:] + 100 7 CoreAutoLayout 0x2fdbc -[NSLayoutConstraint _tryToChangeContainerGeometryWithUndoHandler:] + 252 8 CoreAutoLayout 0x3020c -[NSLayoutConstraint _setSymbolicConstant:constant:symbolicConstantMultiplier:] + 452 9 CoreAutoLayout 0x30378 -[NSLayoutConstraint setConstant:] + 84 10 UIKitCore 0x51c3c __74-[UIView(UIConstraintBasedLayout) _autoresizingConstraints_frameDidChange]_block_invoke + 140 11 UIKitCore 0x1841174 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 112 12 UIKitCore 0x51b28 -[UIView(UIConstraintBasedLayout) _autoresizingConstraints_frameDidChange] + 452 13 UIKitCore 0x2c894 -[UIView _constraints_frameDidChange] + 100 14 UIKitCore 0x18fac08 -[UIView(Geometry) setFrame:] + 576 15 UIKitCore 0x96712c -[UITabBar setFrame:] + 128 16 UIKitCore 0x1666f4 -[_UITabBarControllerVisualStyle updateTabBarLayout] + 360 17 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 18 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 19 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 20 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 21 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 22 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 23 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 24 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 25 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 26 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 27 UIKitCore 0x16642c -[UITabBarController _prepareTabBar] + 128 28 UIKitCore 0x166a10 -[UITabBarController _layoutContainerView] + 376 29 UIKitCore 0x1677a8 -[UITabBarController __viewWillLayoutSubviews] + 28 30 UIKitCore 0x147078 -[UILayoutContainerView layoutSubviews] + 176 31 UIKit 0xb14a0 -[UILayoutContainerViewAccessibility layoutSubviews] + 60 for a more detail crash stack, can see attach file: crash.txt crash probabilistic happed after app enter background, and our app support landscape, when crash appear, the system method: /* This method is called when the view controller's view's size is changed by its parent (i.e. for the root view controller when its window rotates or is resized). If you override this method, you should either call super to propagate the change to children or manually forward the change to children. */ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator API_AVAILABLE(ios(8.0)); is called; but for a normal not crash case, when enter background and rotate device, the viewWillTransitionToSize method is not called until app enter foreground; Are there any suggestions that can help solve this problem, thank you.
1
0
150
14h
Locking App Orientation to Landscape in Playground
Hello! I’m building my Swift Student Challenge project in Swift Playgrounds, and I’ve run into an issue with app orientation. Since this is a game, the layout and interactions only work correctly in landscape, but Playgrounds doesn’t offer the usual orientation settings you’d configure in Xcode. Is there a recommended way to force a landscape-only experience in Swift Playgrounds using SwiftUI? Any workarounds or guidance would be greatly appreciated! Thank you!
0
0
15
18h
Push to start live activities with channelIds do not work for a second time without re-installing the app.
We have implemented live activities with broadcast notification using channels. It has been working without a problem for the last 6-8 months. Now we want to upgrade it by starting the channel based live activity via push notification. Whenever I try locally with development channels there isnt any problem regarding to starting live activity. When we go production on Testflight or App Store it doesn't work after first successful push even though user enters the app and send the new push to start token to our server and we are using the latest token we receive. We couldn't go further with debugging since it works perfectly fine the client when tried locally and we know we can send successful pushes as well since the metrics shows 12% success but we do not actually know what happened to remaining 88%. Every apns request return success with 200 and empty body. How can we further debug this issue. Or is this a common problem, if so, is there any possible solution to this. As far as we see, token goes to our server so we have the latest token all the time and this whole logic doesn't work without deleting and reinstalling the app.
1
0
68
20h
How to present a view in SwiftUI on the top of any other view, even if there is already a view presented
I have a SwiftUI app that needs to present a fullScreenCover when the user opens a deep link. This screen must appear above anything currently shown — even if another fullScreenCover is already being presented. In UIKit, I can achieve this by walking the view controller hierarchy, finding the top-most view controller, and presenting the new full-screen view from there. What is the recommended way to reproduce this behavior in SwiftUI? How can I ensure a fullScreenCover is always shown above the current presentation layer, regardless of the app’s UI state?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
51
1d
NavigationSplitView + inspector causes Sidebar state issues on Mac Catalyst
Hi everyone! I've encountered an issue on Mac Catalyst: using the latest inspector modifier causes abnormal Sidebar and Columns state in NavigationSplitView. Sample Code: struct ContentView: View { @State private var isPresented = false var body: some View { NavigationSplitView { List { ForEach(0..<20, id: \.self) { item in Text("Item \(item)") } } } content: { List { ForEach(0..<20, id: \.self) { item in Text("Item \(item)") } } } detail: { List { } } .inspector(isPresented: $isPresented) { Form { } } } } Steps to reproduce: Xcode 16 beta 7, create a new iOS project Paste the code above Enable Mac Catalyst Run on Mac (macOS 15 beta 9) Press Command+N three times to open 3 new windows Click the Sidebar Toggle button The issue occurs (see screenshot below) Through testing, I found that as long as the inspector modifier is attached, the issue occurs. Also, the problem only appears in the 3rd and subsequent newly opened windows—the first two windows work as expected. FB20061521
1
0
240
1d
Display .icon files in SwiftUI
Is there a way to display a .icon file in SwiftUI? I want to show the app icon in the app itself but exporting and including the app icon as a PNG feels redundant. This would consume a lot of unnecessary storage especially when including a lot of alternative app icons. There has to be a better way Otherwise I would file a feedback for that Thank you
1
8
200
1d
Popovers are broken on macCatalyst
.popover(isPresented: modifier doesn't work on Mac Catalyst when attached to the item in the toolbar. The app crashes on button click, when trying to present the popover. iOS 26 RC (macOS 26 RC) Feedback ID - FB20145491 import SwiftUI struct ContentView: View { @State private var isPresented: Bool = false var body: some View { NavigationStack { Text("Hello, world!") .toolbar { ToolbarItem(placement: .automatic) { Button(action: { self.isPresented.toggle() }) { Text("Toggle popover") } .popover(isPresented: $isPresented) { Text("Hello, world!") } } } } } } #Preview { ContentView() }
3
1
223
1d
NSSheetMoveHelper Sends Parent Windows Flying If Sheet Window Frame is Resized on macOS Tahoe
So I noticed this: A sheet window is presented. The sheet window has some UI that makes it expandable say a little arrow expandable button. Click the little expandable button. Now the sheet window controller calls - (void)setFrame:display:animate: on its window to resize. The parent window flies across the screen to the lower left corner. I'm on Tahoe 26.1. Seems to be related to NSSheetMoveHelper. Not sure how long this bug has been around. Workaround is to call -setFrame:display:animate: and pass NO to the animate flag. Then the sheet window resizes (but not animated which doesn't look as good as the old behavior but better than suddenly disappearing). I think Apple may already knows about this bug b/c in an Apple app on Tahoe I see a sheet resizing being done with no animation...
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
19
1d
UITabBar ignores font in iOS 26.2
Our app has a UITabBar and the compactInlineLayoutAppearance has a custom font set. This worked fine on iOS 26.0 and 26.1. [self.bottomTabBar.standardAppearance.compactInlineLayoutAppearance.normal setTitleTextAttributes: @{ NSFontAttributeName:[UIFont fontWithName:@"AvenirNext-DemiBold" size:18.0] }]; But on iOS 26.2, the system ignores this custom font. How can I apply a custom font to a UITabBar on iOS 26.2?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
77
1d
Can SwiftUI Views serve as delegates?
Structs are value types, and the SwiftUI gets reinitialized many times throughout its lifecycle. Whenever it gets reinitialized, would the reference that the delegator has of it still work if the View uses @State or @StateObject that hold a persistent reference to the views data? protocol MyDelegate: AnyObject { func didDoSomething() } class Delegator { weak var delegate: MyDelegate? func trigger() { delegate?.didDoSomething() } } struct ContentView: View, MyDelegate { private let delegator = Delegator() @State counter = 1 var body: some View { VStack { Text("\(counter)") Button("Trigger") { delegator.trigger() } } } func didDoSomething() { counter += 1 //would this call update the counter in the view even if the view's instance is copied over to the delegator? } }
0
0
27
1d
Folder icon change in FileProvider mount in Finder
We are creating a Replicated FileProvider based application, where we need to change folder icons for root level folders. I tried below two approaches. This using NSFileProviderDecorations + Custom UTType, this changed the UI as shown: This using Custom UTType, this had no UI change: How can we change the default folder icon, to our custom icon?
3
0
183
2d
Buttons on tvOS with text are blurred
When adding buttons to a sheet, on tvOS the text is blurred in the buttons, making it illegible. Feedback: FB21228496 (used GPT to extract an example from my project for a test project to attach here) // ButtonBlurTestView.swift // Icarus // // Test view to reproduce blurred button issue on tvOS // import SwiftUI struct ButtonBlurTestView: View { @State private var showSheet = false @State private var selectedTags: [Int] = [] @State private var newTagName: String = "" // Hardcoded test data private let testTags = [ TestTag(id: 1, label: "Action"), TestTag(id: 2, label: "Comedy"), TestTag(id: 3, label: "Drama"), TestTag(id: 4, label: "Sci-Fi"), TestTag(id: 5, label: "Thriller") ] var body: some View { NavigationStack { VStack { Text("Button Blur Test") .font(.title) .padding() Button("Show Test Sheet") { showSheet = true } .buttonStyle(.borderedProminent) .padding() Text("Tap the button above to open a sheet with buttons inside a Form.") .font(.caption) .foregroundColor(.secondary) .multilineTextAlignment(.center) .padding() } .navigationTitle("Blur Test") .sheet(isPresented: $showSheet) { TestSheetView( selectedTags: $selectedTags, newTagName: $newTagName, testTags: testTags ) } } } } struct TestSheetView: View { @Environment(\.dismiss) private var dismiss @Binding var selectedTags: [Int] @Binding var newTagName: String let testTags: [TestTag] var body: some View { NavigationStack { VStack { // Header VStack { Text("Testing") .font(.title2) .bold() Text("Test TV Show") .font(.subheadline) .foregroundColor(.secondary) } .padding() // Form with buttons Form { Section(header: Text("Summary")) { Text("This is a test") .font(.subheadline) .foregroundColor(.secondary) } Section(header: Text("Tags")) { tagsSelectionView } } } .navigationTitle("Add") #if !os(tvOS) .navigationBarTitleDisplayMode(.inline) #endif .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } } ToolbarItem(placement: .confirmationAction) { Button("Add") { dismiss() } } } } } private var tagsSelectionView: some View { VStack(alignment: .leading) { // Tag pills in a grid let columns = [GridItem(.adaptive(minimum: 80), spacing: 8)] LazyVGrid(columns: columns, alignment: .leading, spacing: 8) { ForEach(testTags, id: \.id) { tag in TagPill( tag: tag, selected: selectedTags.contains(tag.id) ) { if selectedTags.contains(tag.id) { selectedTags.removeAll { $0 == tag.id } } else { selectedTags.append(tag.id) } } } } Divider() // Add new tag button HStack { TextField("New tag name", text: $newTagName) #if os(tvOS) .textFieldStyle(PlainTextFieldStyle()) #else .textFieldStyle(RoundedBorderTextFieldStyle()) #endif Button("Add") { // Test action newTagName = "" } .disabled(newTagName.trimmingCharacters(in: .whitespaces).isEmpty) } } } } // Tag Pill - matches the structure from original project private struct TagPill: View { let tag: TestTag let selected: Bool let action: () -> Void var body: some View { Button(action: action) { Text(tag.label) .font(.callout) .lineLimit(1) .padding(.horizontal, 12) .padding(.vertical, 8) .background( Capsule() .fill(selected ? Color.accentColor : Color.secondary.opacity(0.15)) ) .overlay( Capsule() .stroke(selected ? Color.accentColor : Color.secondary.opacity(0.35), lineWidth: 1) ) .foregroundStyle(selected ? Color.white : Color.primary) .contentShape(Capsule()) } .buttonStyle(.plain) #if os(tvOS) .focusable(true) #endif } } struct TestTag { let id: Int let label: String } #Preview { ButtonBlurTestView() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1
0
117
2d
iOS 18.1 crash UIHostingView.layoutSubviews() / swift_unknownObjectWeakAssign / objc_storeWeak
We're seeing sporadic crashes on devices running iOS 18.1 - both beta and release builds (22B83). The stack trace is always identical, a snippet of it below. As you can tell from the trace, it's happening in places we embed SwiftUI into UIKit via UIHostingController. Anyone else seeing this? 4 libobjc.A.dylib 0xbe2c _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 30 5 libobjc.A.dylib 0xb040 weak_register_no_lock + 396 6 libobjc.A.dylib 0xac50 objc_storeWeak + 472 7 libswiftCore.dylib 0x43ac34 swift_unknownObjectWeakAssign + 24 8 SwiftUI 0xeb74c8 _UIHostingView.base.getter + 160 9 SwiftUI 0x92124 _UIHostingView.layoutSubviews() + 112 10 SwiftUI 0x47860 @objc _UIHostingView.layoutSubviews() + 36
9
1
1.2k
2d
Should TabView with .page style support keyboard left/right navigation automatically?
I’m trying to understand the expected behavior of TabView when using .tabViewStyle(.page) on iPadOS with a hardware keyboard. When I place a TabView in page mode, swipe gestures correctly move between pages. However, left and right arrow keys do nothing by default, even when the view is made focusable. This feels a bit surprising, since paging with arrow keys seems like a natural keyboard interaction when a keyboard is attached. Right now, to get arrow-key navigation working, I have to manually: Make the view focusable Listen for arrow key presses Update the selection state manually This works, but it feels a little tedious for something that seems like it could be built-in. import SwiftUI struct PageTabsExample: View { @State private var selection = 0 private let pageCount = 3 var body: some View { TabView(selection: $selection) { Color.red.tag(0) Color.blue.tag(1) Color.green.tag(2) } .tabViewStyle(.page) .indexViewStyle(.page) .focusable(true) .onKeyPress(.leftArrow) { guard selection > 0 else { return .ignored } selection -= 1 return .handled } .onKeyPress(.rightArrow) { guard selection < pageCount - 1 else { return .ignored } selection += 1 return .handled } } } My questions: Is this lack of default keyboard paging for page-style TabView intentional on iPadOS with a hardware keyboard? Is there a built-in way to enable arrow-key navigation for page-style TabView, or is manual handling the expected approach? Does my approach above look like the “SwiftUI-correct” way to do this, or is there a better pattern for integrating keyboard navigation with paging? For this kind of behavior, is it generally recommended to use .onKeyPress like I’m doing here, or would .keyboardShortcut be more appropriate (for example, wiring arrow keys to actions instead)? Any guidance or clarification would be greatly appreciated. I just want to make sure I’m not missing a simpler or more idiomatic solution. Thanks!
0
0
79
3d