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

Persistent Control Center landscape layout reset after SpringBoard jetsam during charging idle (iOS 26.0–26.2)
Since iOS 26.0, the Control Center layout consistently resets in landscape orientation after certain system events. This issue is still present in the official public release of iOS 26.2. The reset occurs without a visible reboot and appears to be triggered by a background SpringBoard termination (jetsam) during charging idle maintenance windows (typically overnight while the device is plugged in). After SpringBoard relaunches: • The portrait Control Center layout is restored correctly • The landscape Control Center layout is reinitialized using the default order This indicates a state restoration failure rather than a user configuration or sync issue. ⸻ Steps to Reproduce: Use an iPhone 15 Pro running iOS 26.0, 26.1, or 26.2 Manually reorder Control Center controls Leave the device plugged in and idle overnight During charging idle, SpringBoard is terminated in the background due to memory pressure (no visible reboot) Open Control Center the next day: • Portrait layout is preserved • Landscape layout has reverted to default ⸻ Expected Result: Both portrait and landscape Control Center layouts should persist across SpringBoard restarts caused by jetsam or memory pressure, including during charging idle maintenance. ⸻ Actual Result: After SpringBoard relaunch: • Portrait layout is restored correctly • Landscape layout is lost and recreated using the default configuration ⸻ Analytics / Logs (relevant excerpt): Process: SpringBoard Case Type: MemoryResourceException Subtype: MREExceptionFatalLimitActive This occurs during charging idle and does not require a user-initiated reboot. ⸻ Additional Observations: • Issue does not occur when the device is idle overnight without charging • Manual reordering works correctly until the next SpringBoard jetsam • Resetting settings, disabling iCloud sync, or reinstalling iOS does not resolve the issue • This behavior has persisted across multiple major and minor releases, indicating a regression or unresolved bug ⸻ Suspected Root Cause: Incomplete state restoration in ControlCenterKit after SpringBoard relaunch following jetsam during charging idle. Portrait state is restored; landscape state falls back to default.
Topic: UI Frameworks SubTopic: UIKit
1
0
87
2h
UIBarButtonItem has a lot of constraints warnings
The issue can be reproduced using the simplest code. In Xcode 26 + iOS 26, when a UIBarButtonItem is created using a UIImage, it consistently prints numerous constraint conflict warnings to the console. Below is my test code and the console warnings: let btn = UIBarButtonItem(systemItem: .trash) self.toolbarItems = [btn] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x1083b4550 _TtC5UIKitP33_DDE14AA6B49FCAFC5A54255A118E1D8713ButtonWrapper:0x108374e00.width == _UIButtonBarButton:0x1083e8000.width (active)>", "<NSLayoutConstraint:0x1083b4aa0 'IB_Leading_Leading' H:|-(2)-[_UIModernBarButton:0x103ac62e0] (active, names: '|':_UIButtonBarButton:0x1083e8000 )>", "<NSLayoutConstraint:0x1083b4af0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x103ac62e0]-(2)-| (active, names: '|':_UIButtonBarButton:0x1083e8000 )>", "<NSLayoutConstraint:0x1083b4fa0 'UIView-Encapsulated-Layout-Width' _TtC5UIKitP33_DDE14AA6B49FCAFC5A54255A118E1D8713ButtonWrapper:0x108374e00.width == 0 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x1083b4af0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x103ac62e0]-(2)-| (active, names: '|':_UIButtonBarButton:0x1083e8000 )> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
1
0
88
7h
Compositional Layout's broken `visibleItemsInvalidationHandler`
Hello everybody! TLDR: Issues with visibleItemsInvalidationHandler. Minimal code to reproduce available. I've been working with Compositional Layout for a while now and recently I've found myself needing to implement custom animation based on scroll position of UI elements. Once I found visibleItemsInvalidationHandler it felt like the exact solution that I needed. Once I implement I've found out it doesn't quite behave as you'd expect. To put it simply, it seems like the animations only work if your whole layout does not use .estimated nor .uniformAcrossSiblings. As soon as you use them then the animations will stop working, I've debugged it deeper and it seems like the invalidation context generated by it does not include the indexPath of the cells, which is always included in the version in which it works. Feel free to swap the line 51 with its comment to flip between the working and failing version of it. Playground Example My final question therefore is... Is this the expected behavior? The documentation doesn't give any clues about such behavior and although I've tried relentlessly to find a workaround for this specific hiccup I was not successful with it.
2
0
167
21h
My app doesn't respond on iPhone Air iOS 26.1.
My app doesn't respond on iPhone Air iOS 26.1. After startup, my app shows the main view with a tab bar controller containing 4 navigation controllers. However, when a second-level view controller is pushed onto any navigation controller, the UI freezes and becomes unresponsive. The iPhone simulator running iOS 26.1 exhibits the same problem. The debug profile shows CPU usage at 100%. However, other devices and simulators do not have this problem.
6
3
279
1d
Issue with multiple touches with "Defer System Gestures" on, with iOS
I'm developing a rhythm game for iOS which has four buttons spanning the width of the screen in portrait. I noticed that my testers were having some missed inputs on the buttons on the left and right due to the fact that iOS, by default, tries to ignore accidental touches on the edges of the screen. So I enabled "Defer System Gestures" on the left and right edges, but then quickly started to notice a new, very specific, issue. Description of the issue If you have finger #1 touching and holding anywhere in the middle of the screen, and finger #2 touches on the far right or left edge of the screen just below the horizontal position of finger #1, those touches are inconsistently not recognized. If finger #1 is not present, this issue does not occur. If finger #2 is above or well below finger #1, this issue also does not occur. A dead zone is created on the right and left edges of the screen just below the horizontal position of the first touch. Here is a rough representative example of where touches #1 and #2 need to be for this issue to manifest, in case the text above is not clear. |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| It just so happens that this issue is causing major usability problems with my game, as it results in what the user sees as sporadic and inconsistent response when the game calls for two notes to be played at the same time. Steps to recreate the issue Here are the steps if you want to recreate the problem yourself using the "Create New Gesture" pane in "Assistive Touch" (Note that this problem is not specific to the Settings app, but rather is an issue across the system—however this panel defers system gestures and shows where touches are being read, so it is a great place to demonstrate): (1) Go to Settings &gt; Accessibility &gt; Touch &gt; Assistive Touch &gt; Create New Gesture...; (2) With one finger, touch the middle of the screen and hold it through step 3; (3) With a second finger, tap 4 times along the right (or left) edge of the screen in the following places: (a) well above the vertical position of the first touch, (b) just above the vertical position of the first touch, (c) just below the vertical position of the first touch, and (d) well below the vertical position of the first touch; (4) Notice how, more than half the time, touch (c) does not register. I have found that this problem is more replicatable when the first touch is on the lower half of the screen, but I have been able to replicate it when the finger is higher as well, just not as consistently. Here are the four positions described in the steps above: Position a: both touches register |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| Position b: both touches usually register |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9; 2| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| Position c: only touch 1 registers |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| Position d: both touches register |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| Is there anything I can do to resolve this behavior? My app requires gesture deferment to be on for the expected experience by the user, and this bug is causing other issues for my testers that kind of need to be resolved before I can confidently release the game.
2
2
1.2k
1d
UIToolbar buttons losing spacing in Xcode 26.1.1 Legacy Mode (UIDesignRequiresCompatibility)
We're using XCode 26.1.1 We do not have resource to adopt Liquid Glass design. Hence, we are using the following workaround <key>UIDesignRequiresCompatibility</key> <true/> This is our Storyboard. Pre XCode 26 Before XCode 26.1.1, the bottom toolbar looks great. In XCode 26 However, in XCode 26.1.1, the bottom toolbar buttons seems to "Squish together". Do anyone have any idea, how I can make UIToolbar works by enabling UIDesignRequiresCompatibility? Thanks.
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
57
1d
How to add view below navigation bar to extend scroll edge effect
Hello! What UIKit API enables you to add a view below the navigation bar and extend the scroll edge effect below it in iOS 26? safeAreaBar is how you do it in SwiftUI but I need to achieve this design in my UIKit app (which has a collection view in a view controller in a navigation controller). struct ContentView: View { let segments = ["First", "Second", "Third"] @State private var selectedSegment = "First" var body: some View { NavigationStack { List(0..<50, id: \.self) { i in Text("Row \(i + 1)") } .safeAreaBar(edge: .top) { Picker("Segment", selection: $selectedSegment) { ForEach(segments, id: \.self) { Text($0) } } .pickerStyle(.segmented) .padding(.horizontal) .padding(.bottom, 8) } .navigationTitle("Title") .navigationBarTitleDisplayMode(.inline) } } }
3
1
337
1d
How to stop navigation items from moving into an overflow menu
One screen in my app uses a navigation bar with some buttons added to the titleView and some buttons added as a customView of a single rightBarButtonItem. In iOS 26 (beta 9), if I switch to the home screen and back again, the titleView and rightBarButtonItem disappear and an overflow button (three dots) appears instead. Nothing happens when I click the overflow button. Here's a screen capture: https://youtu.be/tthRnMz98kA This also happens when I switch to another app, when I rotate the device or when I resize the app window. In all cases, there is enough room to show all the buttons, but they still disappear. I overrode the viewWillTransition function in my view controller and logged when that runs. I can see that if I switch to the home screen and back again before that runs (within one or two seconds), there's no problem. But once that runs, the navigation bar items disappear and the overflow button appears. I have not done anything to set up the overflow button and don't have any need to use it. The documentation about it isn't very detailed, but it seems like it shouldn't be used unless I add it. This wasn't a problem in iOS 18 or earlier iOS versions. Does anyone know how to stop this? BTW, I'm using Swift, but not SwiftUI.
Topic: UI Frameworks SubTopic: UIKit
5
0
303
2d
iOS 26.1 PHPickerConfiguration.preselectedAssetIdentifiers doesn't select previous pictures in the PHPickerViewController
Hi, I faced with the issue on iOS 26.1 with PHPickerViewController. After first selection I save assetIdentifier of PHPickerResult for images. next time I open the picker I expect to have the images selected based on assetIdentifier Code: var config = PHPickerConfiguration(photoLibrary: .shared()) config.selectionLimit = 10 config.filter = .images config.preselectedAssetIdentifiers = images.compactMap(\.assetID) let picker = PHPickerViewController(configuration: config) picker.delegate = self present(picker, animated: true) But on iOS 26.1 they aren't selected. On lower iOS version all works fine. Does anybody faced with similar issue?
Topic: UI Frameworks SubTopic: UIKit
3
2
247
2d
UIBarButtonItem and Liquid Glass
I am looking for a way to change the liquid glass background colors on UIBarButtonItems. Setting tintColor does what I want for a bar button item when it is both the default button and it is enabled. But it does not seem to do anything for disabled buttons or non-prominent buttons. Also, is there a way to apply such a change using a UINavigationBarAppearance or a UIBarButtonItemAppearance? If I cannot change this liquid glass color, I might need to disable liquid glass on these by setting hidesSharedBackground to true. Is there a way to do this globally within the app (without using UIDesignRequiresCompatibility), or with something like UINavigationBarAppearance or UIBarButtonItemAppearance? Thank you. John
Topic: UI Frameworks SubTopic: UIKit
2
0
139
4d
Crash on _UIButtonBarItemLayout _updateItemView
With iOS 26.1 and beta 26.2, there is a crash seen for _UIButtonBarItemLayout update. Has anyone experienced this crash or has any information on this Thread 0 name: Thread 0 Crashed: 0 libobjc.A.dylib 0x000000019daa144c objc_retain + 16 1 UIKitCore 0x00000001a680b184 -[_UIButtonBarItemLayout _updateItemView] + 360 2 UIKitCore 0x00000001a6d5ddcc -[_UIButtonBarItemLayout minimumLayoutWidthGivenMinimumSpaceWidth:] + 28 3 UIKitCore 0x00000001a6d5eeec -[_UIButtonBarItemGroupLayout recalculateLayoutWidthsGivenItemSpaceWidth:] + 304 4 UIKitCore 0x00000001a6d4ca28 -[_UIButtonBar _widthInfoForLayout:] + 188 5 UIKitCore 0x00000001a68093b4 -[_UIButtonBar _layoutBar] + 108 6 UIKitCore 0x00000001a6809328 __42-[_UIButtonBarStackView updateConstraints]_block_invoke + 44 7 UIKitCore 0x00000001a7dbea8c +[UIView(Animation) performWithoutAnimation:] + 76 8 UIKitCore 0x00000001a68092d0 -[_UIButtonBarStackView updateConstraints] + 112 9 UIKitCore 0x00000001a64707e8 -[UIView(AdditionalLayoutSupport) _previousFittingSizeInfo] + 784 10 UIKitCore 0x00000001a6470508 -[UIView(AdditionalLayoutSupport) _previousFittingSizeInfo] + 48
Topic: UI Frameworks SubTopic: UIKit
3
2
157
4d
iOS 26 WKWebView STScreenTimeConfigurationObserver KVO Crash
Fatal Exception: NSInternalInconsistencyException Cannot remove an observer <WKWebView 0x135137800> for the key path "configuration.enforcesChildRestrictions" from <STScreenTimeConfigurationObserver 0x13c6d7460>, most likely because the value for the key "configuration" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the STScreenTimeConfigurationObserver [class.] I noticed that on iOS 26, WKWebView registers STScreenTimeConfigurationObserver, Is this an iOS 26 system issue? What should I do?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
57
5d
How to prevent window scene restoration
We have an iOS app running on macOS (not Mac Catalyst). The preferences are in a dedicated UIWindowScene. We don't want this scene to be restored, so when you start the app the preferences shouldn't be visible. How can we prevent the UIWindowScene restoration? Alternatively, if we can't prevent it, how can we ensure the main window scene is in front of the preferences window scene on app start?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
30
5d
UIKit flip animation bugged in 26.1
Hello. I have an 12 year old app that still has some objective-c code in it. I have a place where i have a flip animation between 2 view controllers that looks like this: [UIView transitionFromView:origView toView:newViewController.view duration:0.5 options:UIViewAnimationOptionTransitionFlipFromRight completion:nil]; It has looked like this since 2012 at least. In our production release, it works prior to 26.1, but in 26.1 and 26.2, the flip is off-center and looks weird. it's like both edges flip the same way. It's a little bit hard to explain. If seen at least 2 other app store apps that i have installed behave this way too, from 26.1 and onwards. Anyone else seen this? Is there anything that can be done about it? Thankful for thoughts.
14
3
579
5d
Share Sheet with UIActivityItemsConfiguration
I am trying to address an issue with my app’s share sheet where, when the user sends a URL to either Apple Reminders or OmniFocus, the receiving app does not get a title. So I am updating my share sheet code to use UIActivityItemsConfiguration. I have this code: let title = "Golden Hill Software" let url = URL(string: "https://www.goldenhillsoftware.com/")! let itemProvider = NSItemProvider() itemProvider.registerObject(ofClass: URL.self, visibility: .all) { (handler) in handler(url, nil) return nil } let config = UIActivityItemsConfiguration(itemProviders: [itemProvider]) config.metadataProvider = { (key) in if key == .title || key == .messageBody { return title } else { return nil } } let viewController = UIActivityViewController(activityItemsConfiguration: config) self.present(viewController, animated: true) This works with some share sheet extensions. But when I choose the Ivory share extension, Ivory creates a post with a URL that starts with bplist…. When I choose the Open in Chrome action extension, Chrome says “Chrome cannot handle this link”. Can someone help me understand what I am doing wrong here? (edited)
Topic: UI Frameworks SubTopic: UIKit
0
0
24
5d
iOS26 UISearchbar and UISearchController cancellation issues
Is the Cancel button intentionally removed from UISearchBar (right side)? Even when using searchController with navigationItem also. showsCancelButton = true doesn’t display the cancel button. Also: When tapping the clear ("x") button inside the search field, the search is getting canceled, and searchBarCancelButtonClicked(_:) is triggered (Generally it should only clear text, not cancel search). If the search text is empty and I tap outside the search bar, the search is canceled. Also when I have tableview in my controller(like recent searches) below search bar and if I try to tap when editing started, action is not triggered(verified in sample too). Just cancellation is happening. In a split view controller, if the search is on the right side and I try to open the side panel, the search also gets canceled. Are these behaviors intentional changes, beta issues, or are we missing something in implementation?
9
1
728
6d