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

UIGlassEffect crashes
Hello there! I’m using UIGlassEffect in my iOS 26 app, which was just approved, but I’m seeing unexpected crashes: +[UIGlassEffect effectWithStyle:]: unrecognized selector sent to class. Could this be happening only for users running earlier betas? Was UIGlassEffect not available in Beta 1–3? I started preparing my update with Beta 4. Thank you!
Topic: UI Frameworks SubTopic: UIKit
1
1
114
1w
PDFKit PdfView Black Boxes sometimes
Hi! I'm using PDFKits PdfView to display a PDF file and after several page changes, the background turns black, suddenly (like a big black rectangle). The error occurs in the Books App on the iPad as well and looks similiar to this issue: https://discussions.apple.com/thread/8627073?sortBy=rank Anyone got a solution for this?
1
0
148
1w
SwiftUI Nav Bar Changes in Height When Loading While Presented in a Sheet
If you create a SwiftUI App where a ‘.sheet’ is presented and use a NavigationStack within that Sheet, when you use NavigationLink to present a view, the title of the Nav Bar will start at a height of 46px and pop to the Default Height of 54px when it loads causing a visual pop in the UI. In iOS 18 it functions correctly, in iOS 26 the visual pop is present. This impacts both inline and large styles, if you disable the back button it is still present, the only way I have discovered to get rid of it is by using 'fullScreenCover' instead of '.sheet'. This feels like buggy UI. This issue has been present since iOS 26 Beta 5, I was hoping it would be fixed but is still present in the GM. Feedback has been filed via Feedback Assistant: FB20228369 This is the code to re-produce the issue: import SwiftUI struct ContentView: View { @State private var showSheet: Bool = false var body: some View { VStack { Button { showSheet.toggle() } label: { Text("Show Sheet") } } .padding() .sheet(isPresented: $showSheet) { NavigationStack { List { NavigationLink { Rectangle() .foregroundStyle(.red) .navigationTitle("Red") } label: { Text("Show Red") } } } .presentationSizing(.page) } } } #Preview { ContentView() }
0
1
258
1w
glassEffect geometry bug when using rotationEffect
If using .glassEffect or .buttonStyle(.glass) along with .rotationEffect(), the view's geometry grows in size (proportionally to the degrees of the angle): struct ContentView: View { var body: some View { ZStack { Color.red.ignoresSafeArea() VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Angle: 30") } .padding() .glassEffect(in: .rect(cornerRadius: 20)) .rotationEffect(.degrees(30)) } } } The expectation is that geometry stays the same, regardless of rotation. This has been a bug in all the betas, and is now also confirmed in Xcode 26 RC and iOS 26 RC.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
176
1w
Custom SF Symbols with badges not vertically centered in SwiftUI buttons
[Also submitted as FB20225387] When using a custom SF Symbol that combines a base symbol with a badge, the symbol doesn’t stay vertically centered when displayed in code. The vertical alignment shifts based on the Y offset of the badge. There are two problems with this: The base element shouldn’t move vertically when a badge is added—the badge is meant to add to the symbol, not change its alignment. The badge position should be consistent with system-provided badged symbols, where badges always appear in a predictable spot relative to the corner they're in (usually at X,Y offsets of 90% or 10%). Neither of these behaviors match what’s expected, leading to inconsistent and misaligned symbols in the UI. Screenshot of Problem The ellipsis shifts vertically whenever the badge Y offset is set to anything other than 50%. Even at a 90/10 offset, it still doesn’t align with the badge position of the system "envelope.badge" symbol. SF Symbols Export This seem to be a SwiftUI issue since both the export from SF Symbols is correctly centered: Xcode Assets Preview And it's also correct in the Xcode Assets preview: Steps to Repro In SF Symbols, create a custom symbol of "ellipsis" (right-click and Duplicate as Custom Symbol) Combine it with the "badge" component (select Custom Symbols, select the newly-created "custom.ellipsis", then right-click and Combine Symbol with Component…) Change the badge's Y Offset to 10%. Export the symbol and add it to your Xcode asset catalog. In Xcode, display the symbol inside a Button using Image(“custom.ellipsis.badge”). Add a couple more buttons separated by spacers, using system images of "ellipsis" and "app.badge". Compare the "custom.ellipsis.badge" button to the two system symbol buttons. Expected The combined symbol remains vertically centered, matching the alignment shown in both the SF Symbols export window and the Xcode asset catalog thumbnails. Actual The base symbol (e.g., the ellipsis portion) shifts vertically based on the Y offset of the badge element. This causes visual misalignment when displayed in SwiftUI toolbars or other layouts. Also included the system “envelope.badge” icon to show where a 90%, 10% badge offset should be located. System Info SF Symbols Version 7.0 (114) Xcode Version 26.0 (17A321) macOS 15.6.1 (24G90) iOS 26.0 (23A340)
1
0
214
1w
Inset or disable NSSheetEffectDimmingView when presenting a sheet?
I have an NSWindow that isn't entirely opaque. When presenting a sheet AppKit overlays the window with NSSheetEffectDimmingView. The problem is the entire window frame is used so NSSheetEffectDimmingView overlays the transparent areas of the window and it looks bad. Is there a clean way to inset NSSheetEffectDimmingView or even perhaps disable this behavior completely so I can draw my own? I'm looking for a clean solution (other than modifying the view hierarchy of NSNextStepFrame) or swizzles which I might have to resort to if there is no other way.
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
68
1w
Strange Liquid Glass elements tinting
I updated my App to iOS26 and I have some strange tinting with Liquid Glass elements. Sometime the elements are tinted and sometime not. Look at the screenshots. This is the same view, without any changes. Just go back and forth to see the different Button tinting. And this is not just happing in the View. It happens all over the app. Why is this happening?
2
0
140
1w
UI resizing / realigning issue in iOS 26 device building in xcode 26
In our app we launch landscape only player view controller from portrait only view controller. This is done using present(playerViewController, animated:true) and it is dismissed using dismiss() api. This is working fine till iOS 18 but broken in iOS 26. Now when presenting the presented viewcontrollers UI is realigning / resizing after the view is visible and while dismissing the presenting view controller is realigning after the view is visible. Anyone else seeing it or how to fix this?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
79
1w
Bug: Black Pixel Flicker When Using glassEffect() with Animation
When using .glassEffect(.clear, in: .circle) with animation in a View, there is a chance that black pixel blocks flash on the screen. The abnormal effect can be seen in the attached video and screenshots.FB20216507 Code is as follows: VStack { if isLoaded { VStack { if #available(macOS 26.0, *) { Color.clear .frame(maxWidth: .infinity, maxHeight: .infinity) .glassEffect(.clear, in: .circle) } } .transition(.asymmetric(insertion: .scale, removal: .opacity)) } } .animation(.bouncy, value: isLoaded)
Topic: UI Frameworks SubTopic: SwiftUI
0
0
121
1w
iOS 18.x iPhone 15, & 15 ProMax Buttons/Labels Disappear
Only people using iPhone 15 and iPhone 15Pro (don't know about iPhone 15 plus or iPhone 15 pro max) are having problems with my App. All seems fine on 13, 14 and 16 as well as iPad The app is in testflight now. I cannot replicate the issue in MAC via virtual iPhone 15 , 15 plus, pro, or promax. What I see happening - it looks like users are seeing labels disappear, sometimes buttons are disappearing on the 15 pro and 15. I have an ingredient selection page where you can select the ingredients that you have. These are outlined and grouped to make choosing ingredients intuitive. I have a profile selector where you can choose by flavor, strength, body or mood. At the bottom I have three buttons , button one lets you choose if drinks are sorted or strictly matched. The last button allows the user to see the drinks they can make based on ingredients they have.This is done by matching the ingredients with a locally placed drinks list which contains a drink id, drink name, ingredients and profile information. Clicking the last button opens a flatlist. Users on iPhone 15 and iPhone 15Pro iOS 18 sometimes experience the three buttons at the bottom being gone altogether. then returning. After clicking the Drinks Available button the button label should change to hide available drinks, but sometimes that label disappears. The drinks flat list has space for many drinks but the labels for those drinks are not present until halfway down the list where one drink shows up. No other device behaves this way. It might be more common when there are large number of ingredients selected ....e.g., if about 50% of 211 ingredients selected it might be more likely to happen. This needs to be tested to verify,
0
0
102
1w
SwiftUI Button with Image view label has smaller hit target
[Also submitted as FB20213961] SwiftUI Button with a label: closure containing only an Image view has a smaller tap target than buttons created with a Label or the convenience initializer. The hit area shrinks to the image bounds instead of preserving the standard minimum tappable size. SCREEN RECORDING On a physical device, the difference is obvious—it’s easy to miss the button. Sometimes it even shows the button-tapped bounce animation but doesn’t trigger the action. SYSTEM INFO Xcode Version 26.0 (17A321) macOS 15.6.1 (24G90) iOS 26.0 (23A340) SAMPLE CODE The following snippet shows the difference in hit targets between the convenience initializer, a Label, and an Image (the latter two in a label: closure). // ✅ Hit target is entire button Button("Button 1", systemImage: "1.square.fill") { print("Button 1 tapped") } // ✅ Hit target is entire button Button { print("Button 2 tapped") } label: { Label("Button 2", systemImage: "2.square.fill") } // ❌ Hit target is smaller than button Button { print("Button 3 tapped") } label: { Image(systemName: "3.square.fill") }
1
2
129
1w
NSWindowCollectionBehavior in Full Screen Spaces
The NSWindow collection behavior is supposed to allow for a window to appear in all spaces, even when another window is full screen in that space. However, I cannot get this to work as expected with any combination. This should be as simple as: window.level = .screenSaver window.collectionBehavior = [ .canJoinAllSpaces, .fullScreenAuxiliary, .canJoinAllApplications, .stationary, .ignoresCycle ] If I have a window (Safari for example) which is full screen in its own space, run my app and change to the Safari window's space, my app's window is not visible at all; it will only float on top of windows in non-fullscreen spaces. What am I misunderstanding?
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
84
1w
.safeAreaBar(edge: .bottom), animation lag on appear/disappear
When I try to show/hide the content in .safeAreaBar(edge: .bottom), especially the content with a large height, the background animation of the toolbar is very laggy. iOS 26 RC Feedback ID - FB19768797 import SwiftUI struct ContentView: View { @State private var isShown: Bool = false var body: some View { NavigationStack { Button("Toggle") { withAnimation { isShown.toggle() } } ScrollView(.vertical) { ForEach(0..<100) { index in Text("\(index)") .padding() .border(.blue) .background(.blue) .frame(maxWidth: .infinity) } } .scrollEdgeEffectStyle(.soft, for: .bottom) .safeAreaBar(edge: .bottom) { if isShown { Text("Safe area bar") .padding(64) .background(.red) } } } } } #Preview { ContentView() }
0
0
61
1w
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() }
1
0
87
1w
.safeAreaBar doesn't look good together with .searchable
When using .scrollEdgeEffectStyle(.hard, for: .top), search bar background doesn't match with . safeAreaBar view background (you can see that is is darker than the rest of the toolbar). Please find the screenshot in the attachment iOS 26 RC Light Mode Feedback ID - FB19768159 import SwiftUI struct ContentView: View { @State private var count = 0 var body: some View { NavigationStack { ScrollView(.vertical) { ForEach(0..<100) { index in Text("\(index)") .background(.red) } } .scrollEdgeEffectStyle(.hard, for: .top) .searchable( text: .constant(""), placement: .navigationBarDrawer(displayMode: .always) ) .safeAreaBar(edge: .top) { Text("Safe area bar") } } } } #Preview { ContentView() }
0
0
40
1w
.preferredColorScheme doesn't work with .scrollEdgeEffectStyle(.hard, for: .top)
.preferredColorScheme(.dark) doesn't seem to affect app toolbar, when .scrollEdgeEffectStyle(.hard, for: .top) is used. In the attachment, you can see the title and toolbar items don't change according to current value of .preferredColorScheme (you may need to scroll a bit to achieve it) iOS 26 RC Feedback ID - FB19769073 import SwiftUI struct ContentView: View { var body: some View { NavigationStack { ScrollView(.vertical) { ForEach(0..<100) { index in Text("\(index)") .padding() .border(.blue) .background(.blue) .frame(maxWidth: .infinity) } } .scrollEdgeEffectStyle(.hard, for: .top) .navigationTitle("Test Title") .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button(action: { }) { Text("Test") } } } } .preferredColorScheme(.dark) } } #Preview { ContentView() }
0
0
38
1w
Alert Closures Not Firing + Navigation Animations Broken
Hi, I hope you are doing well. We have been running up against an issue in our application which despite our best efforts we cannot seem to solve. After a certain point of use (of which we cannot seem to isolate a trigger), something internally with the way SwiftUI handles animation transactions seems to be breaking. This results in the following behavior that we (and our users) are noticing: Alerts/Sheets/NavigationPath changes lose all animations Closures associated with buttons no longer fire at all. The alert disappears, but with no animation and any action associated with the button selected does nothing. This results in an infinite loop of triggering an alert, clicking on an alert action, and the alert dismissing without the corresponding action ever occurring. We have tried moving the navigationPath out of a view model (Observable) and into a @State variable on the view in case it was an issue with view pre-rendering due to path changes, but this did not improve our case. We hoisted the state and the alert presentation out of all subviews and onto the root view of our navigation destination (as this happens on a sub-page of the application) as well, and while did this seem to minimize occurrences it did not fully resolve it. The app structure of our watch app is as follows: We have a NavigationStack at the root level which wraps a TabView, containing 3 pages. Selecting a button triggers a navigation destination, presenting a detail view. The detail view is a ZStack which switches on a property contained in an @State Observable view model scoped to the detail view. The ZStack can contain one of 5 subviews, derived from a viewState enum with associated values (all of which are equatable, and by extension viewState is also an equatable type as well). One of the subviews receives a binding, which on button trigger updates the binding and thus the view containing the ZStack presents the alert. Sometimes, when this happens, the animations break, and then are subsequently broken for the remainder of the lifetime of the app until it is force-closed (not backgrounded, but a full force-close). NavigationStack { TabView { Tab1 Tab2 // triggers navigationDestination Tab3 } .navigationDestination(for:) { DestinationView() // the view containing the ZStack + Alert } } STEPS TO REPRODUCE Unfortunately we have not been able to ascertain exactly what is causing this issue as we cannot reproduce it in a sandbox environment, only when moving through the view flow associated with our code. Any debugging ideas or recommendations would be greatly appreciated, as we have already tried _printChanges and do not notice any erroneous view redraws.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
55
1w
How to turn off background extension effect in UISplitViewController?
I have a triple-column UISplitViewController setup in "tile" mode. Each of the 3 columns has a table view controller. Under iPadOS 26, the section headers and row selection in the middle table extends all the way to the left of the screen, behind the primary column. It looks terrible. The documentation for "Adopting Liquid Glass" makes it sound like you can add this behavior by using UIBackgroundExtensionView. But I get this behavior automatically in a UISplitViewController. How do I turn this off? I created a simpler sample using a double-column split view with two table view controllers. Here's a screenshot of the result: Note how the section headers and the row selection appear all the way to the left edge of the screen. I don't want that effect. How do you turn off this effect in a UISplitViewController? Here is the code used to setup the split view and the app's main window: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let winScene = (scene as? UIWindowScene) else { return } let primary = PrimaryViewController(style: .plain) let primaryNC = UINavigationController(rootViewController: primary) let detail = DetailViewController(style: .plain) let detailNC = UINavigationController(rootViewController: detail) let sv = UISplitViewController(style: .doubleColumn) sv.preferredDisplayMode = .oneBesideSecondary sv.preferredSplitBehavior = .tile sv.primaryBackgroundStyle = .none sv.displayModeButtonVisibility = .automatic sv.setViewController(primaryNC, for: .primary) sv.setViewController(detailNC, for: .secondary) let win = UIWindow(windowScene: winScene) win.rootViewController = sv win.makeKeyAndVisible() window = win } The PrimaryViewController and DetailViewController are simple UITableViewController subclasses that only add a few rows and section headers as needed.
0
0
66
1w
PaperMarkupViewController doesn't conform to MarkupEditViewController.Delegate
In the Meet PaperKit WWDC session in provided sample code, there's: let markupEditViewController = MarkupEditViewController(supportedFeatureSet: .latest) markupEditViewController.delegate = paperViewController However PaperMarkupViewController doesn't conform to MarkupEditViewController.Delegate, it only conforms to MarkupToolbarViewController.Delegate. But based on the demo, MarkupEditViewController is for iOS and MarkupToolbarViewController is for macOS. Compiler gives me the following error: Cannot assign value of type 'PaperMarkupViewController?' to type '(any MarkupEditViewController.Delegate)?' Arguments to generic parameter 'Wrapped' ('PaperMarkupViewController' and 'any MarkupEditViewController.Delegate') are expected to be equal What's the solution here?
Topic: UI Frameworks SubTopic: UIKit
2
0
68
1w