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

iOS 26 regression: Slider does not respect step parameter
In iOS 26, the Slider control no longer respects the step parameter. For example, import SwiftUI struct ContentView: View { @State private var sliderValue: CGFloat = 16 var body: some View { Slider( value: $sliderValue, in: 0...100, step: 5, onEditingChanged: { editing in print(sliderValue) } ) } } In iOS 18, this prints values like 5, 35, 60, 95, etc. In iOS 26.0 (release version), this prints floats that are not rounded to the nearest 5, and the slider does not snap to values ending in 5. Feedback report number: FB20320542
Topic: UI Frameworks SubTopic: SwiftUI
0
1
49
1d
SwiftUI Slider will cause app to crash on macOS Tahoe RC
Hello, creating a simple-as-it-gets Slider in SwiftUI and then running that app on Mac Catalyst with the macOS idiom enabled, the app crashes: struct ContentView: View { @State private var sliderValue: Double = 0.4 var body: some View { VStack { Slider(value: $sliderValue) } .padding() } } running this will result in an exception: _setMinimumEnabledValue: is not supported on UISlider when running Catalyst apps in the Mac idiom. See UIBehavioralStyle for possible alternatives. This is obviously not ideal and also apparently no documented. Is there a workaround for this? It used to work for on macOS Sonoma. macOS 26 RC Xcode 26 RC FB20191635 Thanks!
2
2
200
1d
Liquid Glass / iOS 26 Tab bar positions incorrectly on iPad; repositions correctly when re-opening app
I have a TabView (no modifiers) as the top-level view in my app. Starting with iOS 26 it starts off partially "under" the Status Bar, and then repositions if I switch between apps. Starting Point After Switching To/From Another App In the simulator, pressing "Home" and then reopening the app will fix it. Anyone else seeing something similar? Is there a modifier I'm missing on TabView that might prevent this behaviour? Thanks!
3
1
206
1d
View with FetchRequest does not always update when data changes
I'm having an issue where FetchRequest does not consistently reflect changes that are made in the CoreData model. Things seem to work fine if you create or delete any object before editing, but if you only edit an object, the changes will not be shown. Here is a minimal repro: https://github.com/literalpie/fetchrequest-bug/tree/main I have a workaround that involved adding a "noop" predicate that gets toggled whenever objectWillChange is emitted. This seems to force the FetchRequest to re-look at things. .onReceive(items.publisher.flatMap(\.objectWillChange), perform: { _ in items.nsPredicate = update ? NSPredicate(value: true) : NSPredicate(format: "1 == 1") update.toggle() })
0
0
76
1d
View with FetchRequest doesnt update on change
Hello guys, this is my first post to this forum and really hope that somebody can help me here. I would highly appreciate every help! I am writing my first app with Swift UI (never used UIKit before) which I want to publish later on. This is also my first app which has CoreData implemented. For example I use the following entities: Family, Person 1 Persons can have 1 Family 1 Family can have many Persons My App is structured as the following: ContentView: Contains a TabView with 2 other views in it. A Settings View and a View with a LazyVGrid. LazyVGrid View: This View shows a GridItem for every Family. I get the Families with the following Fetchrequest: @Environment(\.managedObjectContext) private var viewContext // These are the Families from the FetchRequest @FetchRequest(entity: Family.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \Family.created, ascending: false)] ) var families: FetchedResults<Family> Every GridItem is linking to a "FamilyDetailView" via NavigationLink. So i pass the family as the following: NavigationLink(destination: FamilyDetailView(family: family).environment(\.managedObjectContext, self.viewContext), label: {Text("Family Name") In the FamilyDetailView i get the Family with a property wrapper: @State var family : Family In this FamilyDetailView is the problem i have. Here I also have a LazyVGrid, which shows 1 NavigationLink for every Person in the Family in a GridItem . In this GridItem I also show for example the "name" of the Person. When tapping the NavigationLink i get to the last View, the PersonDetailView. This View gets the Person which is also an entity which has a relationship to the Family Entity. I pass it as the follow: NavigationLink( destination: PersonDetailView(person: person), label: {Text("Person")}) In the PersonDetailView I now change the name of the person and save the changed to CoreData. The change is saved without a problem, the problem is that when I go back, using the topleading back button from the NavigationView, the Views are not updated. I have to restart the App to see the changes.. I know that the Problem has to be with passing the Data, but I cant figuring out what I did wrong. I really appreciate everyone trying to help me! Thank you very very much!!
1
0
722
1d
Private UIKit code causes a crash when the app moves to the background on iOS 26
After iOS 26 was released to the public and our build began rollout, we started seeing a strange crash affect users immediately after the app goes to the background. According to the symbolication provided in Xcode, this appears to be the result of a UICollectionView potentially related to the keyboard and a UIAlertController. I’m not sure how an error somewhere else can cause a crash in our app which does not use UIKit in the background. The feedback associated with this post is: FB20305833. I will attach a sample of the crash report in my next comment.
4
0
83
1d
PSA: UISceneDelegate.openURLContexts called twice sometimes in iOS 26
If you use UISceneDelegate's scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) to handle deep links (such as tapping a widget) you might run into an issue where this callback is called twice in the majority of cases. If you push a view controller in response to this, you might end up with two pushed view controllers, if you do not mitigate this. This is exclusively an issue in iOS 26.0 and works as expected on iOS 18. func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { /// Add any widget to the home screen that uses the widgetURL modifier and tap them. Most of the time, openURLContexts() will get called twice. /// If you run this project on iOS 18, it's *always* called once as expected. print("openURLContexts \(URLContexts)") } Filed as FB20301454
1
1
52
2d
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
86
2d
Approach Used To Create Song List As In Example
Hi, I am looking for guidance on how to create a scrollable song list, such as the attachment. The song list was originally created in C#, using an RTF object and populated by about 43 lines of song criteria. What similar approach would I use in Swift and MacOS? By the way, I currently play music that resides on the Mac, no external streaming is required or desired. Thanks, Jim
0
0
99
2d
Designed-for-iPad apps on macOS: Print sheet fails to appear
Summary: When running our iPad app on macOS (“Designed for iPad”), invoking UIPrintInteractionController intermittently fails to show a working print sheet. The same code works reliably on iPad or iOS devices and also on macOS pre 26. This regression started after updating to macOS Tahoe Version 26.0 (25A354) Steps to Reproduce: Launch the attached minimal sample on macOS (Designed for iPad). Tap “Print plain text” Expected Results: The print panel should appear and discover AirPrint printers reliably, as on iPad/iOS or previous mac versions. Actual Results: On macOS, the panel fails to appear. Mac version: macOS Tahoe 26.0 (25A354) xCode version: 26.0 (17A324) Sample Reproduction Code: struct ContentView: View { var body: some View { Button("Print plain text") { printPlainText() } .buttonStyle(.borderedProminent) .padding() } func printPlainText() { let text = "This is just a sample print" guard UIPrintInteractionController.isPrintingAvailable else { NSLog("Printing not available on this device") return } let info = UIPrintInfo(dictionary: nil) info.outputType = .general info.jobName = "Plain Text" let formatter = UISimpleTextPrintFormatter(text: text) formatter.perPageContentInsets = UIEdgeInsets(top: 36, left: 36, bottom: 36, right: 36) let ctrl = UIPrintInteractionController.shared ctrl.printInfo = info ctrl.printFormatter = formatter DispatchQueue.main.async { ctrl.present(animated: true) { _, completed, error in if let error { NSLog("Print error: \(error.localizedDescription)") } else { NSLog(completed ? "Print completed" : "Print cancelled") } } } } } Also I have added the following values to info.plist: <key>NSLocalNetworkUsageDescription</key> <string>This app needs local network access to discover AirPrint printers.</string> <key>NSBonjourServices</key> <array> <string>_ipp._tcp.</string> <string>_ipps._tcp.</string> <string>_printer._tcp.</string> </array>
0
0
82
2d
Default document-based app menu items missing icons
In a new document-based macOS app project created in Xcode, some of the default system-provided menu commands appear without their standard icons in the menu bar. Steps to Reproduce: 1. In Xcode, create a new macOS “Document App” project (using Swift/SwiftUI or AppKit template). 2. Build and run the project. 3. Open the app’s main menu bar and examine the default items such as New Document, Open…, Save, Duplicate, etc. Expected Results: System-provided menu items (e.g. Open…, Save, Duplicate) should display their standard SF Symbol–based icons automatically, as they do in TextEdit and other system apps. Actual Results: Some of these menu items display only text, with no icon namely: Services Open Recent Revert To Share This happens even though the items are the system-managed defaults generated by the document-based app template. Notes: • No code modifications were made — this occurs in a fresh, unedited template project. • Behavior seen on macOS 26.0 (25A354). • Xcode Version 26.0 (17A324) used.
1
0
93
2d
SwiftData ModelCoders.swift:1069 Unable to decode
Hello Developer Support, I have the following code and the following crash. How can the swift data model unable to decode and yet able to display the decoded value at the same time?! What's missing here? CODE: @Model final class DisplayCache { init(point: MKMapPoint) { self.point = point } var point: MKMapPoint } CRASH SwiftData/ModelCoders.swift:1069: Fatal error: Unable to decode this value MKMapPoint(x: 74358466.66307731, y: 97927933.41833577)
3
1
72
2d
NSWindow.titlebarAppearsTransparent only works after collapsing and expanding sidebar
I'm using the simplified code below to create a window with 4 split view items, some of them collapsed. I would expect the title bar to be transparent since I'm using window.titlebarAppearsTransparent = true, but it seems that this particular view configuration causes the title bar to be visible until I collapse and expand the sidebar again. Removing any of the split view items, uncollapsing any of them, or changing the view of any of the view controllers, causes the title bar to be consistently visible or hidden, although I don't understand the logic, since I'm telling the window that it should be transparent. When launching the app in light mode, it's more difficult to notice the issue since the title bar background is equal to the content background and only the separator is visible (even though the code sets window.titlebarSeparatorStyle = .none): After collapsing and expanding the sidebar, the separator is gone: In dark mode the title bar is more visible: After collapsing and expanding the sidebar, the title bar background and separator are gone: I created FB20306872. @main class AppDelegate: NSObject, NSApplicationDelegate, NSToolbarDelegate { var splitViewController: NSSplitViewController! func applicationDidFinishLaunching(_ aNotification: Notification) { let splitViewItem1 = NSSplitViewItem(sidebarWithViewController: ViewController1()) let splitViewItem2 = NSSplitViewItem(viewController: ViewController2()) let splitViewItem3 = NSSplitViewItem(viewController: NSViewController()) splitViewItem3.isCollapsed = true let splitViewItem4 = NSSplitViewItem(viewController: NSViewController()) splitViewItem4.isCollapsed = true splitViewController = NSSplitViewController() splitViewController.splitViewItems = [splitViewItem1, splitViewItem2, splitViewItem3, splitViewItem4] let window = NSWindow(contentViewController: splitViewController) window.styleMask = [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView] window.titlebarAppearsTransparent = true let toolbar = NSToolbar(identifier: "") toolbar.delegate = self toolbar.displayMode = .iconOnly window.toolbar = toolbar window.titlebarSeparatorStyle = .none window.makeKeyAndOrderFront(nil) } func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { return [.space, .flexibleSpace, .sidebarTrackingSeparator, .init("item")] } func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { return [.init("item"), .sidebarTrackingSeparator] } func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? { switch itemIdentifier.rawValue { case "item": let item = NSToolbarItem(itemIdentifier: itemIdentifier) item.image = NSImage(systemSymbolName: "sidebar.leading", accessibilityDescription: nil) item.action = #selector(toggleSidebar(_:)) item.target = self return item default: return nil } } @objc func toggleSidebar(_ sender: Any?) { splitViewController.splitViewItems[0].animator().isCollapsed = !splitViewController.splitViewItems[0].isCollapsed } } class ViewController1: NSViewController { override func loadView() { view = NSView(frame: CGRect(x: 0, y: 0, width: 300, height: 200)) } } class ViewController2: NSViewController { override func loadView() { let textView = NSTextView() let scrollView = NSScrollView(frame: CGRect(x: 0, y: 0, width: 400, height: 200)) scrollView.hasVerticalScroller = true scrollView.documentView = textView view = scrollView } }
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
31
2d
Mac Catalyst: Toolbar still appears below title bar, leaving empty safe area
Hi everyone, I’m testing my Catalyst SwiftUI project on iOS 26 / iPadOS 26 / macOS 26. I started with a NavigationSplitView (triple-column) inside a WindowGroup. On iPad it looks great: the toolbar items merge into the navigation bar, with the three traffic lights. But on Mac Catalyst, the app always reserves a blank safe area below the traffic lights, and places the toolbar on a separate line beneath the title bar. That leaves wasted vertical space I don’t want. What I expect (based on Apple’s WWDC session “Elevate the design of your iPad app”): The toolbar should merge into the title bar with the traffic lights, no separate row. Content should extend into the full height of the window. What I get on Mac Catalyst: Title bar + traffic lights at the top. Then a completely separate toolbar row below it. Safe area inset prevents my content from reaching the top of the window. What I’ve tried: .toolbarRole(.automatic), .editor, .browser → no effect. Hiding the title bar via titlebar?.titleVisibility = .hidden → removes the text but not the toolbar gap. Clearing titlebar?.toolbar → no difference. So far, I can’t find any way to get Catalyst to integrate toolbars into the window chrome the way native SwiftUI on macOS does. Is this a known limitation of Mac Catalyst, or is there a supported way to achieve the same “inline toolbar with window controls” layout? Switching to a Mac app vs. Catalyst fixes the issue, but I would have a lot more work to do to get the app ready for release, not ideal since it works near perfect on iPad. Thanks!
0
1
52
2d
Using Glass in SwiftUI Crashes with Missing Weak Symbol
My Xcode project fails to run with the following crash log any time I use a new SwiftUI symbol such as ConcentricRectangle or .glassEffect. I've tried using the legacy linker to no avail. It compiles perfectly fine, and I've tried targeting just macOS 26 also to no avail. This is a macOS project that's compiled just fine for years and compiles and runs on macOS going back to 13.0. Failed to look up symbolic reference at 0x118e743cd - offset 1916987 - symbol symbolic _____y_____y_____y_____yAAyAAy_____y__________G_____G_____yAFGGSg_ACyAAy_____y_____SSG_____y_____SgGG______tGSgACyAAyAAy_____ATG_____G_AVtGSgtGGAQySbGG______Qo_ 7SwiftUI4ViewPAAE11glassEffect_2inQrAA5GlassV_qd__tAA5ShapeRd__lFQO AA15ModifiedContentV AA6VStackV AA05TupleC0V AA01_hC0V AA9RectangleV AA5ColorV AA12_FrameLayoutV AA24_BackgroundStyleModifierV AA6IDViewV 8[ ]012EditorTabBarC0V AA022_EnvironmentKeyWritingS0V A_0W0C AA7DividerV A_0w4JumpyC0V AA08_PaddingP0V AA07DefaultgeH0V in /Users/[ ]/Library/Developer/Xcode/DerivedData/[ ]-grfjhgtlsyiobueapymobkzvfytq/Build/Products/Debug/[ ]/Contents/MacOS/[ ].debug.dylib - pointer at 0x119048408 is likely a reference to a missing weak symbol Example crashing code: import SwiftUI struct MyView: View { var body: some View { if #available(macOS 26.0, *) { Text("what the heck man").glassEffect() } } }
5
0
218
2d
App Clips don't work
We're building a UGC AR app and are leveraging App Clips to distribute AR experiences without app download. Since earlier this week, many of our users are reporting sharing experiences as App Clip doesn't work anymore. They are getting the message "AppClip unavailable" on a little card. We attached a QR code to try it yourself and a link to a different experience. We tried with multiple experiences and on multiple devices already. https://scenery.app/experience/1C925FDE-E49A-489B-BA14-58A4E532E645 Interestingly, we can't pinpoint the issue to an exact device or OS. We tested on many devices and on most, the AppClip is being displayed as unavailable, stating "App Clip unavailable", whereas it works on a few. It all worked fine last week (before September 12th). iPhone 13 Pro Max, iOS26: works iPhone SE, iOS 17: works iPhone 16 Pro, iOS 26: doesn't work iPhone 12 Pro Max, iOS 26: doesn't work iPhone 12 mini, iOS 18: does not work iPad 9th gen, iOS 26: doesn't work Please help. Our users are very dissatisfied as they expect this to work and it's a crucial feature. We already filed a radar via Feedback assistant: FB20303890
2
0
59
2d
iOS 26 RC: Scope buttons never appear for integrated UISearchBar
When trying to use a UISearchController setup with a UISearchBar that has scope buttons, the search controller's scopeBarActivation property is set to .onSearchActivation, the navigation item's preferredSearchBarPlacement property is set to .integrated. or .integratedButton, and the search bar/button appears in the navigation bar, then the scope buttons never appear. But space is made for where they should appear. Some relevant code in a UIViewController shown as the root view controller of a UINavigationController: private func setupSearch() { let sc = UISearchController(searchResultsController: UIViewController()) sc.delegate = self sc.obscuresBackgroundDuringPresentation = true // Setup search bar with scope buttons let bar = sc.searchBar bar.scopeButtonTitles = [ "One", "Two", "Three", "Four" ] bar.selectedScopeButtonIndex = 0 bar.delegate = self // Apply the search controller to the nav bar navigationItem.searchController = sc // BUG - Under iOS/iPadOS 26 RC, using .onSearchActivation results in the scope buttons never appearing at all // when using integrated placement in the nav bar. // Ensure the scope buttons appear immediately upon activating the search controller sc.scopeBarActivation = .onSearchActivation // This works but doesn't show the scope buttons until the user starts typing - that's too late for my needs //sc.scopeBarActivation = .automatic if #available(iOS 26.0, *) { // Under iOS 26 put the search icon in the nav bar - same issue for .integrated and .integratedButton navigationItem.preferredSearchBarPlacement = .integrated // .integratedButton // My toolbar is full so I need the search in the navigation bar navigationItem.searchBarPlacementAllowsToolbarIntegration = false // Ensure it's in the nav bar } else { // Under iOS 18 put the search bar in the nav bar below the title navigationItem.preferredSearchBarPlacement = .stacked } } I need the search bar in the navigation bar since the toolbar is full. And I need the scope buttons to appear immediately upon search activation. This problem happens on any real or simulated iPhone or iPad running iOS/iPadOS 26 RC.
1
1
105
2d
iOS 26 RC: Scope button in stacked UISearchBar block touches
This is really odd. If you setup a UISearchController with a preferredSearchBarPlacement of .stacked and you setup the search bar with scope buttons, then when the view controller is initially displayed, the currently hidden scope buttons block touch events from reaching the main view just below the search bar. But once the search is activated and dismissed, then the freshly hidden scope buttons no longer cause an issue. This is easily demonstrated by putting a UITableViewController in a UINavigationController. Setup the table view to show a few simple rows. Then setup a search controller using the following code: func setupSearch() { // Setup a stacked search bar with scope buttons // Before the search is ever activated, the hidden scope buttons block any touches in the main view controller // in the area just below the search bar. // Once the search is activated and dismissed, the problem goes away. It seems that displaying and hiding the // scope buttons at least once fixes the issue that exists beforehand. // This issue only exists in iOS/iPadOS 26, not iOS/iPadOS 18 or earlier. let search = UISearchController(searchResultsController: UIViewController()) search.hidesNavigationBarDuringPresentation = true search.obscuresBackgroundDuringPresentation = true search.scopeBarActivation = .onSearchActivation // Ensure button appear immediately let searchBar = search.searchBar searchBar.scopeButtonTitles = [ "One", "Two", "Three" ] self.navigationItem.searchController = search self.navigationItem.hidesSearchBarWhenScrolling = false // Issue appears even if this is true self.navigationItem.preferredSearchBarPlacement = .stacked } When first shown, before any attempt is made to activate the search, any attempt to tap on the upper 2/3 of the first row in the table view (which is just below the search bar) fails. If you tap on the lower 1/3 of the first row it works fine. If you then activate the search (now the scope buttons appear) and then dismiss the search (now the scope buttons are hidden again), then there is no issue tapping anywhere on the first row of the table. But if you restart the app, the problem starts over again. This problem happens on any iPhone or iPad, real or simulated, running iOS/iPadOS 26 RC. This is a regression from iOS 18 or earlier.
1
1
104
2d