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

iPadOS 26 - TableView auto scrolling bug
We are observing that for devices with iPadOS 26, table views within apps are unexpectedly auto scrolling. The issue can be reproduced as follows: The table view has enough cells to the point where not all cells can fit on the screen and the table view is scrollable User has scrolled to the bottom of the tableView and tableView.reloadData() is called. One of the following applies: The ViewController containing the tableView is embedded in a UINavigationController, and ViewController sets self.edgesForExtendedLayout = .bottom The ViewController containing the tableView is embedded in a UINavigationController, and UINavigationController sets navigationBar.isTranslucent = false The following constraints are applied to the tableView: tableView.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor).isActive = true tableView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true tableView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true After thorough testing, we've found that the bug is only present in iPads with iPadOS 26. It does not show for iPhone devices or for iPads on iPadOS 18. We are hoping that this can be fixed as it is causing poor user experience. Full code needed to reproduce the issue: Use this willConnectTo function in SceneDelegate: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = scene as? UIWindowScene else { return } window = UIWindow(windowScene: windowScene) let navigationControllerWithVC = UINavigationController(rootViewController: ViewController()) // ⚠️ CASE 1 - Comment out the .isTranslucent setter below, or set the value to true, and the scrolling issue will be gone, granted that the other issue-causing lines in ViewController.swift // are also commented. navigationControllerWithVC.navigationBar.isTranslucent = false window?.rootViewController = navigationControllerWithVC // Replace this line with window?.rootViewController = ViewController() to get rid of UINavigationController window?.makeKeyAndVisible() } Use this ViewController class that is referenced from the SceneDelegate willConnectTo function: import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var tableView: UITableView! var safeArea: UILayoutGuide! var timer: Timer! override func viewDidLoad() { super.viewDidLoad() // ⚠️ CASE 2 - Uncomment the line below when this view is inside a UINavigationController to cause the scrolling issue. //self.edgesForExtendedLayout = .bottom tableView = UITableView() safeArea = view.layoutMarginsGuide setupTableView() timer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(fireTimer), userInfo: nil, repeats: true) } @objc public func fireTimer() { tableView.reloadData() print("Reloaded table") } func setupTableView() { tableView.delegate = self tableView.dataSource = self view.addSubview(tableView) tableView.translatesAutoresizingMaskIntoConstraints = false // ⚠️ CASE 3 - Replace view.topAnchor in the next line below with safeArea.topAnchor to see the scrolling issue, regardless if view is inside a UINavigationController. tableView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true tableView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true tableView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 40 } public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 50.0 } public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = UITableViewCell() cell.textLabel?.text = indexPath.row == 39 ? "END" : "Row \(indexPath.row)" return cell } public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) } } For reproducing this on iPadOS 26 simulators, I can confirm that simulators under Xcode 26.0.1 (17A400) and Xcode 26.1 Beta (17B5025f) will show the issue. The issue is present in iPadOS 26 and iPadOS 26.1 beta. I've also submitted Apple Feedback for this (FB20357980) with all this code in a Xcode project.
5
0
384
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.
5
1
167
1w
Navigation Bar animation upon Tab change
Hi. Since Xcode 16 and/or iOS 18.0 (I upgraded at the same time), I have an strange effect in the lower (let's say) 20% section of the Navigation Bar when changing to another tab, and this independently if large titles are used or not. Mentioned section is brighter or darker than the rest of the Navigation Bar background, depending on which background tint is used. This effect lasts about 0.3 seconds, but is clearly visible, quite disturbing and new as of Xcode 16 and/or iOS 18.0. I use the code below in AppDelegate to get a gradient coloured Navigation Bar background. let appearance = UINavigationBarAppearance() UINavigationBar.appearance().standardAppearance = appearance UINavigationBar.appearance().compactAppearance = appearance UINavigationBar.appearance().scrollEdgeAppearance = appearance UINavigationBar.appearance().compactScrollEdgeAppearance = appearance If I don't use above code., the background color is filled and without gradient. Subject effect doesn't show in this case. The effect basically looks like when changing tab, the new Navigation Bar background doesn't clear right away, and keeps the background from the previous Navigation Bar for 0.3 seconds before new one Navigation Bar background is rendered. I spent quite some time on changing every possible setting, in code as well as storyboard ... no success so far. Any ideas how to disable this undesired animation?
1
0
691
1w
iOS 26: FloatingBarContainerView overlapping the whole custom ViewController
Hi everyone: I'm experiencing an issue in iOS 26. I've implemented a custom ViewController. It's super simple to edit images with flip, crop, zoom in, and zoom out. My question is that it seems very strange to me. It works without problems in iOS 17.5 and iOS 18. However, when I try to run it with iOS 26, the entire ViewController seems disabled; it doesn't recognize touches or anything. When I checked the UI hierarchy, I saw a strange FloatingBarContainerView overlaying the entire ViewController. I searched the documentation for information about this view, but I couldn't find anything. Any help on how to hide or remove this view in iOS 26? This hasn't been implemented anywhere.
2
0
173
1w
UIDesignRequiresCompatibility in a unit test
I have an app with thousands of snapshot tests, technically these are unit tests rather than UI tests, they take a snapshot of a view controller and compare the resulting image to a known image and fail if there are any changes. The app is not using Liquid Glass (yet) so I have added UIDesignRequiresCompatibility to my Info.plist file however this does not seem to be respected during my unit tests. Is there any way to run my snapshot tests on an iOS 26 simulator without using the new Liquid Glass UI?
Topic: UI Frameworks SubTopic: UIKit
0
1
36
1w
Does Mac Catalyst support an "always on top" window scene?
My UIKit/Mac Catalyst app supports a user opening multiple windows (multiple scenes). One of these is a special scene that shows content that I want to appear in front of all other app windows/scenes, even while the user is interacting with one of the app's other scenes. I do not need this special scene to stay in front of the windows of other apps, just in front of the windows of my own app. While I'm not 100% sure, it seems that AppKit supports this through the NSWindow level property. I can't find any equivalent feature in UIKit/Mac Catalyst. UIWindow windowLevel is not the same thing since that only affects the order of windows within a given scene. I need an entire scene (and its windows) to stay in front of my app's other scenes (and their windows). I don't see anything relevant in UIWindow, UIScene, UIWindowScene, UISceneSession, UIScene.ActivationRequestOptions, or UIWindowScene.ActivationRequestOptions.
2
0
80
1w
iOS 26.1 b1 tableview line seperator showing even when set to .none in IB (Xib)
Hey All, Curious if you guys are seeing the same thing for those who are using Interface Builder Files (Xib) i set the line seperator to none and on my app (built against ios 18 on the app store, but doesnt matter if i build it against ios 26, or ios 26.1) when running on iOS 26.1 the line seperator will show even when i set it to None. Funny enough if i just play around with the XIB file and set it to single line and maybe RED color the IB file will show it but when running it its the same old default dark greyish color. BUT if i set the line seperator in CODE either to be none or with single line + red it looks good when running on sim / device. So it seems to be an issue with XIB files not being respected in iOS 26.1 (only) i have submitted a feed back FB20466783, hope this helps any xcode devs / uikit devs. thank you ! (I did post this in the xcode forums, but honestly i think its more of a uikit issue than xcode as the IB File visually looks good when changing)
Topic: UI Frameworks SubTopic: UIKit
3
0
127
1w
[iOS 26] UIVideoEditorController preview's top bar is overlapping with parent view controller
Applicaiton is built with WebKit and native camera view controller . Issue is seen always when presenting a UIVideoEditorController class on top of MainVC(webKit). Please refer the attached image Code: self.videoEditor.modalPresentationStyle = UIModalPresentationFullScreen; [viewController presentViewController:self.videoEditor animated: YES completion:nil];
4
0
185
1w
App Crashes in UICollectionView.m:3974
No Trace of My App is found in Crash Report. The last trace is from UIKitCore. -> Foundation [NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 288 (NSException.m:252) -> UIKitCore [UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:layout:withLayoutAttributes:applyAttributes:] + 1180 (UICollectionView.m:3974) What can be the possible causes for this type of crash?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
104
2w
VNDocumentCameraViewController UI issues in iOS 26
We're observing several UI issues with VNDocumentCameraViewController on devices running iOS 26. These screens were functioning correctly in earlier iOS versions. Issue 1 - On the edge correction screen, the top bar now appears as a gray strip beneath the status bar, whereas in previous iOS versions, it was positioned at the bottom of the screen. Do we have any workarounds to address this issue? Issue2 - The edit buttons and their labels are not clearly visible, affecting usability. Im using XCode 16.4 to build to iOS26 and the usage is like below: `let scanner = VNDocumentCameraViewController() scanner.delegate = self self.present(scanner, animated: true)`
0
0
61
2w
UISlider valueChanged has uninitialized UIEvent
This issue was in the first iOS 26 beta and it still there with Xcode 26 beta 6 (17A5305f). Feedback is FB18581605 and contains sample project to reproduce the issue. I assign a target and action to a UISlider for the UIControl.Event.valueChanged value: addTarget(self, action: #selector(sliderValueDidChange), for: .valueChanged) Here’s the function. @objc func sliderValueDidChange(_ sender: UISlider, event: UIEvent) { print(event) } When printing the event value, there is a crash. When checking the event value with lldb, it appears uninitialized.
Topic: UI Frameworks SubTopic: UIKit Tags:
10
5
521
2w
Recover iPadOS MenuBar state from different scenes
I’m building a Flutter plugin to access the new menubar API on iPadOS. Everything works fine with a single scene, but I’m running into issues when adding support for multiple scenes: Only odd-numbered windows (first, third, etc.) build their menus correctly. Even-numbered windows ignore the menus sent from Flutter and fall back to a default menubar. When switching between scenes, the last rendered menu always persists instead of updating to the current focus. So far, I’ve: Implemented the plugin as a singleton. Tried to persist menu state per scene, but without success. What would be the recommended approach here? Should I avoid a singleton and manage state entirely per UIScene instance? The project is open-source, and if anyone is willing to take a look, here are the relevant files: /ios/Classes/IpadOSMenubarPlugin.swift /example/ios/Runner/AppDelegate.swift Any guidance would be much appreciated.
1
0
86
2w
PDFKit Zoom Performance Issue with Many Annotations
Hello, I’m using PDFKit to display PDFs with a large number of annotations. However, when there are many annotations, I’m experiencing serious performance issues while zooming in/out with PDFView. • During pinch zoom, it seems like continuous re-rendering occurs. • Memory usage spikes dramatically while zooming, then drops back down repeatedly. • As a result, zooming feels laggy and not smooth. What I’d like to achieve is the following: 1. Prevent unnecessary re-rendering while zooming is in progress. 2. Trigger a single re-render only once the zoom gesture ends (e.g., in scrollViewDidEndZooming). 3. At the very least, avoid the memory spikes during zoom. Is there any way to control how annotations are re-drawn during zooming in PDFKit, or to throttle/debounce rendering so it happens only after the gesture completes? I’d really appreciate any advice from others who have encountered similar issues, or guidance from Apple on the recommended approach. Thanks in advance!
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
56
2w
preferredImageDynamicRange is not marked as being available only for iOS 17 and above.
open var isAnimating: Bool { get } /// The preferred treatment to use for HDR images. By default the image view will defer to the value from its traitCollection. open var preferredImageDynamicRange: UIImage.DynamicRange /// The resolved treatment to use for HDR images. open var imageDynamicRange: UIImage.DynamicRange { get } This attribute is not marked as being applicable only in iOS 17+ versions. When viewing the UIImageView code in Xcode, the @available(iOS 17.0, *) annotation was not added, which resulted in successful compilation but caused a crash on iOS 16 devices.
3
0
81
2w
We can’t see Large Title on NavigationBar on iOS 26
Apps built with the iOS 26 beta SDK do not display largeTitle. When we built with iOS 18 SDK, it displayed correctly. The official reference shows that a property named largeTitle has been added since iOS 26 beta. However, setting this did not change the result. Does anyone know how to implement the property?
Topic: UI Frameworks SubTopic: UIKit
5
1
312
2w