An app built on Xcode 26 (beta4) presents various UIViewCOntrollers. Presentation of any UIViewController that contains a UIToolbar leads to a UIKit crash when run on an iOS 18.5 device, it does not crash when run on iOS 26.
The exception logged:
*** 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)'
Anyone else seen this?
I've submitted a bug report via Feedback Assistant, including a minimal Xcode workspace that reproduces the crash, hoping this will get some attention.
UIKit
RSS for tagConstruct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
According to the WWDC25 Presentation Track workouts with HealthKit on iOS and iPadOS, there is supposed to be a new property for restoring an active workout after a crash on iOS/iPadOS. The developer documentation also supports this. However, this property does not seem to exist in the latest Xcode 26 beta, even in projects targeting iOS 26.0 as the minimum version.
Am I missing something? Has this property not been made available yet? It is actually looking like all of the new iOS 26.0 properties are missing UIScene.ConnectionOptions on my system.
Hi,
I’m seeing a crash when running my app on iOS 18 simulators or devices using Xcode 26 beta 3.
My app’s minimum deployment target is iOS 17, and the crash does not happen when running from Xcode 16.4.
The crash occurs specifically at this line:
return UIStoryboard(name: storyboard.rawValue, bundle: nil)
.instantiateViewController(withIdentifier: view.rawValue)
Crash Details:
** 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)'
*** First throw call stack:
(0x191c3321c 0x18f0cdabc 0x191c91ea0 0x19d740774 0x19d740a18 0x19d740cac 0x194626680 0x194dbc784 0x19d740890 0x19d740cac 0x1949aadd8 0x19d740890 0x19d740a18 0x19d740cac 0x194802e24 0x1945f008c 0x194ed1808 0x107a8bfa0 0x107a8c05c 0x1945ec128 0x19d740890 0x19d740cac 0x1945eba60 0x19d740890 0x19d740a18 0x19d740cac 0x1945f07dc 0x1945eaea4 0x19492ee80 0x10763de00 0x1076e56fc 0x1076e5674 0x1076e5e04 0x19496108c 0x194f9b9a0 0x1949072c4 0x194f998cc 0x194f9af04 0x19445139c 0x19445ac28 0x194467508 0x1079afaec 0x1079aff5c 0x1944189a0 0x194417be4 0x1944114e4 0x194411404 0x194410ab4 0x19440c1e4 0x191b28a8c 0x191b288a4 0x191b28700 0x191b29080 0x191b2ac3c 0x1ded09454 0x19453d274 0x194508a28 0x1073564f4 0x1b89fff08)
terminating due to uncaught exception of type NSException
The crash occurs immediately at app launch, when attempting to load a storyboard-based UITabBarController.
Works as expected on:
Xcode 16.4 + iOS 18 (simulator/device)
Xcode 26 beta 3 + iOS 26 (simulator/device)
Running from Xcode 26 beta 3 onto iOS 18 simulators or devices and it immediate crash from the particular storyboard
Setup:
Xcode: 26 beta 3
macOS: 15.5
iOS Simulators: iOS 18.5
Minimum deployment target: iOS 17
UIKit-based app (not using SwiftUI)
No custom toolbars or host views in use explicitly
Is this a known compatibility issue when building with the iOS 26 SDK and running on iOS 18?
Are there any workarounds or recommendations for running apps targeting iOS 17+ on iOS 18 simulators when using Xcode 26?
Hi everyone!
My Apple Watch app has relied for years on the WKApplication.scheduleBackgroundRefresh(...) method to keep the app updated in the background. The system would reliably trigger WKApplicationDelegate.handle(_:), where I would then schedule the next refresh task (usually 15 minutes later).
As stated in the documentation, as long as there is a complication on the watch face, these background tasks should run at a relatively stable frequency.
However, this approach seems to have stopped working on watchOS 26. I no longer receive any WKApplicationRefreshBackgroundTask at all. Has anyone else experienced this issue?
A bottom accessory view is set on the UITabBarController. When changing the window size either by dragging the resizing grip or when going to portrait mode, the accessory view shrinks down to the smaller width. When resizing the window to make it larger, the accessory view doesn’t resize to the full available width.
During a workshop setup by Apple, folks from Apple told me that the view set as the content view of the UITabAccessory should not have its frame changed, either by using Auto Layout or by setting the frame. It seems logical since the view in the bottom accessory is supposed to resize accordingly to several factors, like when going inline inside the tab bar.
Am I missing something? Maybe there is additional setup required not mentioned in the dedicated video.
Feedback is FB19017330. It contains a sample project and videos demonstrating the issue. Reproduced on Xcode 26 beta 6 (17A5305f)
I copy and paste the sample code that setups the bottom accessory for good measure.
final class MiniPlayer: UIView {
let label = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
label.text = "Mini Player"
label.numberOfLines = 0
label.textAlignment = .center
addSubview(label)
label.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
label.centerXAnchor.constraint(equalTo: centerXAnchor),
label.centerYAnchor.constraint(equalTo: centerYAnchor)
])
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
// MARK: - View Controller
class ViewController: UIViewController {
let rootTabBarController = UITabBarController()
let miniPlayer = MiniPlayer()
override func viewDidLoad() {
super.viewDidLoad()
let items: [UITab] = [
UITab(title: "Tab 1", image: UIImage(systemName: "archivebox.fill"), identifier: "tab-1") { _ in
UIViewController()
},
UITab(title: "Tab 2", image: UIImage(systemName: "books.vertical.fill"), identifier: "tab-2") { _ in
UIViewController()
},
UISearchTab { _ in
UIViewController()
}
]
rootTabBarController.tabs = items
rootTabBarController.view.backgroundColor = .secondarySystemBackground
view.addSubview(rootTabBarController.view)
rootTabBarController.view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
rootTabBarController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
rootTabBarController.view.topAnchor.constraint(equalTo: view.topAnchor),
rootTabBarController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
rootTabBarController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor)
])
rootTabBarController.bottomAccessory = UITabAccessory(contentView: miniPlayer)
}
}
I tried playing with SF Symbols variable value draw from the first iOS 26 beta and it has never been working, whereas the SwiftUI version works properly.
I just copied and pasted the code from the related video What’s new in SF Symbols 7 and it simply doesn't work (screenshot attached). Full view controller code is at the end of the post.
imageView.image = UIImage(systemName: "thermometer.high", variableValue: 0.5)
imageView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(variableValueMode: .draw)
Am I missing something? Or is it still not ready? I reproduced the issue with Xcode 26 beta 6 (17A5305f). The release candidates are approaching fast and I am worried this will not be working by then.
The feedback ID is FB18898182.
class ViewController: UIViewController {
let imageView = UIImageView()
override func viewDidLoad() {
super.viewDidLoad()
imageView.image = UIImage(systemName: "thermometer.high", variableValue: 0.5)
imageView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(variableValueMode: .draw)
.applying(UIImage.SymbolConfiguration(font: .systemFont(ofSize: 40)))
view.addSubview(imageView)
imageView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
imageView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor)
])
}
}
@MainActor
class KeyboardObserver {
var token: NotificationCenter.ObservationToken!
func registerObserver(screen: UIScreen) {
let center = NotificationCenter.default
token = center.addObserver(of: screen, for: .keyboardWillShow) { keyboardState in
print("+++ Keyboard showed up!")
}
}
}
The notification is never called.
The sample code from the sessions also does not work for me.
let keyboardObserver = NotificationCenter.default.addObserver(
of: UIScreen.self
for: .keyboardWillShow
) { message in
UIView.animate(
withDuration: message.animationDuration, delay: 0, options: .flushUpdates
) {
// Use message.endFrame to animate the layout of views with the keyboard
let keyboardOverlap = view.bounds.maxY - message.endFrame.minY
bottomConstraint.constant = keyboardOverlap
}
}
@MainActor
class KeyboardObserver {
func registerObserver(screen: UIScreen) {
let center = NotificationCenter.default
let token = center.addObserver(
of: screen,
for: .keyboardWillShow
) { keyboardState in
let startFrame = keyboardState.startFrame
let endFrame = keyboardState.endFrame
self.keyboardWillShow(startFrame: startFrame, endFrame: endFrame)
}
}
func keyboardWillShow(startFrame: CGRect, endFrame: CGRect) {}
}
I’m trying to detect a double-tap action on a UIButton. There seem to be two possible approaches:
Using a UITapGestureRecognizer with numberOfTapsRequired = 2.
Using the .touchDownRepeat event of UIControl.Event.
What is the recommended approach for reliably handling double-taps on UIButton? Are there any practical differences in terms of behavior, performance, or best practices between these two methods?
Additionally, I noticed that UIControl.Event defines a large set of events (like .editingChanged, .valueChanged, etc.).
Can all these events be applied to any UIControl subclass such as UIButton, or are they only valid for specific controls like UITextField, UISlider, etc.?
If not all events are supported by all controls, what is the rationale behind exposing them under a shared UIControl.Event enum?
Thanks in advance!
The default cell height is 44pt in iOS 18 and 52pt in iOS 26. I'm trying to reduce the height back to 44pt in one screen that needs to fit as much content on screen as possible. How do you do that when using UIListContentConfiguration?
I expected this would do the trick but alas it doesn't reduce the cell height.
let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, Item> { cell, indexPath, item in
cell.contentConfiguration = {
var config = UIListContentConfiguration.valueCell()
config.text = "Title"
config.secondaryText = "Value"
// This only removes horizontal margins, does not change vertical margins
config.axesPreservingSuperviewLayoutMargins = []
config.directionalLayoutMargins = .zero
return config
}()
}
In iOS 26 beta 3, it was possible to have a UIScrollEdgeElementContainerInteraction work with a WKWebView's scroll view. But it stopped working in beta 4, and is still broken in beta 5 today. Is this expected? Or is this a bug that will be fixed before public release?
Filed as FB19386650 with a trivial sample app.
On iPhone SE (2nd/3rd generation) running iOS 26 beta , the safeAreaInsets.top unexpectedly returns 0 instead of the expected 20 points, causing UI elements that rely on safe area layout to be overlapped by the status bar.
You can see that i works fine with iOS 18, whereas iOS 26 the status bar is overlapped. Is this a known bug or there is new API changes that I might not be aware of.
The isEnabled property on UITabBarItem no longer disables tab bar items as expected in iOS 26. Setting tabBarItem.isEnabled = false on a view controller has no visual or functional effect - the tab remains interactive and doesn't show the disabled state.
Topic:
UI Frameworks
SubTopic:
UIKit
I’m working with UIButton and I’d like to register multiple UIControl.Events (e.g. .touchUpInside, .touchDown, .touchCancel, .primaryActionTriggered) using the same selector.
For example:
button.addTarget(self,
action: #selector(handleButtonEvent(_:forEvent:)),
for: [.touchUpInside, .touchDown, .touchCancel, .primaryActionTriggered])
@objc func handleButtonEvent(_ sender: UIButton, forEvent event: UIEvent) {
// How do I tell which UIControl.Event triggered this?
}
From my understanding:
If I use the single-parameter version (@objc func handleButtonEvent(_ sender: UIButton)), I can’t distinguish which event fired.
If I use the two-parameter version with UIEvent, I can inspect touch.phase or event.type, but that feels indirect.
Questions:
Is there a recommended way to directly know which UIControl.Event caused the selector to fire?
Is sharing a single selector across multiple control events considered a good practice, or is it more common to register separate selectors per event?
Would appreciate guidance on what Apple recommends here.
I’m working with UIButton and finding different examples for event handling. Currently, I have a single action method like this, which receives the sender and the UIEvent:
@objc func buttonHandler(_ sender: UIButton, forEvent event: UIEvent) {
if let touches = event.allTouches, let touch = touches.first {
switch touch.phase {
case .began: print("TouchDown")
case .ended:
if sender.bounds.contains(touch.location(in: sender)) {
print("TouchUpInside")
} else {
print("TouchUpOutside")
}
case .cancelled: print("TouchCancel")
default: break
}
}
if event.type == .presses {
print("PrimaryActionTriggered")
}
}
Is this considered best/recommended practice in UIKit, or should I use separate selector methods for each event type (e.g. .touchDown, .touchUpInside, .touchUpOutside) using addTarget(_:action:for:)?
Are there any advantages or disadvantages to using a single handler with UIEvent versus multiple selectors for UIControlEvents?
Thanks in advance!
I'm using a standard UITabBarController on iPad. When first selecting any tab, the corresponding menu bar items are grayed out for this view controller. It's only when I tap any button in that view controller, like in the toolbar, that the view controller truly becomes the first responder (you can see the sidebar selection turns to gray from blue), enabling those menu bar items.
Am I doing something wrong here?
A video of the issue can be found here: https://mastodon.social/@nicoreese/114949924393554961
AppDelegate:
...
builder.insertChild(MenuController.viewModeMenu(), atStartOfMenu: .view)
class func viewModeMenu() -> UIMenu {
let listViewModeCommand = UICommand(
title: String(localized: "As List"),
image: UIImage(systemName: "list.bullet"),
action: #selector(GamesViewController.setListViewMode),
propertyList: SettingsService.ViewMode.list.rawValue
)
...
let viewModeMenu = UIMenu(
title: "",
image: nil,
identifier: .viewModeMenu,
options: .displayInline,
children: [listViewModeCommand...]
)
return viewModeMenu
}
GamesViewController:
@objc
func setListViewMode() {
updateViewMode(.list)
}
I can do this, but then the sidebar selection instantly turns gray, which looks odd and other system apps do not behave this way.
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
becomeFirstResponder()
}
override var canBecomeFirstResponder: Bool {
return true
}
I'm using multiple scenes in my iPad app.
When I open a new scene from my main window, that new window is always the same size as the previous window.
When I make the main window very small and then create a new scene, that new window is also tiny. When I make the main window very big, you guessed it.
UIWindowScene.sizeRestrictions does not seem to help here. How can I give new windows a default size (it's okay if they're resizable after presenting)? This is such a weird behavior.
Video of the problem in action: https://mastodon.social/@nicoreese/115033539035249909
It appears from my testing that the following is true:
If you close all windows of an app, the app terminates entirely. Minimizing the last window sends it into multitasking. This is different from previous behavior and might have implications on your app's logic.
If you close the last window and quickly tap the app icon again, that same window will come back. Waiting a second before tapping the app icon will bring up the main window (likely because by that point the app was terminated and relaunched).
Is this expected behavior? I did not see any announcement of this.
I find this a bit counterintuitive and would presume that closing the last window would just send the app to multitasking, just like previously. Quitting the app should be reserved by swiping up on it in the multitasking UI or with a new context menu command.
A UISegmentedControl as a UIBarButtonItem (customView) is ignoring selectedSegmentTintColor on iOS 26, works fine on prior versions
I've submitted FB19660941 with a minimal Xcode workspace to reproduce the issue.
Has anyone else seen this and identified a workaround?
Woke up to see my table gone. Whoa. What happened. FB19400940
Commenting this line in viewDidLoad or changing to softStyle brings it back.
[self.tableView.topEdgeEffect setStyle:[UIScrollEdgeEffectStyle hardStyle]];
Videos in attached fb.
Can anyone show a simple code snippet about the usage of this property?
I tried to create a UIWindow inside the main window, and set the canResizeToFitContent to true. However, when I added to it some sub view, the sub view didn't fit into the UIWindow. Actually, this sub view was located in another place far away from the UIWindow I created.
Additionally, The documentation says, the content should be constraint-based. What does 'constraint-based' mean?
Topic:
UI Frameworks
SubTopic:
UIKit