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 beta: infinite loop in UISplitViewController logging
In the Console, when presenting my view in a horizontally compact environment, I see: UINavigationController for collapsing UISplitViewController about to push view controller <UINavigationController: 0x107933c00> This message repeats infinitely, until the Xcode debugger eventually says: QUARANTINED DUE TO HIGH LOGGING VOLUME Of note is that this only occurs in the beta, does not occur when using the iOS 18.x SDK, and only occurs in a compact environment. EDIT: This occurs only when setting the secondary column of a doubleColumn UISplitViewController: splitVC.setViewController(secondary, for: .secondary) EDIT 2 and WORKAROUND: If this action is deferred until after viewDidAppear, it self-resolves: public override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if let deferredSecondaryViewController { splitVC.showDetailViewController(deferredSecondaryViewController, sender: nil) } }
Topic: UI Frameworks SubTopic: UIKit
0
0
125
1w
UIRequiresFullScreen in iPadOS 26
Our app includes the UIRequiresFullScreen plist key, but the iPadOS 26 betas seem to ignore this. The window handle is still displayed, and while the window aspect ratio seems to be constrained, you can still adjust it and arrange it alongside other apps. We do not want to support windowing or multi-tasking, and the WWDC sessions indicated there would be a way to opt out of the new windowing system. Has UIRequiresFullScreen been silently deprecated, or are we missing something in our implementation?
5
0
210
1w
SwiftUI .toolbar(.keyboard) Not Showing on First Appearance in fullScreenCover (iOS 18)
I’m encountering an issue in iOS 18.5 (and most probably across all iOS 18 versions) where the keyboard toolbar defined with .toolbar(.keyboard) does not appear immediately when a TextField becomes first responder inside a fullScreenCover. Here’s a minimal reproducible example: import SwiftUI struct ContentView: View { @State private var text: String = "" @State private var showSheet: Bool = false var body: some View { NavigationStack { Button("Show Sheet") { showSheet.toggle() } .fullScreenCover(isPresented: $showSheet) { NavigationStack { VStack { Button("Dismiss") { showSheet.toggle() } TextField("Enter text", text: .constant("Hello")) .autocorrectionDisabled() .textInputAutocapitalization(.never) } .padding() .toolbar { ToolbarItemGroup(placement: .keyboard) { toolBar } } } } } } private var toolBar: some View { HStack { Spacer() Button("Done") { UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) } } } } ✅ Expected Behavior: When the TextField becomes active and the keyboard appears, the custom keyboard toolbar with a “Done” button should also appear immediately. ❌ Actual Behavior: On first presentation of the sheet and focusing the TextField, the toolbar is missing. If I background the app and return, the toolbar appears as expected. Dismissing and re-opening the sheet leads to the same issue (toolbar missing again).
Topic: UI Frameworks SubTopic: SwiftUI
2
0
68
1w
Different toolbar item placement for iPhone vs iPad
On iPhone, I would like to have a more button at the top right of the navigation bar, a search field in the bottom toolbar, and a plus button to the right of the search field. I've achieved this via the code below. But on iPad they should be in the navigation bar at the trailing edge from left to right: plus, more, search field. Just like the Shortcuts app, if there's not enough horizontal space, the search field should collapse into a button, and with even smaller space the search bar should become full-width under the navigation bar. Right now on iPad the search bar is full width under the navigation bar, more at top right, plus at bottom middle, no matter how big the window is. How can I achieve that? Any way to specify them for the system to more automatically do the right thing, or would I need to check specifically for iPhone vs iPad UIDevice to change the code? struct ContentView: View { @State private var searchText = "" var body: some View { NavigationStack { VStack { Text("Hello, world!") } .navigationTitle("Test App") .searchable(text: $searchText) .toolbar { ToolbarItem { Menu { //... } label: { Label("More", systemImage: "ellipsis") } } DefaultToolbarItem(kind: .search, placement: .bottomBar) ToolbarSpacer(.fixed, placement: .bottomBar) ToolbarItem(placement: .bottomBar) { Button { print("Add tapped") } label: { Label("Add", systemImage: "plus") } } } } } }
2
0
61
1w
How to hide scroll edge effect until scroll down
I present a view in a sheet that consists of a navigation stack and a scroll view which has a photo pushed to the top by setting .ignoresSafeArea(edges: .top). The problem is the top of the photo is blurry due to the scroll edge effect. I would like to hide the scroll edge effect so the photo is fully visible when scrolled to the top but let the effect become visible upon scrolling down. Is that possible? struct ContentView: View { @State private var showingSheet = false var body: some View { VStack { Button("Present Sheet") { showingSheet = true } } .sheet(isPresented: $showingSheet) { SheetView() } } } struct SheetView: View { @Environment(\.dismiss) private var dismiss var body: some View { NavigationStack { ScrollView { VStack { Image("Photo") .resizable() .scaledToFill() } } .ignoresSafeArea(edges: .top) .toolbar { ToolbarItem(placement: .cancellationAction) { Button(role: .close) { dismiss() } } ToolbarItem { EditButton() } } } } }
1
0
68
1w
UISearchBar .minimal no background when compiled on Xcode 26
When compiled on Xcode 16.4.0: When compiled on Xcode 26: The code: import SwiftUI struct SearchBarController: UIViewRepresentable { @Binding var text: String var placeholderText: String class Coordinator: NSObject, UISearchBarDelegate { @Binding var text: String init(text: Binding<String>) { _text = text } func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { text = searchText } } func makeUIView(context: Context) -> UISearchBar { let searchBar = UISearchBar(frame: .zero) searchBar.delegate = context.coordinator searchBar.placeholder = placeholderText searchBar.searchBarStyle = .minimal return searchBar } func updateUIView(_ uiView: UISearchBar, context: Context) { uiView.text = text } func makeCoordinator() -> SearchBarController.Coordinator { return Coordinator(text: $text) } }
2
0
53
1w
UIVisualEffectView using UIGlassEffect does not follow layer.cornerRadius values
Starting on iOS 26 Beta 3, any UIVisualEffectView using a UIGlassEffect will have a default corner radius that cannot be modified by using UIVisualEffectView's layer.cornerRadius. This was working on Beta 1 and Beta 2. On WWDC25 "Build a UIKit app with the new design", a UIVisualEffectView property called cornerConfiguration is used as example for changing the effect's corner radius, but this property does not seem to be available on any of the beta versions. Is there any other way to update the UIGlassEffect corner radius on UIKit?
Topic: UI Frameworks SubTopic: UIKit Tags:
2
1
114
1w
Liquid glass: UIPageViewController inside UITabbarController adding blur effect always in iOS26
When using UIPageViewController inside a UITabBarController on iOS 26 with Liquid Glass adoption, visiting the PageViewController tab applies a blur effect to the navigation bar and tab bar even though the current child view controller of the pageView is not scrollable and does not reach behind these bars. Questions: Is this the expected behavior that the pageview's internal scroll view causes the bars to blur regardless of the page view's child content’s scrollability? If so, is there an official way to make the blur effect appear only when the pageview's current child view controller actually scrolls behind the navigation bar or tab bar, and not in static cases? Tried the same in SwiftUI using TabView and TabView with page style. Facing the same issue there as well. Sample screenshots for reference, Sample SwiftUI code, struct TabContentView: View { var body: some View { TabView { // First Tab: Paging View PagingView() .tabItem { Label("Pages", systemImage: "square.fill.on.square.fill") } // Second Tab: Normal View NavigationStack { ListView() } .tabItem { Label("Second", systemImage: "star.fill") } // Third Tab: Normal View PageView(color: .blue, text: "Page 3") .tabItem { Label("Third", systemImage: "gearshape.fill") } } .ignoresSafeArea() } } struct PagingView: View { var body: some View { TabView { PageView(color: .red, text: "Page 1") PageView(color: .green, text: "Page 2") PageView(color: .blue, text: "Page 3") } .tabViewStyle(.page) // Enables swipe paging .indexViewStyle(.page(backgroundDisplayMode: .always)) .ignoresSafeArea()// Dots indicator } }
1
0
120
1w
Clarification on Using Secure UITextField to Prevent Screen Capture
Hello Developer Forums Team, I’ve seen that some banking apps prevent screenshots on certain sensitive screens. I’m working on a similar feature in my SDK and want to confirm if my implementation complies with App Store guidelines. Since there’s no public API to block screenshots, I’m using a workaround based on the secure rendering behavior of UITextField (isSecureTextEntry = true). I embed my custom content (e.g., a UITableView) inside the internal secure container of a UITextField, which results in blank content being captured during screenshots—similar to what some banking apps do. Approach Summary I create a UITextField I detect its internal secure container by matching UIKit internal class names as strings I embed my real UI content into that container I do not use or call any private APIs, just match view class names via strings. ScreenshotPreventingView.swift final class ScreenshotPreventingView: UIView { private let textField = UITextField() private let recognizer = HiddenContainerRecognizer() private var contentView: UIView? public var preventScreenCapture = true { didSet { textField.isSecureTextEntry = preventScreenCapture } } public init(contentView: UIView? = nil) { super.init(frame: .zero) self.contentView = contentView setupUI() } private func setupUI() { guard let container = try? recognizer.getHiddenContainer(from: textField) else { return } addSubview(container) NSLayoutConstraint.activate([ container.topAnchor.constraint(equalTo: topAnchor), container.bottomAnchor.constraint(equalTo: bottomAnchor), container.leadingAnchor.constraint(equalTo: leadingAnchor), container.trailingAnchor.constraint(equalTo: trailingAnchor) ]) if let contentView = contentView { setup(contentView: contentView, in: container) } DispatchQueue.main.async { self.preventScreenCapture = true } } private func setup(contentView: UIView) { self.contentView?.removeFromSuperview() self.contentView = contentView guard let container = hiddenContentContainer else { return } container.addSubview(contentView) container.isUserInteractionEnabled = isUserInteractionEnabled contentView.translatesAutoresizingMaskIntoConstraints = false let bottomConstraint = contentView.bottomAnchor.constraint(equalTo: container.bottomAnchor) bottomConstraint.priority = .required - 1 NSLayoutConstraint.activate([ contentView.leadingAnchor.constraint(equalTo: container.leadingAnchor), contentView.trailingAnchor.constraint(equalTo: container.trailingAnchor), contentView.topAnchor.constraint(equalTo: container.topAnchor), bottomConstraint ]) } } HiddenContainerRecognizer.swift struct HiddenContainerRecognizer { private enum Error: Swift.Error { case unsupportedOSVersion(version: Float) case desiredContainerNotFound(_ containerName: String) } func getHiddenContainer(from view: UIView) throws -> UIView { let containerName = try getHiddenContainerTypeInStringRepresentation() let containers = view.subviews.filter { subview in type(of: subview).description() == containerName } guard let container = containers.first else { throw Error.desiredContainerNotFound(containerName) } return container } private func getHiddenContainerTypeInStringRepresentation() throws -> String { if #available(iOS 15, *) { return "_UITextLayoutCanvasView" } if #available(iOS 14, *) { return "_UITextFieldCanvasView" } if #available(iOS 13, *) { return "_UITextFieldCanvasView" } if #available(iOS 12, *) { return "_UITextFieldContentView" } let currentIOSVersion = (UIDevice.current.systemVersion as NSString).floatValue throw Error.unsupportedOSVersion(version: currentIOSVersion) } } How I use it in my Screen let container = ScreenshotPreventingView() override func viewDidLoad() { super.viewDidLoad() container.preventScreenCapture = true container.setup(contentView: viewContainer) //viewContainer is UIView in storyboard, in which all other UI elements are placed in e.g. UITableView self.view.addSubview(container) container.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ container.topAnchor.constraint(equalTo: self.view.topAnchor), container.bottomAnchor.constraint(equalTo: self.view.bottomAnchor), container.leadingAnchor.constraint(equalTo: self.view.leadingAnchor), container.trailingAnchor.constraint(equalTo: self.view.trailingAnchor) ]) } What I’d Like to Confirm Is this approach acceptable for App Store submission? Is there a more Apple-recommended approach to prevent screen capture of arbitrary UI? Thank you for your help in ensuring compliance.
1
0
83
1w
Xcode 26 Beta 3 Crash on iOS 18 Simulators - NSInvalidUnarchiveOperationException (ToolbarVisualProvider8RootView missing)
Hi, I’m seeing a crash when running my app on iOS 18 simulators or devices using Xcode 26 beta 3. My app’s minimum deployment target is iOS 17, and the crash does not happen when running from Xcode 16.4. The crash occurs specifically at this line: return UIStoryboard(name: storyboard.rawValue, bundle: nil) .instantiateViewController(withIdentifier: view.rawValue) Crash Details: ** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named _TtGC5UIKit17UICoreHostingViewVCS_21ToolbarVisualProvider8RootView_ because no class named _TtGC5UIKit17UICoreHostingViewVCS_21ToolbarVisualProvider8RootView_ was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)' *** First throw call stack: (0x191c3321c 0x18f0cdabc 0x191c91ea0 0x19d740774 0x19d740a18 0x19d740cac 0x194626680 0x194dbc784 0x19d740890 0x19d740cac 0x1949aadd8 0x19d740890 0x19d740a18 0x19d740cac 0x194802e24 0x1945f008c 0x194ed1808 0x107a8bfa0 0x107a8c05c 0x1945ec128 0x19d740890 0x19d740cac 0x1945eba60 0x19d740890 0x19d740a18 0x19d740cac 0x1945f07dc 0x1945eaea4 0x19492ee80 0x10763de00 0x1076e56fc 0x1076e5674 0x1076e5e04 0x19496108c 0x194f9b9a0 0x1949072c4 0x194f998cc 0x194f9af04 0x19445139c 0x19445ac28 0x194467508 0x1079afaec 0x1079aff5c 0x1944189a0 0x194417be4 0x1944114e4 0x194411404 0x194410ab4 0x19440c1e4 0x191b28a8c 0x191b288a4 0x191b28700 0x191b29080 0x191b2ac3c 0x1ded09454 0x19453d274 0x194508a28 0x1073564f4 0x1b89fff08) terminating due to uncaught exception of type NSException The crash occurs immediately at app launch, when attempting to load a storyboard-based UITabBarController. Works as expected on: Xcode 16.4 + iOS 18 (simulator/device) Xcode 26 beta 3 + iOS 26 (simulator/device) Running from Xcode 26 beta 3 onto iOS 18 simulators or devices and it immediate crash from the particular storyboard Setup: Xcode: 26 beta 3 macOS: 15.5 iOS Simulators: iOS 18.5 Minimum deployment target: iOS 17 UIKit-based app (not using SwiftUI) No custom toolbars or host views in use explicitly Is this a known compatibility issue when building with the iOS 26 SDK and running on iOS 18? Are there any workarounds or recommendations for running apps targeting iOS 17+ on iOS 18 simulators when using Xcode 26?
Topic: UI Frameworks SubTopic: UIKit Tags:
4
2
235
1w
fullscreencover Problem
Hello Apple Developer Community: I have a problem with the fullscreencover. I can see the Things, that shouldn’t be visible behind it. I’m currently developing with iOS 26 and only there it happens. I hope you can help me :) Have a nice day
1
3
51
1w
How to update action extension icon for iOS 26
iOS 26 seems to have changed the way action extension icons appear in the share sheet. My icon is too small now compared to the Copy button in Safari (and Shortcuts’ icons are too small too, a bug?). How do you update it, and how do you ensure it looks fine in iOS 18 and earlier? My current icon is an AppIcon in the asset catalog, single size 1024x1024, with about 130px padding around it.
0
0
68
1w
Looking for a mechanism in iPadOS 26 to 'split a window' into two adjacent windows like it worked in iPadOS 18.
With the new multi-windowing design in iPadOS 26, the behavior of openWindow() has changed. In iPadOS 18, if I called openWindow(), I would go from a full-screen window to two side-by-side windows. That allowed my app to meet the goal of the user; keep some information on the screen while being able to navigate through the app in the other window. In iPadOS 26 (beta 3), this no longer works. Instead, a new Window opens ON top of the current window. I am looking for some mechanism to help the user see that two windows are now present and then easily move them on the screen (tiled, side-by-side) or whatever else they would prefer.
1
1
51
1w
Custom view controller transitions breaks liquid glass morphs
I'm using UIViewControllerAnimatedTransitioning to customize my view controllers transitions. When I push a viewcontroller on my navigation stack I need to have a fade in/out instead of the standard right-to-left transition. But having this code appears to break the liquid glass nav-bar buttons morphing from one screen to another. Is there a way to keep these nice morphing and still have the a custom view controller transitions?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
44
1w
Cannot get drop action to trigger (Xcode 26 beta 3)
I'm unable to find the right combination modifiers to get drag and drop to work using the new .draggable(containerItemID:) and dragContainer(for:in:selection:_:) modifiers. The drag is initiated with the item's ID, the item is requested from the .dragContainer modifier, but the drop closure is never triggered. Minimal repro: struct Item: Identifiable, Codable, Transferable { var id = UUID() var value: String static var transferRepresentation: some TransferRepresentation { CodableRepresentation(contentType: .tab) } } struct DragDrop: View { @State var items: [Item] = [ Item(value: "Hello"), Item(value: "world"), Item(value: "something"), Item(value: "else") ] var body: some View { List(items) { item in HStack { Text(item.value) Spacer() } .contentShape(Rectangle()) .draggable(containerItemID: item.id) .dropDestination(for: Item.self) { items, session in print("Drop: \(items)") } } .dragContainer(for: Item.self) { itemID in print("Drag: \(itemID)") return items.filter { itemID == $0.id } } } } #Preview("Simple") { DragDrop() }
4
0
67
1w
How to scale a SwiftUI view to fit its parent
Code that reproduces the issue import SwiftUI @main struct KeyboardLayoutProblemApp: App { var body: some Scene { WindowGroup { iOSTabView() } } } struct iOSTabView: View { var body: some View { TabView { GameView() .frame(maxWidth: UIScreen.main.bounds.width, maxHeight: UIScreen.main.bounds.height) .tabItem { Label("Play", systemImage: "gamecontroller.fill") } } } } struct GameView: View { var body: some View { VStack { Text("Play") Spacer() KeyboardView() } .padding() } } struct KeyboardView: View { let firstRowLetters = "qwertyuiop".map { $0 } let secondRowLetters = "asdfghjkl".map { $0 } let thirdRowLetters = "zxcvbnm".map { $0 } var body: some View { VStack { HStack { ForEach(firstRowLetters, id: \.self) { LetterKeyView(character: $0) } } HStack { ForEach(secondRowLetters, id: \.self) { LetterKeyView(character: $0) } } HStack { ForEach(thirdRowLetters, id: \.self) { LetterKeyView(character: $0) } } } .padding() } } struct LetterKeyView: View { let character: Character var width: CGFloat { height*0.8 } @ScaledMetric(relativeTo: .title3) private var height = 35 var body: some View { Button { print("\(character) pressed") } label: { Text(String(character).capitalized) .font(.title3) .frame(width: self.width, height: self.height) .background { RoundedRectangle(cornerRadius: min(width, height)/4, style: .continuous) .stroke(.gray) } } .buttonStyle(PlainButtonStyle()) } } Problem GameView doesn't fit its parent view: Question How do I make GameView be at most as big as its parent view? What I've tried and didn't work GameView() .frame(maxWidth: .infinity, maxHeight: .infinity) GeometryReader { geometry in GameView() .frame(maxWidth: geometry.size.width, maxHeight: geometry.size.height) } GameView() .clipped() GameView() .layoutPriority(1) GameView() .scaledToFit() GameView() .minimumScaleFactor(0.01) GameView() .scaledToFill() .minimumScaleFactor(0.5) I'm not using UIScreen.main.bounds.width because I'm trying to build a multi-platform app.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
52
1w
Webkit dynamic linking failing on iPadOS 26 beta 3
I am using XCODE-BETA (Version 26.0 beta (17A5241e)) on a Mac (running Sequoia 15.5) to develop an app using FoundationModel. I am testing on an iPad (iPad Pro 11 in, 2nd Gen, running iPadOS 26 Beta 3). My app works fine when I run it in the simulator (iPad 26.0). So I upgraded my iPad Pro to iPadOS 26 beta 3 to try it on a real device. When I run it on the device, I get an error about symbols not found. [See details below] Any idea what I need to change in my development configuration to allow me to run/test my app on a real device running iPadOS 26 beta 3? Thanks in advance, Charlie dyld[1132]: Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib Expected in: /System/Library/Frameworks/WebKit.framework/WebKit Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib Expected in: /System/Library/Frameworks/WebKit.framework/WebKit dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib Expected in: /System/Library/Frameworks/WebKit.framework/WebKit dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib
1
0
88
1w