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

Posts under UIKit tag

200 Posts

Post

Replies

Boosts

Views

Activity

Custom TabBar height in a production app – is this allowed?
Hi, I'm working on a large application, and the designers have proposed a new look for the tab bar. The app has been in development for 14 years, and while many views are now in SwiftUI, navigation between screens is still handled in UIKit, since most screens are still UIKit-based. Currently, we're using the native UIKit TabBar. I'm going to check if it's possible to customize the appearance of the native TabBar. However, I remember that over 10 years ago, when I changed the height of the TabBar, the app was rejected during review for not complying with Apple's Human Interface Guidelines. It looked something like this: An app rejection related to a tab bar's height update in Swift, likely due to not adhering to Apple's Human Interface Guidelines, can be addressed by ensuring the tab bar's height remains at the default 49 points and avoiding any modifications that don't align with the HIG, according to Apple's documentation. How does it look nowadays? Has anyone here submitted an app to the store with a heavily customized TabBar height and had it approved? In UIKit, I see it's possible to do something like this: https://stackoverflow.com/questions/23044218/change-uitabbar-height Would something like this pass app review without issues? Do you know of any apps that have a non-standard, significantly increased TabBar height?
0
0
126
Aug ’25
New 'badge' property of UIBarButtonItem does not work in iOS 26 beta 3 when used in a toolbar
I'm very happy with the new badge property of UIBarButtonItem, but unfortunately it doesn't work yet on a UIToolbar object. The following code does change the tint color of the button to pink, which proves the button object exists, but there is no visible badge after running the code: if let button = toolbarItems?.first { button.badge = .count(123) // Does nothing button.tintColor = .systemPink // Works } Do I overlook something, or is this just not implemented yet? Or is this limitation 'by design'? (That would be a MAJOR disappointment)
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
148
Aug ’25
In Xcode 26 ß (iOS 26 simulator) UIBarButtonItem content disappear when tapped
Just testing an existing app with Xcode 26. I notice that content of UIBarButtonItem (either text or image) disappears when tapped (and reappear on release). Those are custom, bordered buttons. Attribute inspector: Buttons in Xcode: When selected in Xcode, we see a rectangle inside the rounder rect of iOS 26 In simulator: When tapped in simulator: I have edited code from backButton.setTitleTextAttributes([ .font : boldFont, .foregroundColor : UIColor.systemBlue, ], for: .normal) to backButton.setTitleTextAttributes([ .font : boldFont, .foregroundColor : UIColor.systemBlue, ], for: [.normal, .focused, .selected, .highlighted]) to no avail. What am I missing ?
1
0
349
Aug ’25
UIStoryboard.instantiateInitialViewController Not Working in iOS 18.6 When Built with iOS 26 SDK
In my SceneDelegate via 'scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)' I call the following code to assign a Storyboard: let storyboard = UIStoryboard(name: "Main", bundle: nil) let initialVC = storyboard.instantiateInitialViewController() self.window?.rootViewController = initialVC The Initial VC is a UITabBarController. The app crashes when calling 'instantiateInitialViewController': *** 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)' terminating due to uncaught exception of type NSException CoreSimulator 1047 - Device: iPhone 16 Pro (06A3EAF6-6623-49FD-BEFE-BE88FDD13BBE) - Runtime: iOS 18.6 (22G86) - DeviceType: iPhone 16 Pro Works fine in iOS 26 when compiling using Xcode 26. Works fine when compiling for iOS 18.6 in Xcode 16.4. Seems to just be an issue when using the iOS 26 SDK in iOS 18.6. This will be an issue for Day 01 Updates if a user hasn't updated to iOS 26 yet.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
95
Aug ’25
Trying to get UIBarButtonItem custom view to change color within iOS 26 Liquid Glass like native UIBarButtonItem
One of the bar button items of my bottom toolbar needs to be a custom view., and I’m trying hard to get it to behave like the proper bar button items when it comes to Liquid Glass and matching the appearance of all the other bar button items on my toolbar. I’ve tried many variations of embedding custom views within visual effect views, and this comes closest. I inited a UIBarButtonItem with a custom UIView like you’re supposed to, and then I placed a UIVisualEffectView with Vibrancy within that, so that I could place a UIImageView inside it and the UIImageView would respect the adaptive color changing that comes with being within a Liquid Glass bar button item. I’ve made sure that the UIImageView is using an SF Symbol and a rendering mode of .alwaysTemplate, and that the .tintColor is set to .label, to ensure that I’m not overriding any Liquid Glass rendering. Below, you can see the bar button item with my custom view on the left, and a native Bar Button Item with the same SF symbol on the right, in several scenarios. It gets part of the way there there: against light backgrounds the image view turns black like it should. But against darker backgrounds, instead of turning white, the symbol has an additional vibrancy that comes close to the right white look against certain grays, but then is obviously too translucent against black. The symbol is still visible/experiencing some vibrancy, so I assume it might be some configuration of the UIImageView within the Vibrancy that can correct the behavior to match the images in the native bar button items in all conditions. Anyone got thoughts on what the missing piece might be?
4
0
452
Aug ’25
UISearchTab with automaticallyActivatesSearch only works on second tap?
let searchTab = UISearchTab { tab in UINavigationController(rootViewController: SearchViewController()) } searchTab.automaticallyActivatesSearch = true class SearchViewController: UIViewController { private let searchController = UISearchController(searchResultsController: UIViewController()) override func viewDidLoad() { super.viewDidLoad() navigationItem.searchController = searchController } } With this setup when I launch the app and tap the search tab, the keyboard will not appear. Switching tabs and tapping search again works from then on. Am I doing something wrong here? Video here: https://mastodon.social/@nicoreese/114983627125286299
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
115
Aug ’25
How to customize the liquid glass tab bar appearance in iOS26?
I'm trying to customize the appearance of the liquid glass tab bar. Are these APIs deprecated in iOS 26? UITabBarAppearance: configureWithOpaqueBackground() -> would be nice to have an option to keep the shape/behavior but have an opaque background. backgroundColor -> should this be used both for setting the color of opaque background and tinting the liquid glass? selectionIndicatorTintColor, selectionIndicatorImage -> neither of these seem to do anything on either iOS 18 and 26 UITabBarItemAppearance: normal.iconColor -> doesn't seem to work, only selected.iconColor
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
224
Aug ’25
Large title is not visible in iOS 26
I am using below code to change navigationBar bg colour, but the text is hidden in large title. It works fine in previous versions. Kindly refer below code and attached images. Code: override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.navigationBar.prefersLargeTitles = true navigationItem.largeTitleDisplayMode = .always let appearance = UINavigationBarAppearance() appearance.backgroundColor = UIColor( red: 0.101961, green: 0.439216, blue: 0.388235, alpha: 1.0 ) navigationController?.navigationBar.standardAppearance = appearance navigationController?.navigationBar.scrollEdgeAppearance = appearance navigationController?.navigationBar.compactAppearance = appearance } Referenced images:
3
2
356
Aug ’25
On iPadOS 26 beta, the navigation bar can appear inset underneath the status bar (FB18241928)
On iPadOS 26 beta, the navigation bar can appear inset underneath the status bar (FB18241928) This bug does not happen on iOS 18. This bug occurs when a full screen modal view controller without a status bar is presented, the device orientation changes, and then the full screen modal view controller is dismissed. This bug appears to happen only on iPad, and not on iPhone. This bug happens both in the simulator and on the device. Thank you for investigating this issue.
6
0
429
Aug ’25
Why my link color changes back to system default on click and hold?
I currently have a custom UITextView that properly changes the color of a link to the custom color I have set, however, when I click and hold the link, and the animation plays that makes the link bigger and creates a boarder around the link before previewing the website, the link changes briefly back to the system default color, and when letting go, it changes back to my custom color. Is there anyway to have the link always be my custom color, even when clicking and holding? struct AutoDetectedClickableDataView: UIViewRepresentable { let text: String let dataDetectors: UIDataDetectorTypes @Binding var height: CGFloat private func dataDectectorValue(_ dataDectecor: UIDataDetectorTypes) -> UInt64 { var checkingTypes: [NSTextCheckingResult.CheckingType] = [] if dataDetectors.contains(.phoneNumber) { checkingTypes.append(.phoneNumber) } if dataDetectors.contains(.link) { checkingTypes.append(.link) } if dataDetectors.contains(.address) { checkingTypes.append(.address) } if dataDetectors.contains(.calendarEvent) { checkingTypes.append(.date) } if checkingTypes.isEmpty { return 0 } let intCheckingTypes: UInt64 = checkingTypes.reduce(0) { result, checkingType in UInt64(result) | UInt64(checkingType.rawValue) } return intCheckingTypes } func makeUIView(context: Context) -> UITextView { let textView = UITextView() textView.dataDetectorTypes = dataDetectors textView.isEditable = false textView.isScrollEnabled = false textView.backgroundColor = .clear textView.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: UIFont.systemFont(ofSize: 16.0), compatibleWith: textView.traitCollection) textView.textColor = UIColor.label textView.adjustsFontForContentSizeCategory = true textView.textContainer.lineBreakMode = .byWordWrapping textView.textContainerInset = .zero textView.textContainer.lineFragmentPadding = 0 textView.translatesAutoresizingMaskIntoConstraints = false textView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) textView.setContentHuggingPriority(.defaultHigh, for: .horizontal) textView.linkTextAttributes = [.foregroundColor: JeromesColors.UILinkColor] textView.tintColor = JeromesColors.UILinkColor for gesture in textView.gestureRecognizers ?? [] { if gesture is UITapGestureRecognizer { gesture.view?.tintColor = JeromesColors.UILinkColor } } return textView } func updateUIView(_ uiView: UITextView, context: Context) { let font = UIFontMetrics(forTextStyle: .body).scaledFont(for: UIFont.systemFont(ofSize: 16.0), compatibleWith: uiView.traitCollection) let color = UIColor.label let attributed = NSMutableAttributedString(string: text, attributes: [ .font: font, .foregroundColor: color ]) let detectorValue = dataDectectorValue(dataDetectors) var matchCount = 0 if !dataDetectors.isEmpty, detectorValue != 0 { let detector = try? NSDataDetector(types: detectorValue) detector?.enumerateMatches(in: text, options: [], range: NSRange(location: 0, length: text.utf16.count)) { match, _, _ in guard let match = match else { return } if match.resultType == .date, let date = match.date, date < Date() { return } else { attributed.addAttributes([ .foregroundColor: JeromesColors.UILinkColor, .underlineStyle: NSUnderlineStyle.single.rawValue, ], range: match.range) matchCount += 1 } } } uiView.attributedText = attributed if matchCount == 0 { uiView.isSelectable = false } else if matchCount > 0 { uiView.isSelectable = true } DispatchQueue.main.async { uiView.layoutIfNeeded() let fittingSize = CGSize(width: uiView.bounds.width, height: .greatestFiniteMagnitude) let size = uiView.sizeThatFits(fittingSize) height = size.height } } }
0
0
86
Aug ’25
iOS 26 web page with script is terminated on custom scheme WKURLSchemeHandler
Something has changed in iOS 26 and now if custom scheme is used and web page contains scripts WebKit is terminated. 0x1130bc170 - [PID=47858] WebProcessProxy::didClose: (web process 0 crash) 0x1130bc170 - [PID=47858] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash final class CustomSchemeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let sampleConfiguration = WKWebViewConfiguration() sampleConfiguration.setURLSchemeHandler( SampleURLSchemeHandler(), forURLScheme: "sample" ) let webView = WKWebView(frame: view.bounds, configuration: sampleConfiguration) webView.autoresizingMask = [.flexibleWidth, .flexibleHeight] view.addSubview(webView) webView.navigationDelegate = self webView.load(URLRequest(url: URL(string: "sample://pages/sample.html")!)) } } extension CustomSchemeViewController: WKNavigationDelegate { func webViewWebContentProcessDidTerminate(_ webView: WKWebView) { print("webViewWebContentProcessDidTerminate") } } final class SampleURLSchemeHandler: NSObject, WKURLSchemeHandler { private func post(_ body: String, mimeType: String, urlSchemeTask: WKURLSchemeTask) { let body = Data(body.utf8) let response = URLResponse( url: urlSchemeTask.request.url!, mimeType: mimeType, expectedContentLength: body.count, textEncodingName: nil ) urlSchemeTask.didReceive(response) urlSchemeTask.didReceive(body) urlSchemeTask.didFinish() } func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) { switch urlSchemeTask.request.url?.lastPathComponent { case "sample.html": post(""" <?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="/scripts/sample.js"></script> </head> <body> <p>Sample</p> </body> </html> """, mimeType: "application/xhtml+xml", urlSchemeTask: urlSchemeTask ) case "sample.js": post("console.log('Hello from JS File')", mimeType: "text/javascript", urlSchemeTask: urlSchemeTask ) default: assertionFailure() } } func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) { print("webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask)") } } It works fine with css file inside, without script tag or with async attribute Code of sample project https://github.com/Igor-Palaguta/iOS26URLSchemeTermination
2
2
245
Aug ’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.
10
11
1.2k
Aug ’25
iPadOS Floating Tab Bar Items (unselected) use Black Text - Unreadable with App Black Background (Dark Mode): UIKit App
Reference Feedback FB19152594 Occurs with my 3rd Party UIKit App called "Lifeorities". Latest occurrence was 7/27/25 at 13:49 pm. Launch app (actual device running iPadOS 26 or iPadOS 26 simulator) Initial screen displays view content and floating tab bar at top of screen (both portrait orientation and landscape). Floating tab bar items respond to liquid glass effect (but liquid glass appearance of the whole tab bar doesn't comply with new glass pill shaped tab bar area). Selected tab bar item obeys selected app designated color (assets). Unselected tab bar items are using black text which is unreadable on app background which used dark mode as default (as intended). Selecting another tab bar item shows the liquid glass effect as you navigate to the new tab bar item and shows the app designated color (assets). Previous tab bar item that was selected, now is unselected and shows black text. NOTE: iOS tab bar items work fine (show white foreground color as desired for unselected tab bar items).
0
1
133
Aug ’25
XCode 26 beta 4 search bar issue
I have a standard list view controller that has a UISearchController set up in the list's navigationItem. When built on Xcode 26 beta 4 the search bar does not appear. It's not present in the view hierarchy. On previous versions it appears, especially on Xcode 16.4. Is this a known issue? Haven't managed to find it anywhere. Also what could be the potential workaround?
1
0
118
Aug ’25
How to keep bottom toolbar pinned, when sheet's detent are changed in code
I am trying to add a pinned(always visible and not moving) toolbar to the bottom of UISheetPresentationController or presentationDetent. This is achievable when the user is dragging to change the size of the sheet. But when changing the detent by code, it does not work. For example, when changing from medium to large, the ViewController's size is changed to large then moved up to the position. From the user's POV, anything at the bottom to disappear for a few frames then reappears. From my testing, when using UISheetPresentationController, ViewController only knows the medium and large state's frame and bounds, so manually setting it up won't work. Is there a way to keep views at the bottom always visible in this case? The sample code below is in SwiftUI for easy recreation, and the responses can be in UIKit. Sample Code: struct ContentView: View { @State var showSheet: Bool = true @State var detent: PresentationDetent = .medium var body: some View { EmptyView() .sheet(isPresented: $showSheet) { ScrollView { } .safeAreaInset(edge: .bottom) { Button { detent = (detent == .medium) ? .large : .medium } label: { Text("Change Size") } .buttonStyle(.borderedProminent) .presentationDetents([.medium, .large], selection: $detent) .presentationBackgroundInteraction(.enabled) } } } }
1
0
125
Aug ’25
UIMainMenuSystem and MKMapView
I've added some menus to the new (mac-like) menu bar on the iPad App under iPadOS 26, which is working fine. However if the main view controller covers the whole screen and shows a fullscreen Map (MKMapView), the menu bar has a dark gradient as a background, which makes it extremely difficult to see the menu. I guess the iPadOS tries to put a semi-transparent layer between the view controller and the menu bar to make sure that the content of the view controller doesn't interfere with with the menubar and the menu is easy to read. But when the view controller shows a map, the system seems to get the colors for this transparent layer wrong. Is it possible to solve this, or is this still a bug of iPad OS 26? Interestingly, when I create a screenshot of the screen, this dark gradient which makes the menu bar unreadably is not included in the screenshot. So in the screenshot the menu is easy to read. Only on the real device, the menu bar is almost unreadably
1
0
174
Aug ’25
How can shadows and borders be used on a view that is set up with iOS 26 cornerConfiguration API and concentric values?
On UIKit, shadows and borders are used laid out using CALayer properties. This works great when using .cornerRadius as this can be applied to the layers displaying borders/shadows. With the addition of cornerConfiguration, which is done via UIView, what is the expected setup for making sure, for example, when a UIView is using a concentric behavior to its parent, that its shadows and borders are following the same corner radius for each side? Would it be correct to read the corner radius values on the UIView's layoutSubviews method and then apply those to the border/shadow properties?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
160
Aug ’25
[UIViewController willMoveToParentViewController:] provides an incorrect navStack when popping a view controller in iPadOS 18.2
The Apple documentation for [UIViewController willMoveToParentViewController:] states, Called just before the view controller is added or removed from a container view controller. Hence, the view controller being popped should appear at the top of the navStack when willMoveToParentViewController: is called. In iPadOS 16 and 17 the view controller being popped appears at the top of the navStack when willMoveToParentViewController: is called. In iPadOS 18 the view controller being popped has already been (incorrectly) removed from the navStack. We confirmed this bug using iPadOS 18.2 as well as 18.0. Our app relies upon the contents of the navStack within willMoveToParentViewController: to track the user's location within a folder hierarchy. Our app works smoothly on iPadOS 16 and 17. Conversely, our customers running iPadOS 18 have lost client data and corrupted their data folders as a result of this bug! These customers are angry -- not surprisingly, some have asked for refunds and submitted negative app reviews. Why doesn't willMoveToParentViewController: provide the correct navStack in iPadOS 18.2?
2
0
671
Aug ’25
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:
3
1
230
Aug ’25