Construct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.

UIKit Documentation

Posts under UIKit subtopic

Post

Replies

Boosts

Views

Activity

Old style tab bar
I am maintaining an enterprise iOS app that does a lot of customization to the tab bar's colors based on the organization signed into the app. Is there a way to revert back to the old style full bottom tab bar rather than the new iOS 26 floating version? I know last year in iPad OS you could force the bottom tab using traitOverrides, but I'm not seeing a similar option for this. If anyone has any ideas it would be greatly appreciated.
Topic: UI Frameworks SubTopic: UIKit Tags:
4
1
137
Jun ’25
Xcode 26 - Crashing Loading Custom TabBarViewController
When I build my app for iPad OS, either 26, or 18.5, as well as iOS on 16.5 from Xcode 26 with UIDesignRequiresCompatibility enabled my app is crashing as it loads the main UIViewController, a subclassed UITabBarController which is being loaded programatically from a Storyboard from another SplashScreen ViewController. On i(Pad)OS 18.5 I get this error: Thread 1: "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)" On iPadOS 26 I get this error: UIKitCore/UICoreHostingView.swift:54: Fatal error: init(coder:) has not been implemented There is no issue building from Xcode 16.4, regardless of targeted i(Pad)OS.
7
8
601
Jun ’25
Xcode 26 beta: 'Building the menu bar using a storyboard is no longer supported for iOS and Mac Catalyst apps. Please migrate to the UIMenuBuilder or Commands APIs.'
Support for menus in Storyboards is yanked without ever being deprecated (to my knowledge)? Really? WTF? This is a major step backwards, Apple. So nice to have to spend a month rewriting my app after WWDC each year. Re-creating a complex menu hierarchy in code is exactly what I wanted to do. Ugh.
4
1
140
Jun ’25
How to access clear Liquid Glass Effect?
On WWDC25 session "Meet Liquid Glass", two Liquid Glass variants are mentioned: "regular" and "clear". "Regular" seems to be the default setting for UIGlassEffect, but I was not able to find an option for clear. Is there a native element that uses clear? Is it coming to later betas for iOS 26?
7
11
412
Jun ’25
iOS 26 beta - Crash using QLPreviewController (QuickLook) in simulator.
Using the iOS 26 beta simulator, I am experiencing a crash using the QLPreviewController. This is easily reproduced using a small sample app and a sample excel file in the bundle. It does work in prior Xcode 16.4 and simulators (18.5). I didn't find any mention of this in Xcode 26 or iOS 26 release notes but I could have missed something. I don't have a spare device to update to iOS 26 and try on a real device so it may just be a simulator issue? Any feedback would be helpful. Thanks. Error: QuickLook/QLHostRemoteViewModel.swift:37: Fatal error: No extensions could be found matching '_AppExtensionQuery(extensionPointIdentifier: "com.apple.quicklook.UIExtensionPoint", predicate: nil, hostAuditToken: nil, extensionPoint: nil, allowsDuplicates: true)' Sample view controller... import UIKit import QuickLook class ViewController: UIViewController, QLPreviewControllerDataSource { var excelFileURL: URL! override func viewDidLoad() { super.viewDidLoad() // Load the Excel file (example: from bundle) if let url = Bundle.main.url(forResource: "file_example_XLSX_100", withExtension: "xlsx") { excelFileURL = url presentPreviewController() } } func presentPreviewController() { let previewController = QLPreviewController() previewController.dataSource = self present(previewController, animated: true, completion: nil) } // MARK: - QLPreviewControllerDataSource func numberOfPreviewItems(in controller: QLPreviewController) -> Int { return 1 } func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { return excelFileURL as QLPreviewItem } }
3
3
416
Jun ’25
iPadOS 26: App Window Controls Overlap Navigation Bar Buttons - Seeking Opt-Out Option (iPad 11th Gen, Objective-C)
Hello Apple Developer Community, I'm developing an application for iPadOS 26 on an 11th generation iPad, using Objective-C. With the recent update to iPadOS 26, I've noticed a significant change in how app windows are presented. Specifically, the new minimize and close buttons, similar to those found on macOS, now appear in the top-left corner of app windows. The issue I'm encountering is that these newly introduced system buttons overlap with custom buttons I've programmatically added to the left side of my app's navigation bar. This overlap affects nearly all screens in my application, making some of my essential UI elements inaccessible or difficult to interact with. I'm looking for guidance on whether there's an official way to opt out of displaying these minimize and close buttons, or perhaps a method to adjust their position or visibility to prevent them from interfering with existing UI elements. My aim is to maintain the functionality and user experience of my application without having to redesign a substantial portion of its interface. Any insights or suggestions from the community would be greatly appreciated. Thank you in advance for your help!
3
0
165
Jun ’25
iPadOS26: UITabBar doesn't switch selected state
With iPadOS26, if I create a UITabBar, and use that to switch between views, the selected state never updates. I created this simple UIViewController to demonstrate the issue: class SimpleTabBarController: UIViewController, UITabBarDelegate { let tabBar = UITabBar() let redItem = UITabBarItem(title: "Red", image: nil, tag: 0) let blueItem = UITabBarItem(title: "Blue", image: nil, tag: 1) override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white tabBar.items = [redItem, blueItem] tabBar.selectedItem = redItem tabBar.delegate = self tabBar.translatesAutoresizingMaskIntoConstraints = false view.addSubview(tabBar) NSLayoutConstraint.activate([ tabBar.leadingAnchor.constraint(equalTo: view.leadingAnchor), tabBar.trailingAnchor.constraint(equalTo: view.trailingAnchor), tabBar.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor) ]) updateBackground(for: redItem) } func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { updateBackground(for: item) } private func updateBackground(for item: UITabBarItem) { switch item.tag { case 0: view.backgroundColor = .systemRed case 1: view.backgroundColor = .systemBlue default: view.backgroundColor = .white } } } The tabBar didSelect item method is called, and the background color gets updated as expected, but the selected state of the UITabBar stays the same. I files a feedback for a related issue: FB17841678
1
0
162
Jun ’25
Issue with Animations Blocking Taps in UIView Toasts (SwiftUI + Separate UIWindow)
Edit: Well this is embarassing. It looks like I didn't research this thoroughly enough, animations block UIVIew tap events. I found a solution by using DispatchQueue I ran into an unexpected issue when presenting a UIView-based toast inside a separate UIWindow in a SwiftUI app. Specifically, when animations are applied to the toast view (UIToastView), the tap gesture no longer works. To help identify the root cause, I created a minimal reproducible example (MRE) with under 500 lines of code, demonstrating the behavior: Demo GIF: Screen Recording Code Repo: ToastDemo What I Tried: Using a separate UIWindow to present the toast overlay. Adding a tap gesture directly to the UIView. Referencing related solutions: A Blog Post explaining UIWindow usage in SwiftUI - https://www.fivestars.blog/articles/swiftui-windows (Sorry, Apple Dev Forum will not allow a link to this) A Stack Overflow thread on handling touch events in multiple windows. Problem Summary: When animations are involved (fade in, slide up), taps on the toast are not recognized. Without animations, taps work as expected. UIWindow setup seems correct, so I’m wondering if animation effects are interfering with event propagation. I could potentially work around this by restructuring the touch handling, but I'd love insight from the community on why this happens, or if there’s a cleaner fix. Edit: Well this is embarassing. It looks like I didn't research this thoroughly enough, animations block UIVIew tap events. I found a solution by using DispatchQueue
2
0
60
Jun ’25
Question about `UITextField`'s `markedTextRange` when handling Korean input
I'm currently working on implementing a character limit for Korean text input using UITextField, but I've encountered two key issues. 1. How can I determine if Korean input is complete? I understand that markedTextRange represents provisional (composing) text during multistage text input systems (such as Korean, Japanese, Chinese). While testing with Korean input, I expected markedTextRange to reflect the composing state. However, it seems that markedTextRange remains nil throughout the composition process. 2. Problems limiting character count for Korean input I’ve tried two methods to enforce a character limit. Both lead to incorrect behavior due to how Korean characters are composed. Method 1 – Before replacement: func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { guard let text = textField.text else { return true } return text.count <= 5 } This checks the text length before applying the replacementString. The issue is that when the user enters a character that is meant to combine with the previous one to form a composed character, the input should result in a single, combined character. However, because the character limit check is based on the state before the replacement is applied, the second character does not get composed as expected. Method 2 – After change: textField.addTarget(self, action: #selector(editingChanged), for: .editingChanged) @objc private func editingChanged(_ sender: UITextField) { guard var text = sender.text else { return } if text.count > limitCount { text.removeLast() sender.text = text } } This removes the last character if the count exceeds the limit after the change. But when a user keeps typing past the limit, the last character is overwritten by new input. I suspect this happens because the .editingChanged event occurs before the multistage input is finalized, and the final composed character is applied after that event. My understanding of the input flow: Standard input: shouldChangeCharactersIn is called replacementString is applied .editingChanged is triggered With multistage input (Korean, etc.): shouldChangeCharactersIn is called replacementString is applied .editingChanged is triggered Final composed character is inserted (after all the above) Conclusion Because both approaches lead to incorrect character count behavior with Korean input, I believe I need a new strategy. Is there an officially recommended way to handle multistage input properly with UITextField in this context? Any advice or clarification would be greatly appreciated. MacOS 15.5(24F74) Xcode 16.4 (16F6)
2
0
81
Jun ’25
App displays wrong localized image
I have an image in the xcassets file which is localized for different languages. When setting App language to Traditional Chinese, it always displays the Simplified Chinese image. This happens on latest iOS 18.5 system, but not on a lower system version. The feedback assistant ID is FB17663546
0
0
40
Jun ’25
Avoid rotation in a UIViewController with two UIWindow app
Hi, I have an iPhone App with an UIWindowScene and two UIWindow's(mainWindow and alertWindow). In the mainWindow I have the whole app and it is allowed to rotate. The alertWindow is a window to show alert's to the user on the top of the screen and I do not want that the content inside rotate. I thought I may do: override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .portrait } And override var shouldAutorotate: Bool { return false } In the rootviewcontroller of alertWindow but after doing those changes the rootviewcontroller of mainWindow does not rotate until I do any navigation. I have thought to have two UIWindowScene's (one per UIWindow) but as far I know iPhone app only supports one UIWindowScene. So, how can I avoid rotation in the viewcontroller of alertWindow without losing the rotation on rootviewcontroller of mainWindow? My viewcontroller is a UIHostingController, so I tried also to avoid from my SwiftUI view but I did not find any solution neither. Thank you in advance
3
0
104
Jun ’25
Audio issue on iPhone 15 pro (iOS18.5)
I have an audio issue on iPhone 15 Pro (iOS18.5). After some steps, the new call will be on one-way audio status, but tap mute and unmute will back to normal. See the attached video and check the "yellow dot indicator" for the audio status. Video link: https://youtube.com/shorts/DqYIIIqtMKI?feature=share I have a similar issue on iOS15 and iOS16, and no issue on iOS17, but now I have this issue on iOS18 with dynamic island model devices. Please check. Thanks.
5
1
116
Jun ’25
Failed to open URL asynchronously
I have a problem with the URL schemes under iOS 18. Data is being sent from one app to another app. The amount of data varies. It can sometimes be more than 5 MB. With iOS 18, errors often occur when sending large amounts of data. The error message is: "Failed to open URL asynchronously". If I send the data once again in this case, it works. To reproduce the error quickly, I wrote two small apps. AppA sends data to AppB. AppB calls AppA and AppA sends data to AppB again. The whole thing runs in an endless loop. Code snippet: // AppA // The file to which fileUrl points contains a 4 MB string. // The string consists of only one letter “AAAAAA....” let dataStr = try String(contentsOf: fileUrl, encoding: .utf8) if let url = URL(string: "appb://receive?data=\(dataStr)") { UIApplication.shared.open(url, options: [:]) { (result) in if !result { os_log("can't open url", type: .error) } } } // AppB DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { if let returnUrl = URL(string: "appa://return") { UIApplication.shared.open(returnUrl) } } If the test is started, the error occurs approximately 15-20 times per hour. The first error occurs very quickly if the device is restarted prior to this. As soon as the error occurs, we end up in os_log(“can't open url”, type: .error) I know the possibility of exchanging the data via AppGroups, but cannot use it in our case. Tested with following devices: // The error occurs: iPhone 11 with iOS 18.4.1 iPhone SE with iOS 18.5 // The error does not occur iPhone 8 with iOS 16.7.10 iPhone 16 simulator on a M1 MacBook (macOS 15.4.1) Unfortunately, there is no other error message in the "Console" app. Except "Failed to open URL asynchronously". There were no problems at this point between iOS 12 and iOS 17. My question is now, are there new limitations to the URL schemes under iOS 18 or is it a bug?
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
120
Jun ’25
popover no longer anchoring
My old UIKit popovers are no longer anchoring to their sourceView and sourceRect. Started happening while testing on IPadOS 18.5 after updating to Xcode 16.4. Has anyone else had to fix this problem? Popovers now slide up from the bottom to the center of the screen.
Topic: UI Frameworks SubTopic: UIKit
1
0
41
Jun ’25
Conditionally Adding and Deleting a Row in a UITableView
Hello! I wanted to see if someone with more UIKit experience than me can help me out on guiding me in the right direction for conditionally adding and deleting a row in a UITableView. What I Want to Accomplish I have a tip slider with percentages (0% - 20%) with a custom option on the end. I'm wanting to, when the custom option is tapped, bring up a row immediately below there and have a UITextField. When another option, let's say 10%, is tapped, I want the text field row to go away. Can someone explain to me how this would work? And if so, provide an example? Thank you!
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
91
Jun ’25
FB16862332 (iOS 18.3 REGRESSION: UIDocumentViewController: Placeholder icon displayed instead of document icon in share menu item of document title menu)
Anyone else seeing this? I reported the regression back in March 2025 and have no reply from Apple. My apps are Obj-C, in case it matters. DESCRIPTION After updating to iOS 18.3.x, | noticed a regression in the title menu behavior of my UlDocumentViewController-based shipping apps on the App Store [1]: Instead of displaying the document icon supplied by the app, the share menu item displays a placeholder icon instead, and iconservicesagent error messages are emitted in the log stream [2]. STEPS TO REPRODUCE Install one of the apps from note [1] below. Launch the app, tap the document/title menu at top center of the screen, and observe first menu item. RESULTS Expected: App-provided document icon displayed to left of first menu item ("W-1" or "W68" document icon). Actual: Placeholder icon displayed. REGRESSION Occurs: iOS 18.3 (iPad) iOS 18.3.1 (iPhone) iOS 18.3.2 (iPhone) Does Not Occur: iOS 18.2,18.3 Simulator iOS 18.0-18.2? [| no longer have a device with < 18.3 to confirm regression point] NOTES: [1] WOZNIAC-1 <https://apps.apple.com/us/ app/wozniac-1/id6474085354> and WOZNIAC-68 <https://apps.apple.com/us/app/ wozniac-68/id6736677781>. [2] When the problem occurs, the following log messages are omitted: Error returned from iconservicesagent image request: <|STagIcon: 0x30299c040> Tag: alvm, Class: public.filename-extension, Base type: public.item - <|SImageDescriptor: Ox300dd5860> - (37.00, 48.00)@3x v:40000 1:5 a: 0:0:0:0 t:() b:0 s:2 ps:0 digest: 0D3223D0-9AЕ3-3B19-A081-ACACE55691B7 error: Error Domain=NSOSStatusErrorDomain Code=-609 "Client is disallowed from making such an icon request" UserInfo={NSLocalizedDescription=Client is disallowed from making such an icon request}
Topic: UI Frameworks SubTopic: UIKit
3
1
105
Jun ’25
NSTextLists not rendered when NSTextContentStorageDelegate textContentStorage (_:, textParagraphWith:) is implemented
I have a UITextView that contains paragraphs with text bullet lists (via NSTextList). I also implement NSTextContentStorageDelegate.textContentStorage(_:, textParagraphWith:) in order to apply some custom attributes to the text without affecting the underlying attributed text. My implementation returns a new NSParagraph that modifies the foreground color of the text. I based this on the example in the WWDC 21 session "Meet Text Kit 2". UITextView stops rendering the bullets when I implement the delegate function and return a custom paragraph. Why? func textContentStorage(_ textContentStorage: NSTextContentStorage, textParagraphWith range: NSRange) -> NSTextParagraph? { guard let originalText = textContentStorage.textStorage?.attributedSubstring(from: range) else { return nil } let updatedText = NSMutableAttributedString(attributedString: originalText) updatedText.addAttribute(.foregroundColor, value: UIColor.green, range: NSRange(location: 0, length: updatedText.length)) let paragraph = NSTextParagraph(attributedString: updatedText) // Verify that the text still contains NSTextList if let paragraphStyle = paragraph.attributedString.attribute(.paragraphStyle, at: 0, effectiveRange: nil) as? NSParagraphStyle { assert(!paragraphStyle.textLists.isEmpty) } else { assertionFailure("Paragraph has lost its text lists") } return paragraph }
0
0
78
May ’25