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

setAlternateIconName Issue on iOS 26.1 — Primary Icon Not Restoring and API Freezes After Invalid Name
Hi, I found an issue related to dynamic app icon changes using UIApplication.shared.setAlternateIconName specifically on iOS 26.1. Test Scenario 1. Change icon using: UIApplication.shared.setAlternateIconName("TestIcon") → Works correctly. 2. Revert to primary icon using: UIApplication.shared.setAlternateIconName(nil) Issue on iOS 26.1 For some users, the device does not revert back to the primary icon when calling setAlternateIconName(nil). To handle this case, we attempted to force the primary icon by explicitly calling: UIApplication.shared.setAlternateIconName("AppIcon") However, on iOS 26.1: • As soon as this call is made, the entire setAlternateIconName API stops working. • Every subsequent call to setAlternateIconName fails. • The API begins returning errors (e.g. NSPOSIXErrorDomain code 35). • The issue persists until the device is rebooted. Expected Behavior We understand that providing "AppIcon" should not change the icon (since primary icon is restored using nil), but on earlier versions of iOS (≤ 26.0): • Calling "AppIcon" simply does nothing (no icon change) • And setAlternateIconName(nil) works as expected to restore the default icon. Problem Summary • On iOS 26.1, calling setAlternateIconName("AppIcon") puts the icon system into a bad state. • After this call: • The API becomes unresponsive • All icon changes fail • Only a reboot restores normal behavior • This regression does not occur on iOS 26.0 or earlier. Request Is this a known issue with the app icon system on iOS 26.1? Should "AppIcon" explicitly be rejected, or is the freeze/error state unintended behavior? Any guidance or confirmation would be greatly appreciated. Thanks!
Topic: UI Frameworks SubTopic: UIKit
0
0
45
6h
UITabBar Appears During Swipe-Back Gesture on iOS 26 Liquid Glass UI
Hello, While integrating the Liquid Glass UI introduced in iOS 26 into my existing app, I encountered an unexpected issue. My app uses a UITabBarController, where each tab contains a UINavigationController, and the actual content resides in each UIViewController. Typically, I perform navigation using navigationController?.pushViewController(...) and hide the TabBar by setting vc.hidesBottomBarWhenPushed = true when needed. This structure worked perfectly fine prior to iOS 26, and I believe many apps use a similar approach. However, after enabling Liquid Glass UI, a problem occurs. Problem Description From AViewController, I push BViewController with hidesBottomBarWhenPushed = true. BViewController appears, and the TabBar is hidden as expected. When performing a swipe-back gesture, as soon as AViewController becomes visible, the TabBar immediately reappears (likely due to A’s viewWillAppear). The TabBar remains visible for a short moment even if the gesture is canceled — during that time, it is also interactable. Before iOS 26, the TabBar appeared synchronized with AViewController and did not prematurely show during the swipe transition. Tried using the new iOS 18 API: tabBarController?.setTabBarHidden(false, animated: true) It slightly improves the animation behavior, but the issue persists. If hidesBottomBarWhenPushed is now deprecated or discouraged, migrating entirely to setTabBarHidden would require significant refactoring, which is not practical for many existing apps. Is this caused by a misuse of hidesBottomBarWhenPushed, or could this be a regression or design change in iOS 26’s Liquid Glass UI?
Topic: UI Frameworks SubTopic: UIKit Tags:
6
2
596
7h
NSButtons disappear on macOS 26
I have attached 2 images of our Mac Apps user interface. The app is built for macOS 15.6 or newer. On macOS 15 and earlier everything looks fine. But the same App running on macOS 26 the controls disappear. We were able to temporarily resolve the problem by adding UIDesignRequiresCompatibility to the info.plist. This type of nonsense happens all over the app without the compatibility switch. Shouldn't all these legacy controls be backward compatible on Glass? This part of the app where the controls are disappearing is built in Swift (not swift ui) and uses standard programatic layout and visual constraints. On macOS 26, there are no Xcode warnings or layout errors on the console relative to the layout so we are confused as to how we would resolve this without the use of UIDesignRequiresCompatibility. Is this some kind of bug in NSControl glass compatibility? We are not likely to move the entire app into SwiftUI anytime soon. How would we resolve this?
4
0
289
1d
Incorrect system color on popover view, and does not update while switching dark mode on iOS 26 beta 3
All system colors are displayed incorrectly on the popover view. Those are the same views present as a popover in light and dark mode. And those are the same views present as modal. And there is also a problem that when the popover is presented, switching to dark/light mode will not change the appearance. That affected all system apps. The following screenshot is already in dark mode. All those problem are occured on iOS 26 beta 3.
6
0
623
2d
CoreAutoLayout -[NSISEngine _flushPendingRemovals] crash
crash stack: Crashed: com.apple.main-thread 0 libsystem_pthread.dylib 0x90c thread_chkstk_darwin + 60 1 libsystem_pthread.dylib 0x90c ___chkstk_darwin + 60 2 CoreAutoLayout 0x14c4 -[NSISEngine _flushPendingRemovals] + 56 3 CoreAutoLayout 0x2de08 -[NSISEngine _coreReplaceMarker:withMarkerPlusDelta:].cold.1 + 64 4 CoreAutoLayout 0x15d78 -[NSISEngine _coreReplaceMarker:withMarkerPlusDelta:] + 204 5 CoreAutoLayout 0x2ce38 -[NSISEngine constraintDidChangeSuchThatMarker:shouldBeReplacedByMarkerPlusDelta:] + 108 6 CoreAutoLayout 0x15f1c -[NSISEngine tryToChangeConstraintSuchThatMarker:isReplacedByMarkerPlusDelta:undoHandler:] + 100 7 CoreAutoLayout 0x2fdbc -[NSLayoutConstraint _tryToChangeContainerGeometryWithUndoHandler:] + 252 8 CoreAutoLayout 0x3020c -[NSLayoutConstraint _setSymbolicConstant:constant:symbolicConstantMultiplier:] + 452 9 CoreAutoLayout 0x30378 -[NSLayoutConstraint setConstant:] + 84 10 UIKitCore 0x51c3c __74-[UIView(UIConstraintBasedLayout) _autoresizingConstraints_frameDidChange]_block_invoke + 140 11 UIKitCore 0x1841174 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 112 12 UIKitCore 0x51b28 -[UIView(UIConstraintBasedLayout) _autoresizingConstraints_frameDidChange] + 452 13 UIKitCore 0x2c894 -[UIView _constraints_frameDidChange] + 100 14 UIKitCore 0x18fac08 -[UIView(Geometry) setFrame:] + 576 15 UIKitCore 0x96712c -[UITabBar setFrame:] + 128 16 UIKitCore 0x1666f4 -[_UITabBarControllerVisualStyle updateTabBarLayout] + 360 17 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 18 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 19 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 20 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 21 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 22 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 23 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 24 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 25 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 26 UIKitCore 0x16671c -[_UITabBarControllerVisualStyle updateTabBarLayout] + 400 27 UIKitCore 0x16642c -[UITabBarController _prepareTabBar] + 128 28 UIKitCore 0x166a10 -[UITabBarController _layoutContainerView] + 376 29 UIKitCore 0x1677a8 -[UITabBarController __viewWillLayoutSubviews] + 28 30 UIKitCore 0x147078 -[UILayoutContainerView layoutSubviews] + 176 31 UIKit 0xb14a0 -[UILayoutContainerViewAccessibility layoutSubviews] + 60 for a more detail crash stack, can see attach file: crash.txt crash probabilistic happed after app enter background, and our app support landscape, when crash appear, the system method: /* This method is called when the view controller's view's size is changed by its parent (i.e. for the root view controller when its window rotates or is resized). If you override this method, you should either call super to propagate the change to children or manually forward the change to children. */ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator API_AVAILABLE(ios(8.0)); is called; but for a normal not crash case, when enter background and rotate device, the viewWillTransitionToSize method is not called until app enter foreground; Are there any suggestions that can help solve this problem, thank you.
1
0
151
2d
Xcode26+iOS26系统,UICollectionView的reloadData不会触发调用UICollectionViewCell的layoutSubviews方法。
问题场景: Xcode26+iOS26系统,UICollectionView的reloadData不会触发调用UICollectionViewCell的layoutSubviews方法。 正常场景: Xcode26+iOS18及以下系统,UICollectionView的reloadData能够触发调用UICollectionViewCell的layoutSubviews方法。 UITableView的reloadData,会正常调用UITableViewCell的layoutSubviews方法。
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
14
2d
UITabBar ignores font in iOS 26.2
Our app has a UITabBar and the compactInlineLayoutAppearance has a custom font set. This worked fine on iOS 26.0 and 26.1. [self.bottomTabBar.standardAppearance.compactInlineLayoutAppearance.normal setTitleTextAttributes: @{ NSFontAttributeName:[UIFont fontWithName:@"AvenirNext-DemiBold" size:18.0] }]; But on iOS 26.2, the system ignores this custom font. How can I apply a custom font to a UITabBar on iOS 26.2?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
82
3d
CarPlay: AVSpeechUtterance not speaking/playing audio in some cars
I am having an issue with the code that I posted below. I capture voice in my CarPlay app, then allow the user to have it read back to them using AVSpeechUtterance. This works fine on some cars, but many of my beta testers report no audio being played. I have also experienced this in a rental car where the audio was either too quiet or the audio didn't play. Does anyone see any issue with the code that I posted? This is for CarPlay specifically. class CarPlayTextToSpeechService: NSObject, ObservableObject, AVSpeechSynthesizerDelegate { private var speechSynthesizer = AVSpeechSynthesizer() static let shared = CarPlayTextToSpeechService() /// Completion callback private var completionCallback: (() -> Void)? override init() { super.init() speechSynthesizer.delegate = self } func configureAudioSession() { do { try AVAudioSession.sharedInstance().setCategory(.playback, mode: .voicePrompt, options: [.duckOthers, .interruptSpokenAudioAndMixWithOthers, .allowBluetoothHFP]) } catch { print("Failed to set audio session category: \(error.localizedDescription)") } } public func speak(_ text: String, completion: (() -> Void)? = nil) { self.configureAudioSession() // Store the completion callback self.completionCallback = completion Task(priority: .high) { let speechUtterance = AVSpeechUtterance(string: text) let langCode = Locale.preferredLocalLanguageCountryCode if langCode == "en-US" { speechUtterance.voice = AVSpeechSynthesisVoice(identifier: AVSpeechSynthesisVoiceIdentifierAlex) } else { speechUtterance.voice = AVSpeechSynthesisVoice(language: langCode) } try AVAudioSession.sharedInstance().setActive(true, options: .notifyOthersOnDeactivation) speechSynthesizer.speak(speechUtterance) } } func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didFinish utterance: AVSpeechUtterance) { Task { stopSpeech() try AVAudioSession.sharedInstance().setActive(false) } // Call completion callback if available self.completionCallback?() self.completionCallback = nil } func stopSpeech() { speechSynthesizer.stopSpeaking(at: .immediate) } }
1
0
75
5d
UISplitViewController.showDetailViewController() not working in iPhone version.
Since updating to Tahoe and Xcode 26 I have found that the UISplitViewController.showDetailViewController() is not working in the iPhone version of my app (it is a universal app). I'm just trying to show a detail view after a tap on a UITableView item. The iPad versions are all working correctly. Has anyone else experienced this or have any advice about what may have changed? Thanks in advance.
1
0
137
5d
Detecting marked range in UI/NSTextViews at the time of shouldChangeTextIn
We have submitted a feedback for this issue: FB21230723 We're building a note-taking app for iOS and macOS that uses both UITextView and NSTextView. When performing text input that involves a marked range (such as Japanese input) in a UITextView or NSTextView with a UITextViewDelegate or NSTextViewDelegate set, the text view's marked range (markedTextRange / markedRange()) has not yet been updated at the moment when shouldChangeTextIn is invoked. UITextViewDelegate.textView(_:shouldChangeTextIn:replacementText:) NSTextViewDelegate.textView(_:shouldChangeTextIn:replacementString:) The current behavior is this when entering text in Japanese: (same for NSTextView) func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { print(textView.markedTextRange != nil) // prints out false DispatchQueue.main.async { print(textView.markedTextRange != nil) // prints out true } } However, we need the value of markedTextRange right away in order to determine whether to return true or false from this method. Is there any workaround for this issue?
0
0
67
5d
Paste button on navigation bar is not shown on iOS/iPadOS 26
The Paste button (using UIPasteControll) located on UINavigationBar is not shown at application startup on iOS/iPadOS 26. This issue will disappear when device is rotated or window size is changed. And this issue does not occur on iOS / iPadOS 18 and earlier. I uploaded the sample project to github at the following URL. https://github.com/gpn-galapagos/PasteButtonApp.git Has anyone had the same issue or knows a workaround?
0
0
141
6d
WatchOS version lower than deployment target in Xcode 26
Description: I’m encountering an issue where the Apple Watch’s watchOS version is lower than the deployment target specified in my Xcode project. For example, my Watch device is running watchOS 10.6, but my app’s deployment target is set to watchOS 9.6 or 10.6, and Xcode shows an error stating: Error: “watchOS version doesn’t match the app’s deployment target.” Could someone clarify how to properly handle this version mismatch? Environment: Xcode 26 iPhone: iOS 18 Apple Watch: watchOS 10.6 Any guidance or best practices would be appreciated.
8
2
289
6d
tvOS Focus Halo Does Not Respect cornerRadius on UIImageView
The Problem When using adjustsImageWhenAncestorFocused = true on a UIImageView in tvOS, the native focus halo effect does not respect the cornerRadius property set on the image view's layer. The image itself correctly clips to the rounded corners, but the focus halo (the glowing outline that appears when the view is focused) always renders with square or nearly-square corners. Code Example let imageView = UIImageView() imageView.layer.cornerRadius = 60 imageView.clipsToBounds = true imageView.adjustsImageWhenAncestorFocused = true imageView.image = posterImage Result: The poster image displays with 60pt rounded corners as expected, but when focused, the halo effect has square corners - creating an obvious visual mismatch. Expected Behavior The focus halo should follow the same cornerRadius as the UIImageView. If I set a 60pt corner radius, both the image and its focus halo should have matching 60pt rounded corners. Actual Behavior The image respects cornerRadius and displays with rounded corners The focus halo ignores cornerRadius and renders with square corners This creates an inconsistent, unpolished appearance Environment tvOS 16.0+ (tested through tvOS 18) Affects both Apple TV Simulator and physical devices Occurs with any corner radius value above approximately 20-30pt Use Case This is a common scenario for media streaming apps. Movie and TV show poster cards typically use rounded corners (40-80pt) as part of modern UI design. Many apps like Netflix, Plex, and others use this design pattern. The current behavior forces developers to choose between: Using the beautiful native focus effect but with mismatched square halos Implementing a completely custom focus effect from scratch, losing the native parallax, shadow, and halo animations Neither option is ideal. What I've Tried Setting cornerRadius before and after adjustsImageWhenAncestorFocused Different clipsToBounds configurations Wrapping the image view in a container view with corner radius Using layer.maskedCorners to specify which corners to round Subclassing CALayer to intercept sublayers added by the focus system None of these approaches affect the focus halo's corner radius. Request I would appreciate guidance on any of the following: Is there a supported way to customize the focus halo's corner radius? The UIFocusHaloEffect class exists on iOS/iPadOS but is not available on tvOS. Is this a bug that will be addressed? The focus system clearly reads some properties from the image view (like bounds), so it seems like cornerRadius should also be respected. Is there a different API I should be using? Perhaps there's an alternative approach to achieve rounded corner poster cards with matching focus effects that I'm not aware of. Additional Context I've noticed that some third-party apps have achieved this effect, suggesting it may be possible through undocumented means. However, I would prefer to use a public, supported API to ensure compatibility with future tvOS updates. Any guidance from Apple engineers or developers who have solved this would be greatly appreciated. Thank you.
Topic: UI Frameworks SubTopic: UIKit
0
0
81
6d
Unwanted animations appear on UIButton (iOS 26)
After the iOS 26 update, unwanted animations appear on UIButton. I'm using the attributedTitle property of UIButton.Configuration to change the button's text, and an animation appears after iOS 26. (It's unclear whether it's after iOS 26.0 or iOS 26.1, but it likely started with 26.1.) The peculiar thing is that the animation only starts appearing on buttons that have been pressed once. I tried using UIView.performWithoutAnimation and CATransaction's begin(), setDisableActions(true), commit(), but it didn't work. How should I solve this? Below is the code for changing the button's text. func updateTitle() { let keys = type.keys if keys.count == 1 { guard let key = keys.first else { return } if key.count == 1 { if Character(key).isLowercase { self.configuration?.attributedTitle = AttributedString(key, attributes: AttributeContainer([.font: UIFont.systemFont(ofSize: 24, weight: .regular), .foregroundColor: UIColor.label])) } else if Character(key).isUppercase { self.configuration?.attributedTitle = AttributedString(key, attributes: AttributeContainer([.font: UIFont.systemFont(ofSize: 22, weight: .regular), .foregroundColor: UIColor.label])) } else { self.configuration?.attributedTitle = AttributedString(key, attributes: AttributeContainer([.font: UIFont.systemFont(ofSize: 22, weight: .regular), .foregroundColor: UIColor.label])) } } else { self.configuration?.attributedTitle = AttributedString(key, attributes: AttributeContainer([.font: UIFont.systemFont(ofSize: 18, weight: .regular), .foregroundColor: UIColor.label])) } } else { let joined = keys.joined(separator: "") self.configuration?.attributedTitle = AttributedString(joined, attributes: AttributeContainer([.font: UIFont.systemFont(ofSize: 22, weight: .regular), .foregroundColor: UIColor.label])) } }
1
0
113
6d
iOS 14.3 UITextField leak?
Why is the UIKeyboard implementation still holding a reference to this UITextField, thus keeping it from being deallocated? The memory debugger shows: UIKeyboardImpl -> UIKBAutofillController -> NSMutableDictionary -> NSMutable...(Storage) -> UITextField Any idea what's going on there?
Topic: UI Frameworks SubTopic: UIKit Tags:
5
3
2.6k
6d
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.
0
2
40
6d
UISplitViewController and setViewController:forColumn: differences between different iOS versions
It seems to be that the functionality of the method setViewController:forColumn: in the column-style layout of a UISplitViewController has changed. iOS 18: setViewController:forColumn: pushes a new view controller onto the UINavigationController if it existed before the call. iOS 26: setViewController:forColumn: sets or replaces the view controller with a new view controller as a root of a new UINavigationController. My questions: what is the intended behavior? I did not find any documentation about a change. how do I replace in iOS 18 the old view controller with the new view controller passed to setViewController:forColumn:?
0
0
136
1w
Keyboard Notification UIKit magic.
Dear random Apple UIKit engineer. This is a question for you. Today let's speak about keyboard notifications. In particular, UIResponder.keyboardWillShowNotification and UIResponder.keyboardWillHideNotification. While working with those, I noticed some undocumented behaviour. First, let me give you some context: extension UIViewController { func registerForKeyboardNotifications() { NotificationCenter.default.addObserver(self, selector: #selector(keyboardNotification), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardNotification), name: UIResponder.keyboardWillHideNotification, object: nil) } /// Override this method to handle keyboard notifications. @objc func keyboardNotification(_ notification: Notification) { ... } } Eventually, I found that latter method with 3 dots has an implicit animation inside it's scope. Here is the [proof.](https://medium.com /uptech-team/why-does-uiresponder-keyboard-notification-handler-animate-10cc96bce372) Another thing I noticed, is that this property definition is perfectly valid let curve = UIView.AnimationCurve(rawValue: 7)!. The 7 btw comes from UIResponder.keyboardAnimationCurveUserInfoKey as a default value during my tests. So, the enum with 4 possible values (0...3) can be initialized with a value out of enum's cases range. Also, how can I initialize UIView.AnimationOption from 7? I will pollute my OptionSet which I feed to options parameter on UIView.animate(...) My questions: Why implicit animation is not documented and can I trust it or it's a subject to change. Why UIView.AnimationCurve(rawValue: 7)! does not crash. How can I convert UIResponder.keyboardAnimationCurveUserInfoKey's value into UIView.AnimationOption properly if I don't want to use implicit value. I don't encroach on UIKit secrets. I just need to know how to work with the API. Thank you!
3
2
1.3k
1w