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

PHPickerViewController: UI rendering failure and data retrieval errors on iOS 17 & 26.4
Description: I am encountering critical issues with PHPickerViewController using the "Zero-Permission" configuration. The behavior differs significantly between iOS 17 and iOS 26.4, but both prevent successful image selection. Observed Behaviors: On iOS 26.4 (iPhone 17 Pro Max): The PHPicker UI fails to render the photo grid entirely. Upon initialization, the system UI displays an "Unable to load photo" alert, preventing users from even viewing or selecting images. On iOS 17: The picker UI loads, but after the user selects an image and adds it, the subsequent itemProvider.loadObject call consistently fails, returning an error and preventing our app from retrieving the image data. Current Implementation: var config = PHPickerConfiguration() config.filter = .images config.selectionLimit = pickLimit // Problematic logic: if ABTestManager.shared.isPHPickerCurrent { config.preferredAssetRepresentationMode = .current } let pickerVC = PHPickerViewController(configuration: config) pickerVC.delegate = self user device Images: What I have tested: I have been using preferredAssetRepresentationMode = .current in my AB tests. I have not yet tested .compatible mode, as my application logic requires access to high-fidelity assets. However, the current behavior suggests a regression or a fundamental incompatibility with how the system handles image containers for high-end hardware (e.g., iPhone 17 Pro Max) in the out-of-process picker. Supporting Documentation: Minimal Reproducible Project: [Attached] Logs: [Attached sysdiagnose logs] My Questions: Is the "Unable to load photo" UI failure on iOS 26.4 a known limitation for certain high-resolution asset types when using .current mode? Are there specific handling requirements for NSItemProvider when the system fails to resolve the image data in .current mode on older iOS 17 devices? Given that these failures occur in a "Zero-Permission" context, are there specific metadata or image processing constraints I should be aware of to prevent the picker from entering a "failed" state?
1
0
26
5h
Horizontal Size Classes on iPhone in iOS 27
In iOS 27, willTransition(to:with:), registerForTraitChanges(), and other mechanisms to monitor size classes do not change when an iPhone interface is resized. Only viewWillTransition(to:with:) is invoked with a new size. And this only happens on the iPhone: the iPad continues to work as it has in the past. It appears that this is intended behavior. That is not to say that it's intuitive behavior. Many experienced developers are encountering the "horizontal size is always compact" behavior and immediately thinking "this must be a beta bug": https://fatbobman.com/en/posts/from-size-class-to-available-space/ But it's not. I get that the new size class behavior is expressing static device semantics and is no longer a dynamic size indicator. The problem is that the tools we have been using to build layouts for the past decade use size classes as dynamic sizing indicators. Storyboards can contain variations that specify whether a constraint is used for regular or compact widths/ heights. Developers have used this ability to automatically adjust layouts as the size classes change. In one case, I use this capability to adjust a top-over-bottom layout in a portrait configuration to a side-by-side in a landscape configuration: switching centering, leading/trailing, and aspect ratios to fit the available size. I suspect that many developers who have taken the time to create a unique layout for an iPad are doing something similar. (Ironically, the folks who treated an iPad as a big iPhone are the ones least affected by this change.) When iPadOS got the ability to resize interfaces (as UIScene windows), I made sure that the automatic size class contraints worked correctly and made adjustments as necessary. That work now has to be discarded and switched over to something more universal. If this is truly the intended behavior going forward, time needs to be invested in updating the tooling behind automatic constraint variations: There should be warnings when the storyboard is compiled. I have dozens of automatic contraints embedded in the storyboard: and they're hard to find (each subview has its own contraints, so it's a manual traversal of a huge tree). There should be runtime warnings that your code that inspects size classes won't be executed. This was the biggest "what the hell is going on?" when trying to resize the interface the first time. At a higher level, Apple engineers have described what is happening. They have not explained why the iPhone is behaving differently than an iPad. And that's the root of this whole situation being unintuitive. We've got no clue. And developers without a clue are unlikely to adopt a new technology. It's essential that Apple explains this change in more detail. Yes, you're going to have to obfuscate it and make us read between the lines, but it's got to be done. (Everyone understands the changes regarding mainScreen wink wink, for example.) A reply in this thread would be a good place to start this explanation.
4
5
534
23h
Customise UITabBar on iPadOS 26+
I'm building an app with a UISplitViewController as the base, with the main content being a UITabBarController. I'm targeting iOS 26+ and using UIKit. I've customised the tabbar on iOS to have a different font family and size, and used some custom images. Running the same app on iPad, the tabbar moves to the top of the screen, ignores ALL the appearance proxy settings and strips out the images. Its now just giant floating text. Also noticed in portrait mode when the side bar from the split view is open, it compresses the width of the tab bar down to only show 2 elements at a time, with this weird custom scroll thing to move to the rest of the tabs. If the text wasn't so massive, maybe it could fit more. I really hate every inch of this thing. Its looks ugly and functions bizarrely. Why does it ignore all the tabbar appearance settings, and how can I customise it to add icons back with smaller text? Ideally I don't want to use one of the hacks to force it to think its compact mode to bring back the old tabbar, as i'm relying on traits already to fix some SplitView annoyances and don't want those to break. But would love to have the old tab bar style. Are there any settings or toggles that I can use?
0
0
41
2d
UIRequiresFullScreen Deprecation
I work on a universal app that targets both iPhone and iPad. Our iPad app currently requires full screen. When testing on the latest iPadOS 26 beta, we see the following warning printed to the console: Update the Info.plist: 1) `UIRequiresFullScreen` will soon be ignored. 2) Support for all orientations will soon be required. It will take a fair amount of effort to update our app to properly support presentation in a resizable window. We wanted to gauge how urgent this change is. Our testing has shown that iPadOS 26 supports our app in a non-resizable window. Can someone from Apple provide any guidance as to how soon “soon” is? Will UIRequiresFullScreen be ignored in iPadOS 26? Will support for all orientations be required in iPadOS 26?
11
4
2.1k
2d
UserDefaults, UIApplicationDelegate, and prewarming
For a UIKit app based on scenes (UIScene), is it safe to reference UserDefaults in code that is executed from UIApplicationDelegate/application(_: didFinishLaunchingWithOptions:) ? I've read that in iOS 15, there were undocumented scenarios involving app prewarming that would cause UserDefaults reads to fail within a window of time after device reboots, as described at https://christianselig.com/2024/10/beware-userdefaults/ The failure mode is that an app would be released, and months later, a small fraction of users would report failures consistent with UserDefaults reads unexpectedly returning nil, causing a loss of data. The user experience is bad, and debugging this behavior is then challenging because of how rarely it occurs. Apple's https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence#3894431 seems to suggest that prewarming only executes an app "up until, but not including when main() calls UIApplicationMain(_:_:_:_:), but https://stackoverflow.com/questions/71025205/ios-15-prewarming-causing-appwilllaunch-method-when-prewarm-is-done documents that UIApplicationDelegate/application(_: didFinishLaunchingWithOptions:) has in fact been observed executing during app prewarming in scene-based apps. So, my question: In an app based on scenes, if I'd like to reference UserDefaults within UIApplicationDelegate/application(_: didFinishLaunchingWithOptions:), when is it safe to do this? I'm guessing the answer is one of these: Never. Only in apps that don't support scenes. Only in iOS 16 or later. Only in IOS 17 or later. Is it guaranteed safe to reference UserDefaults in UIWindowSceneDelegate/scene(_:willConnectTo:options:) or later? Is there documentation from Apple regarding this issue? Thank you.
3
2
772
2d
UINavigationItemRenameDelegate does not work in IOS 16
I have an iPad app which is trying to support document renaming in the title bar. For IOS 17+ I set the renameDelegate to the document instance and it works fine. For IOS 16 I need to create an actual delegate, but no matter how I structure the code it fails with a permission error: Rename failed: “original_file_name” couldn’t be moved because you don’t have permission to access “Desktop”. It seems to always happen accessing the parent directory. I have tried using the file coordinator as well with the same result. It seems impossible to implement unless the callback contains a security permissioned url for the parent directory. Is there anyway to make this work in IOS 16 in the sandbox? Do I have to create my own rename functionality using a FilePicker? Seems like this should be built in like it is in MacOS, or even IOS17+ Here is the code: extension DocumentWindow : UINavigationItemRenameDelegate { func navigationItem(_ navigationItem: UINavigationItem, didEndRenamingWith title: String) { guard let doc = document else { return } let oldURL = doc.fileURL let newURL = oldURL.deletingLastPathComponent() .appendingPathComponent(title) .appendingPathExtension(oldURL.pathExtension) if newURL == oldURL { return } let access = oldURL.startAccessingSecurityScopedResource() defer { if access { oldURL.stopAccessingSecurityScopedResource() }} do { try FileManager.default.moveItem(at: oldURL, to: newURL) } catch { print("Rename failed: \(error.localizedDescription)") } // // // 1. Jump to a background queue to avoid the deadlock // DispatchQueue.global(qos: .userInitiated).async { // let coordinator = NSFileCoordinator(filePresenter: doc) // var error: NSError? // // // coordinator.coordinate(writingItemAt: oldURL, error: &error) { outOld in // do { // // 2. Perform the actual rename // try FileManager.default.moveItem(at: outOLD, to: newURL) // } catch { // print("Rename failed: \(error.localizedDescription)") // } // } // // if let error = error { // print("Coordination error: \(error.localizedDescription)") // } // } } // 2. Optional: Validation (e.g., prevent empty names) func navigationItem(_ navigationItem: UINavigationItem, shouldEndRenamingWith title: String) -> Bool { return !title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } }
0
0
37
2d
FB16862332 (iOS 18.3 REGRESSION: UIDocumentViewController: Placeholder icon displayed instead of document icon in share menu item of document title menu)
Anyone else seeing this? I reported the regression back in March 2025 and have no reply from Apple. My apps are Obj-C, in case it matters. DESCRIPTION After updating to iOS 18.3.x, | noticed a regression in the title menu behavior of my UlDocumentViewController-based shipping apps on the App Store [1]: Instead of displaying the document icon supplied by the app, the share menu item displays a placeholder icon instead, and iconservicesagent error messages are emitted in the log stream [2]. STEPS TO REPRODUCE Install one of the apps from note [1] below. Launch the app, tap the document/title menu at top center of the screen, and observe first menu item. RESULTS Expected: App-provided document icon displayed to left of first menu item ("W-1" or "W68" document icon). Actual: Placeholder icon displayed. REGRESSION Occurs: iOS 18.3 (iPad) iOS 18.3.1 (iPhone) iOS 18.3.2 (iPhone) Does Not Occur: iOS 18.2,18.3 Simulator iOS 18.0-18.2? [| no longer have a device with < 18.3 to confirm regression point] NOTES: [1] WOZNIAC-1 <https://apps.apple.com/us/ app/wozniac-1/id6474085354> and WOZNIAC-68 <https://apps.apple.com/us/app/ wozniac-68/id6736677781>. [2] When the problem occurs, the following log messages are omitted: Error returned from iconservicesagent image request: <|STagIcon: 0x30299c040> Tag: alvm, Class: public.filename-extension, Base type: public.item - <|SImageDescriptor: Ox300dd5860> - (37.00, 48.00)@3x v:40000 1:5 a: 0:0:0:0 t:() b:0 s:2 ps:0 digest: 0D3223D0-9AЕ3-3B19-A081-ACACE55691B7 error: Error Domain=NSOSStatusErrorDomain Code=-609 "Client is disallowed from making such an icon request" UserInfo={NSLocalizedDescription=Client is disallowed from making such an icon request}
Topic: UI Frameworks SubTopic: UIKit
5
2
284
2d
iOS app crashes in CoreGraphics with upscale_provider_get_bytes_at_position_inner when rendering images using the Texture library
Issue Description: On iOS 26 and later, a CoreGraphics crash occurs when rendering images using -[UIImage drawInRect:blendMode:alpha:]. Based on the call stack, the crash happens inside CoreGraphics. Under what circumstances does the function upscale_provider_get_bytes_at_position_inner in the stack get called? When attempting to reproduce locally, this code path is never reached even when scaling images. Steps to Reproduce: There are a large number of crash reports in production, but the issue cannot be reproduced locally/offline. Expected Results: Explain under what conditions calling -[UIImage drawInRect:blendMode:alpha:] will reach the upscale_provider_get_bytes_at_position_inner logic. Ideally, provide a code example or demo. Provide the root cause of the crash and a workaround/mitigation. Current Behavior: Calling -[UIImage drawInRect:blendMode:alpha:] causes intermittent crashes in production. Xcode Version Used: Xcode Version 26.0 (17A324)
0
0
45
3d
EKEventEditViewController broken in iOS 27 Beta
UIKit app can not edit an event using EKEventEditViewController in iOS 27 Betas. The Done tick button at the top does not work after editing an event. Also does not work if EKEventViewController is first used to display the event. Then the "Edit" tapped to display the EKEventEditViewController. Anyone else seeing this?
1
0
33
4d
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.
18
1
2.4k
4d
SSScreenshotMetadataHarvester app termination
Hi team, We are seeing a high volume of app terminations (uANRs), with most of them sharing the attached stack trace. I’d love to get your input on potential workarounds or fixes we can explore to mitigate this issue. 0 CoreFoundation -[__NSSingleObjectArrayI countByEnumeratingWithState:objects:count:] + 132 1 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 228 2 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 3 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 4 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 5 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 6 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 7 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 8 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 9 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 10 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 11 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 12 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 13 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 14 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 15 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 16 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 17 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 18 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 19 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 20 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 21 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 22 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 23 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 24 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 25 ScreenshotServices +[SSScreenshotMetadataHarvester _contentRectsForMetadata] + 216 26 ScreenshotServices +[SSScreenshotMetadataHarvester harvestScreenshotMetadataAndRespondToAction:] + 628 27 UIKitCore -[UIScreenshotMetadataRequestAction fulfillRequest] + 180 28 UIKitCore -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 3432 29 UIKitCore -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 412 30 UIKitCore -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 31 UIKitCore -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 32 FrontBoardServices __76-[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.146 (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 252 33 FrontBoardServices -[FBSScene _callOutQueue_coalesceClientSettingsUpdates:] + 68 34 FrontBoardServices -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 712 35 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 148 36 FrontBoardServices -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 37 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke.cold.1 + 252 38 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 184 39 libdispatch.dylib _dispatch_client_callout + 16 40 libdispatch.dylib _dispatch_block_invoke_direct + 284 41 FrontBoardServices __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 52 42 FrontBoardServices -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 240 43 FrontBoardServices -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 28 44 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ (in ae3c9338-0166-397a-9643-356b14f6ee58) + 28 45 CoreFoundation __CFRunLoopDoSource0 (in ae3c9338-0166-397a-9643-356b14f6ee58) + 172 46 CoreFoundation __CFRunLoopDoSources0 (in ae3c9338-0166-397a-9643-356b14f6ee58) + 332 47 CoreFoundation __CFRunLoopRun (in ae3c9338-0166-397a-9643-356b14f6ee58) + 840 48 CoreFoundation CFRunLoopRunSpecific (in ae3c9338-0166-397a-9643-356b14f6ee58) + 572 49 GraphicsServices GSEventRunModal (in d372e13f-7505-3add-ae13-062656f0b1f6) + 168 50 UIKitCore -[UIApplication _run] (in 5e794caa-4162-3ff6-861e-45f29f6b8ac0) + 816 51 UIKitCore UIApplicationMain (in 5e794caa-4162-3ff6-861e-45f29f6b8ac0) + 336
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
141
1w
How to display UISplitViewController columns next to each other again.
Since iOS26 the UISplitViewController is displayed in a way where the primary column (red) overlaps the secondary column (blue) instead of displaying them next to each other like before. Several Apple apps still display the columns next to each other, like Notes, Mail and Photos. What is the correct way to display the columns next to each other again using UIKit and if possible Storyboards.
Topic: UI Frameworks SubTopic: UIKit
5
0
177
1w
UITextView for displaying long text?
My app displays vertically scrollable text to the user which could be as short as a single screen or as long as a book chapter: imagine something like an e-book reader which uses scrolling rather than page-turning. A long time ago when development first started, I tried using UITextView, but the size of text that could be handled was quite limited (a figure of 32767 points seems to stick in the memory). Accordingly I came up with a custom solution in which a UIScrollView handled scrolling gestures and a custom UIView rendered just the part of the text that was visible at that time. That works, but it becomes cumbersome to add support for features such as selection handles and loupes. 18 years later, is there a more smoothly integrated way of displaying long scrollable text?
Topic: UI Frameworks SubTopic: UIKit
2
0
133
2w
X button disappeared on iPadOS 26.4 in MFMailComposeViewController
I’m using MFMailComposeViewController to send emails from my app. Since updating to iPadOS 26.4, there is no way to cancel the mail composer because the “X” button in the top-left corner has disappeared. On iPhone with iOS 26.4, everything still seems to work as expected. Is this a known issue, or am I missing something? Has anyone else experienced this, or found a workaround?
Topic: UI Frameworks SubTopic: UIKit
8
1
895
2w
Crash occured in UIDatePicker Calendar type
I am encountering a consistent, reproducible crash in our app when presenting a UIDatePicker configured with the calendar style. The crash triggers every single time the picker is invoked and points directly to the modern date picker's internal UICollectionView. The Exception: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView internal inconsistency: attempted to set layout with the collection view requiring a reload' let datePicker = UIDatePicker() datePicker.datePickerMode = .date datePicker.preferredDatePickerStyle = .compact This crash is occuring in inline style too when I try to open the calendar. I tried this in other apps. It works fine. I didn't override any collectionView layouts
1
0
87
2w
Summary of iOS/iPadOS 26 UIKit bugs related to UISearchController & UISearchBar using scope buttons
All of these issues appear when the search controller is set on the view controller's navigationItem and the search controller's searchBar has its scopeButtonTitles set. So far the following issues are affecting my app on iOS/iPadOS 26 as of beta 7: When the scopeBarActivation of UISearchController is set to .onSearchActivation, the preferredSearchBarPlacement of the navigationItem is set to .integratedButton, and the searchBarPlacementAllowsToolbarIntegration is set to false (forcing the search icon to appear in the nav bar), on both iPhones and iPads, the scope buttons never appear. They don't appear when the search is activated. They don't appear when any text is entered into the search bar. FB19771313 I attempted to work around that issue by setting the scopeBarActivation to .manual. I then show the scope bar in the didPresentSearchController delegate method and hide the scope bar in the willDismissSearchController. On an iPhone this works though the display is a bit clunky. On an iPad, the scope bar does appear via the code in didPresentSearchController, but when any scope bar button is tapped, the search controller is dismissed. This happens when the app is horizontally regular. When the app on the iPad is horizontally compact, the buttons work but the search bar's text is not correctly aligned within the search bar. Quite the mess really. I still need to post a bug report for this issue. But if issue 1 above is fixed then I don't need this workaround. When the scopeBarActivation of UISearchController is set to .onSearchActivation, the preferredSearchBarPlacement of the navigationItem is set to .stacked, and the hidesSearchBarWhenScrolling property of the navigationItem is set to false (always show the search bar), and this is all used in a UITableViewController, then upon initial display of the view controller on an iPhone or iPad, you are unable to tap on the first row of the table view except on the very bottom of the row. The currently hidden scope bar is stealing the touches. If you activate and then cancel the search (making the scope bar appear and then disappear) then you are able to tap on the first row as expected. The initially hidden scope bar also bleeds through the first row of the table. It's faint but you can tell it's not quite right. Again, this is resolved by activating and then canceling the search once. FB17888632 When the scopeBarActivation of UISearchController is set to .onSearchActivation, the preferredSearchBarPlacement of the navigationItem is set to integrated or .integratedButton, and the toolbar is shown, then on iPhones (where the search bar/icon appears in the toolbar) the scope buttons appear (at the top of the screen) the first time the search is activated. But if you cancel the search and then activate it again, the search bar never appears a second (or later) time. On an iPad the search bar/icon appears in the nav bar and you end up with the same issue as #1 above. FB17890125 Issues 3 and 4 were reported against beta 1 and still haven't been fixed. But if issue 1 is resolved on iPhone, iPad, and Mac (via Mac Catalyst), then I personally won't be affected by issues 2, 3, or 4 any more (but of course all 4 issues need to be fixed). And by resolved, I mean that the scope bar appears and disappears when it is supposed to each and every time the search is activated and cancelled (not just the first time). The scope bar doesn't interfere with touch events upon initial display of the view controller. And there are no visual glitches no matter what the horizontal size class is on an iPad. I really hope the UIKit team can get these resolved before iOS/iPadOS 26 GM.
11
6
1.7k
2w
UIView wrapper around a View
I couldn't decide whether to post this question here or in SwiftUI Q&A as there's a lot of overlaps. We're trying to create something similar to UIViewRepresentable for UIKit. This might not work for complicated cases where the View has many pieces but as long as it works for simple cases, we're happy. The only problem right now is figuring out the correct height. Currently, the height anchor is assigned to CGFloat.greatestFiniteMagnitude, which works but when inspecting the layout in View Hierarchy, it appears the wrapped view is getting stretched all the way down. Also, sometimes View Hierarchy isn't able to draw the wrapped View and I'm unsure if it's a problem of View Hierarchy or our implementation. final public class SwiftUIConfigurationContainerView<T: View>: UIView { private var contentView: UIView? public override var intrinsicContentSize: CGSize { contentView?.intrinsicContentSize ?? super.intrinsicContentSize } private var preferredContentSize: CGSize? public init(@ViewBuilder _ content: @escaping () -> T) { super.init(frame: .zero) setUpContentView(content) } @available(*, unavailable) required init?(coder: NSCoder) { return nil } private func setUpContentView(_ content: @escaping () -> T) { let contentView = UIHostingConfiguration { [weak self] in VStack(spacing: .zero) { content() .onGeometryChange(for: CGSize.self, of: \.size) { size in self?.preferredContentSize = size self?.invalidateIntrinsicContentSize() } .frame(maxWidth: .infinity, alignment: .center) Spacer(minLength: .zero) } } .minSize(width: .zero, height: .zero) .margins(.all, .zero) .makeContentView() self.contentView = contentView addSubview(contentView) contentView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ contentView.leadingAnchor.constraint(equalTo: leadingAnchor), contentView.trailingAnchor.constraint(equalTo: trailingAnchor), contentView.topAnchor.constraint(equalTo: topAnchor), contentView.heightAnchor.constraint(equalToConstant: CGFloat.greatestFiniteMagnitude), ]) } }
0
0
149
2w
Correct UIScene Configuration for UISceneAccessory
What is the correct configuration of the Info.plist to get a UISceneAccessory to display on an external monitor? I'm currently getting: Info.plist contained no UIScene configuration dictionary (looking for configuration named "scene-accessory") My Info.plist looks as follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleExternalDisplayNonInteractive</key> <array> <dict> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).AccessorySceneDelegate</string> <key>UISceneConfigurationName</key> <string>scene-accessory</string> </dict> </array> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> </dict> </array> </dict> </dict> </dict> </plist> And the view controller scene registration code: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let sceneConfiguration = UISceneConfiguration(name: "scene-accessory") let accessory = UISceneAccessory.externalNonInteractive(sceneConfiguration: sceneConfiguration) let registration = registerSceneAccessory(accessory) registration.isEnabled = true } } Thanks!
Topic: UI Frameworks SubTopic: UIKit
1
0
149
2w
What could cause a UIViewController to get viewDidLoad twice and never get viewWillAppear or viewDidAppear?
I've gotten diagnostics from a couple of my users experiencing a rare issue. The logs in the diagnostics clearly show that the view controller where the issue occurs gets viewDidLoad called twice, and then does not get viewWillAppear or viewDidAppear. This triggers a bug for me because the view controller loads the data it's meant to display in viewWillAppear. I can work around this by changing my data loading logic, but I'd like to know what the underlying issue is. Can anyone point me to some possible ways I could be triggering this weird UIKit behavior?
Topic: UI Frameworks SubTopic: UIKit
1
0
139
2w
PHPickerViewController: UI rendering failure and data retrieval errors on iOS 17 & 26.4
Description: I am encountering critical issues with PHPickerViewController using the "Zero-Permission" configuration. The behavior differs significantly between iOS 17 and iOS 26.4, but both prevent successful image selection. Observed Behaviors: On iOS 26.4 (iPhone 17 Pro Max): The PHPicker UI fails to render the photo grid entirely. Upon initialization, the system UI displays an "Unable to load photo" alert, preventing users from even viewing or selecting images. On iOS 17: The picker UI loads, but after the user selects an image and adds it, the subsequent itemProvider.loadObject call consistently fails, returning an error and preventing our app from retrieving the image data. Current Implementation: var config = PHPickerConfiguration() config.filter = .images config.selectionLimit = pickLimit // Problematic logic: if ABTestManager.shared.isPHPickerCurrent { config.preferredAssetRepresentationMode = .current } let pickerVC = PHPickerViewController(configuration: config) pickerVC.delegate = self user device Images: What I have tested: I have been using preferredAssetRepresentationMode = .current in my AB tests. I have not yet tested .compatible mode, as my application logic requires access to high-fidelity assets. However, the current behavior suggests a regression or a fundamental incompatibility with how the system handles image containers for high-end hardware (e.g., iPhone 17 Pro Max) in the out-of-process picker. Supporting Documentation: Minimal Reproducible Project: [Attached] Logs: [Attached sysdiagnose logs] My Questions: Is the "Unable to load photo" UI failure on iOS 26.4 a known limitation for certain high-resolution asset types when using .current mode? Are there specific handling requirements for NSItemProvider when the system fails to resolve the image data in .current mode on older iOS 17 devices? Given that these failures occur in a "Zero-Permission" context, are there specific metadata or image processing constraints I should be aware of to prevent the picker from entering a "failed" state?
Replies
1
Boosts
0
Views
26
Activity
5h
Horizontal Size Classes on iPhone in iOS 27
In iOS 27, willTransition(to:with:), registerForTraitChanges(), and other mechanisms to monitor size classes do not change when an iPhone interface is resized. Only viewWillTransition(to:with:) is invoked with a new size. And this only happens on the iPhone: the iPad continues to work as it has in the past. It appears that this is intended behavior. That is not to say that it's intuitive behavior. Many experienced developers are encountering the "horizontal size is always compact" behavior and immediately thinking "this must be a beta bug": https://fatbobman.com/en/posts/from-size-class-to-available-space/ But it's not. I get that the new size class behavior is expressing static device semantics and is no longer a dynamic size indicator. The problem is that the tools we have been using to build layouts for the past decade use size classes as dynamic sizing indicators. Storyboards can contain variations that specify whether a constraint is used for regular or compact widths/ heights. Developers have used this ability to automatically adjust layouts as the size classes change. In one case, I use this capability to adjust a top-over-bottom layout in a portrait configuration to a side-by-side in a landscape configuration: switching centering, leading/trailing, and aspect ratios to fit the available size. I suspect that many developers who have taken the time to create a unique layout for an iPad are doing something similar. (Ironically, the folks who treated an iPad as a big iPhone are the ones least affected by this change.) When iPadOS got the ability to resize interfaces (as UIScene windows), I made sure that the automatic size class contraints worked correctly and made adjustments as necessary. That work now has to be discarded and switched over to something more universal. If this is truly the intended behavior going forward, time needs to be invested in updating the tooling behind automatic constraint variations: There should be warnings when the storyboard is compiled. I have dozens of automatic contraints embedded in the storyboard: and they're hard to find (each subview has its own contraints, so it's a manual traversal of a huge tree). There should be runtime warnings that your code that inspects size classes won't be executed. This was the biggest "what the hell is going on?" when trying to resize the interface the first time. At a higher level, Apple engineers have described what is happening. They have not explained why the iPhone is behaving differently than an iPad. And that's the root of this whole situation being unintuitive. We've got no clue. And developers without a clue are unlikely to adopt a new technology. It's essential that Apple explains this change in more detail. Yes, you're going to have to obfuscate it and make us read between the lines, but it's got to be done. (Everyone understands the changes regarding mainScreen wink wink, for example.) A reply in this thread would be a good place to start this explanation.
Replies
4
Boosts
5
Views
534
Activity
23h
Customise UITabBar on iPadOS 26+
I'm building an app with a UISplitViewController as the base, with the main content being a UITabBarController. I'm targeting iOS 26+ and using UIKit. I've customised the tabbar on iOS to have a different font family and size, and used some custom images. Running the same app on iPad, the tabbar moves to the top of the screen, ignores ALL the appearance proxy settings and strips out the images. Its now just giant floating text. Also noticed in portrait mode when the side bar from the split view is open, it compresses the width of the tab bar down to only show 2 elements at a time, with this weird custom scroll thing to move to the rest of the tabs. If the text wasn't so massive, maybe it could fit more. I really hate every inch of this thing. Its looks ugly and functions bizarrely. Why does it ignore all the tabbar appearance settings, and how can I customise it to add icons back with smaller text? Ideally I don't want to use one of the hacks to force it to think its compact mode to bring back the old tabbar, as i'm relying on traits already to fix some SplitView annoyances and don't want those to break. But would love to have the old tab bar style. Are there any settings or toggles that I can use?
Replies
0
Boosts
0
Views
41
Activity
2d
UIRequiresFullScreen Deprecation
I work on a universal app that targets both iPhone and iPad. Our iPad app currently requires full screen. When testing on the latest iPadOS 26 beta, we see the following warning printed to the console: Update the Info.plist: 1) `UIRequiresFullScreen` will soon be ignored. 2) Support for all orientations will soon be required. It will take a fair amount of effort to update our app to properly support presentation in a resizable window. We wanted to gauge how urgent this change is. Our testing has shown that iPadOS 26 supports our app in a non-resizable window. Can someone from Apple provide any guidance as to how soon “soon” is? Will UIRequiresFullScreen be ignored in iPadOS 26? Will support for all orientations be required in iPadOS 26?
Replies
11
Boosts
4
Views
2.1k
Activity
2d
UserDefaults, UIApplicationDelegate, and prewarming
For a UIKit app based on scenes (UIScene), is it safe to reference UserDefaults in code that is executed from UIApplicationDelegate/application(_: didFinishLaunchingWithOptions:) ? I've read that in iOS 15, there were undocumented scenarios involving app prewarming that would cause UserDefaults reads to fail within a window of time after device reboots, as described at https://christianselig.com/2024/10/beware-userdefaults/ The failure mode is that an app would be released, and months later, a small fraction of users would report failures consistent with UserDefaults reads unexpectedly returning nil, causing a loss of data. The user experience is bad, and debugging this behavior is then challenging because of how rarely it occurs. Apple's https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence#3894431 seems to suggest that prewarming only executes an app "up until, but not including when main() calls UIApplicationMain(_:_:_:_:), but https://stackoverflow.com/questions/71025205/ios-15-prewarming-causing-appwilllaunch-method-when-prewarm-is-done documents that UIApplicationDelegate/application(_: didFinishLaunchingWithOptions:) has in fact been observed executing during app prewarming in scene-based apps. So, my question: In an app based on scenes, if I'd like to reference UserDefaults within UIApplicationDelegate/application(_: didFinishLaunchingWithOptions:), when is it safe to do this? I'm guessing the answer is one of these: Never. Only in apps that don't support scenes. Only in iOS 16 or later. Only in IOS 17 or later. Is it guaranteed safe to reference UserDefaults in UIWindowSceneDelegate/scene(_:willConnectTo:options:) or later? Is there documentation from Apple regarding this issue? Thank you.
Replies
3
Boosts
2
Views
772
Activity
2d
UINavigationItemRenameDelegate does not work in IOS 16
I have an iPad app which is trying to support document renaming in the title bar. For IOS 17+ I set the renameDelegate to the document instance and it works fine. For IOS 16 I need to create an actual delegate, but no matter how I structure the code it fails with a permission error: Rename failed: “original_file_name” couldn’t be moved because you don’t have permission to access “Desktop”. It seems to always happen accessing the parent directory. I have tried using the file coordinator as well with the same result. It seems impossible to implement unless the callback contains a security permissioned url for the parent directory. Is there anyway to make this work in IOS 16 in the sandbox? Do I have to create my own rename functionality using a FilePicker? Seems like this should be built in like it is in MacOS, or even IOS17+ Here is the code: extension DocumentWindow : UINavigationItemRenameDelegate { func navigationItem(_ navigationItem: UINavigationItem, didEndRenamingWith title: String) { guard let doc = document else { return } let oldURL = doc.fileURL let newURL = oldURL.deletingLastPathComponent() .appendingPathComponent(title) .appendingPathExtension(oldURL.pathExtension) if newURL == oldURL { return } let access = oldURL.startAccessingSecurityScopedResource() defer { if access { oldURL.stopAccessingSecurityScopedResource() }} do { try FileManager.default.moveItem(at: oldURL, to: newURL) } catch { print("Rename failed: \(error.localizedDescription)") } // // // 1. Jump to a background queue to avoid the deadlock // DispatchQueue.global(qos: .userInitiated).async { // let coordinator = NSFileCoordinator(filePresenter: doc) // var error: NSError? // // // coordinator.coordinate(writingItemAt: oldURL, error: &error) { outOld in // do { // // 2. Perform the actual rename // try FileManager.default.moveItem(at: outOLD, to: newURL) // } catch { // print("Rename failed: \(error.localizedDescription)") // } // } // // if let error = error { // print("Coordination error: \(error.localizedDescription)") // } // } } // 2. Optional: Validation (e.g., prevent empty names) func navigationItem(_ navigationItem: UINavigationItem, shouldEndRenamingWith title: String) -> Bool { return !title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } }
Replies
0
Boosts
0
Views
37
Activity
2d
FB16862332 (iOS 18.3 REGRESSION: UIDocumentViewController: Placeholder icon displayed instead of document icon in share menu item of document title menu)
Anyone else seeing this? I reported the regression back in March 2025 and have no reply from Apple. My apps are Obj-C, in case it matters. DESCRIPTION After updating to iOS 18.3.x, | noticed a regression in the title menu behavior of my UlDocumentViewController-based shipping apps on the App Store [1]: Instead of displaying the document icon supplied by the app, the share menu item displays a placeholder icon instead, and iconservicesagent error messages are emitted in the log stream [2]. STEPS TO REPRODUCE Install one of the apps from note [1] below. Launch the app, tap the document/title menu at top center of the screen, and observe first menu item. RESULTS Expected: App-provided document icon displayed to left of first menu item ("W-1" or "W68" document icon). Actual: Placeholder icon displayed. REGRESSION Occurs: iOS 18.3 (iPad) iOS 18.3.1 (iPhone) iOS 18.3.2 (iPhone) Does Not Occur: iOS 18.2,18.3 Simulator iOS 18.0-18.2? [| no longer have a device with < 18.3 to confirm regression point] NOTES: [1] WOZNIAC-1 <https://apps.apple.com/us/ app/wozniac-1/id6474085354> and WOZNIAC-68 <https://apps.apple.com/us/app/ wozniac-68/id6736677781>. [2] When the problem occurs, the following log messages are omitted: Error returned from iconservicesagent image request: <|STagIcon: 0x30299c040> Tag: alvm, Class: public.filename-extension, Base type: public.item - <|SImageDescriptor: Ox300dd5860> - (37.00, 48.00)@3x v:40000 1:5 a: 0:0:0:0 t:() b:0 s:2 ps:0 digest: 0D3223D0-9AЕ3-3B19-A081-ACACE55691B7 error: Error Domain=NSOSStatusErrorDomain Code=-609 "Client is disallowed from making such an icon request" UserInfo={NSLocalizedDescription=Client is disallowed from making such an icon request}
Topic: UI Frameworks SubTopic: UIKit
Replies
5
Boosts
2
Views
284
Activity
2d
iOS app crashes in CoreGraphics with upscale_provider_get_bytes_at_position_inner when rendering images using the Texture library
Issue Description: On iOS 26 and later, a CoreGraphics crash occurs when rendering images using -[UIImage drawInRect:blendMode:alpha:]. Based on the call stack, the crash happens inside CoreGraphics. Under what circumstances does the function upscale_provider_get_bytes_at_position_inner in the stack get called? When attempting to reproduce locally, this code path is never reached even when scaling images. Steps to Reproduce: There are a large number of crash reports in production, but the issue cannot be reproduced locally/offline. Expected Results: Explain under what conditions calling -[UIImage drawInRect:blendMode:alpha:] will reach the upscale_provider_get_bytes_at_position_inner logic. Ideally, provide a code example or demo. Provide the root cause of the crash and a workaround/mitigation. Current Behavior: Calling -[UIImage drawInRect:blendMode:alpha:] causes intermittent crashes in production. Xcode Version Used: Xcode Version 26.0 (17A324)
Replies
0
Boosts
0
Views
45
Activity
3d
EKEventEditViewController broken in iOS 27 Beta
UIKit app can not edit an event using EKEventEditViewController in iOS 27 Betas. The Done tick button at the top does not work after editing an event. Also does not work if EKEventViewController is first used to display the event. Then the "Edit" tapped to display the EKEventEditViewController. Anyone else seeing this?
Replies
1
Boosts
0
Views
33
Activity
4d
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.
Replies
18
Boosts
1
Views
2.4k
Activity
4d
isEligibleForAgeFeatures return false for all users
Hi there, not sure anyone encountered the same situation, we rolled out our feature and we found that flag is all false for all the users in Brazil.. super weird.. anyone has any idea?
Replies
0
Boosts
0
Views
65
Activity
1w
SSScreenshotMetadataHarvester app termination
Hi team, We are seeing a high volume of app terminations (uANRs), with most of them sharing the attached stack trace. I’d love to get your input on potential workarounds or fixes we can explore to mitigate this issue. 0 CoreFoundation -[__NSSingleObjectArrayI countByEnumeratingWithState:objects:count:] + 132 1 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 228 2 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 3 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 4 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 5 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 6 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 7 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 8 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 9 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 10 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 11 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 12 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 13 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 14 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 15 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 16 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 17 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 18 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 19 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 296 20 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 21 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 22 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 23 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 24 ScreenshotServices +[SSScreenshotMetadataHarvester _crawlViewController:executingBlock:] + 196 25 ScreenshotServices +[SSScreenshotMetadataHarvester _contentRectsForMetadata] + 216 26 ScreenshotServices +[SSScreenshotMetadataHarvester harvestScreenshotMetadataAndRespondToAction:] + 628 27 UIKitCore -[UIScreenshotMetadataRequestAction fulfillRequest] + 180 28 UIKitCore -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 3432 29 UIKitCore -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 412 30 UIKitCore -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 31 UIKitCore -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 32 FrontBoardServices __76-[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.146 (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 252 33 FrontBoardServices -[FBSScene _callOutQueue_coalesceClientSettingsUpdates:] + 68 34 FrontBoardServices -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 712 35 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 148 36 FrontBoardServices -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 37 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke.cold.1 + 252 38 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 184 39 libdispatch.dylib _dispatch_client_callout + 16 40 libdispatch.dylib _dispatch_block_invoke_direct + 284 41 FrontBoardServices __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 52 42 FrontBoardServices -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 240 43 FrontBoardServices -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] (in 1d4f7bf8-ca62-3218-a074-9187a2d191ae) + 28 44 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ (in ae3c9338-0166-397a-9643-356b14f6ee58) + 28 45 CoreFoundation __CFRunLoopDoSource0 (in ae3c9338-0166-397a-9643-356b14f6ee58) + 172 46 CoreFoundation __CFRunLoopDoSources0 (in ae3c9338-0166-397a-9643-356b14f6ee58) + 332 47 CoreFoundation __CFRunLoopRun (in ae3c9338-0166-397a-9643-356b14f6ee58) + 840 48 CoreFoundation CFRunLoopRunSpecific (in ae3c9338-0166-397a-9643-356b14f6ee58) + 572 49 GraphicsServices GSEventRunModal (in d372e13f-7505-3add-ae13-062656f0b1f6) + 168 50 UIKitCore -[UIApplication _run] (in 5e794caa-4162-3ff6-861e-45f29f6b8ac0) + 816 51 UIKitCore UIApplicationMain (in 5e794caa-4162-3ff6-861e-45f29f6b8ac0) + 336
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
2
Boosts
0
Views
141
Activity
1w
How to display UISplitViewController columns next to each other again.
Since iOS26 the UISplitViewController is displayed in a way where the primary column (red) overlaps the secondary column (blue) instead of displaying them next to each other like before. Several Apple apps still display the columns next to each other, like Notes, Mail and Photos. What is the correct way to display the columns next to each other again using UIKit and if possible Storyboards.
Topic: UI Frameworks SubTopic: UIKit
Replies
5
Boosts
0
Views
177
Activity
1w
UITextView for displaying long text?
My app displays vertically scrollable text to the user which could be as short as a single screen or as long as a book chapter: imagine something like an e-book reader which uses scrolling rather than page-turning. A long time ago when development first started, I tried using UITextView, but the size of text that could be handled was quite limited (a figure of 32767 points seems to stick in the memory). Accordingly I came up with a custom solution in which a UIScrollView handled scrolling gestures and a custom UIView rendered just the part of the text that was visible at that time. That works, but it becomes cumbersome to add support for features such as selection handles and loupes. 18 years later, is there a more smoothly integrated way of displaying long scrollable text?
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
0
Views
133
Activity
2w
X button disappeared on iPadOS 26.4 in MFMailComposeViewController
I’m using MFMailComposeViewController to send emails from my app. Since updating to iPadOS 26.4, there is no way to cancel the mail composer because the “X” button in the top-left corner has disappeared. On iPhone with iOS 26.4, everything still seems to work as expected. Is this a known issue, or am I missing something? Has anyone else experienced this, or found a workaround?
Topic: UI Frameworks SubTopic: UIKit
Replies
8
Boosts
1
Views
895
Activity
2w
Crash occured in UIDatePicker Calendar type
I am encountering a consistent, reproducible crash in our app when presenting a UIDatePicker configured with the calendar style. The crash triggers every single time the picker is invoked and points directly to the modern date picker's internal UICollectionView. The Exception: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView internal inconsistency: attempted to set layout with the collection view requiring a reload' let datePicker = UIDatePicker() datePicker.datePickerMode = .date datePicker.preferredDatePickerStyle = .compact This crash is occuring in inline style too when I try to open the calendar. I tried this in other apps. It works fine. I didn't override any collectionView layouts
Replies
1
Boosts
0
Views
87
Activity
2w
Summary of iOS/iPadOS 26 UIKit bugs related to UISearchController & UISearchBar using scope buttons
All of these issues appear when the search controller is set on the view controller's navigationItem and the search controller's searchBar has its scopeButtonTitles set. So far the following issues are affecting my app on iOS/iPadOS 26 as of beta 7: When the scopeBarActivation of UISearchController is set to .onSearchActivation, the preferredSearchBarPlacement of the navigationItem is set to .integratedButton, and the searchBarPlacementAllowsToolbarIntegration is set to false (forcing the search icon to appear in the nav bar), on both iPhones and iPads, the scope buttons never appear. They don't appear when the search is activated. They don't appear when any text is entered into the search bar. FB19771313 I attempted to work around that issue by setting the scopeBarActivation to .manual. I then show the scope bar in the didPresentSearchController delegate method and hide the scope bar in the willDismissSearchController. On an iPhone this works though the display is a bit clunky. On an iPad, the scope bar does appear via the code in didPresentSearchController, but when any scope bar button is tapped, the search controller is dismissed. This happens when the app is horizontally regular. When the app on the iPad is horizontally compact, the buttons work but the search bar's text is not correctly aligned within the search bar. Quite the mess really. I still need to post a bug report for this issue. But if issue 1 above is fixed then I don't need this workaround. When the scopeBarActivation of UISearchController is set to .onSearchActivation, the preferredSearchBarPlacement of the navigationItem is set to .stacked, and the hidesSearchBarWhenScrolling property of the navigationItem is set to false (always show the search bar), and this is all used in a UITableViewController, then upon initial display of the view controller on an iPhone or iPad, you are unable to tap on the first row of the table view except on the very bottom of the row. The currently hidden scope bar is stealing the touches. If you activate and then cancel the search (making the scope bar appear and then disappear) then you are able to tap on the first row as expected. The initially hidden scope bar also bleeds through the first row of the table. It's faint but you can tell it's not quite right. Again, this is resolved by activating and then canceling the search once. FB17888632 When the scopeBarActivation of UISearchController is set to .onSearchActivation, the preferredSearchBarPlacement of the navigationItem is set to integrated or .integratedButton, and the toolbar is shown, then on iPhones (where the search bar/icon appears in the toolbar) the scope buttons appear (at the top of the screen) the first time the search is activated. But if you cancel the search and then activate it again, the search bar never appears a second (or later) time. On an iPad the search bar/icon appears in the nav bar and you end up with the same issue as #1 above. FB17890125 Issues 3 and 4 were reported against beta 1 and still haven't been fixed. But if issue 1 is resolved on iPhone, iPad, and Mac (via Mac Catalyst), then I personally won't be affected by issues 2, 3, or 4 any more (but of course all 4 issues need to be fixed). And by resolved, I mean that the scope bar appears and disappears when it is supposed to each and every time the search is activated and cancelled (not just the first time). The scope bar doesn't interfere with touch events upon initial display of the view controller. And there are no visual glitches no matter what the horizontal size class is on an iPad. I really hope the UIKit team can get these resolved before iOS/iPadOS 26 GM.
Replies
11
Boosts
6
Views
1.7k
Activity
2w
UIView wrapper around a View
I couldn't decide whether to post this question here or in SwiftUI Q&A as there's a lot of overlaps. We're trying to create something similar to UIViewRepresentable for UIKit. This might not work for complicated cases where the View has many pieces but as long as it works for simple cases, we're happy. The only problem right now is figuring out the correct height. Currently, the height anchor is assigned to CGFloat.greatestFiniteMagnitude, which works but when inspecting the layout in View Hierarchy, it appears the wrapped view is getting stretched all the way down. Also, sometimes View Hierarchy isn't able to draw the wrapped View and I'm unsure if it's a problem of View Hierarchy or our implementation. final public class SwiftUIConfigurationContainerView<T: View>: UIView { private var contentView: UIView? public override var intrinsicContentSize: CGSize { contentView?.intrinsicContentSize ?? super.intrinsicContentSize } private var preferredContentSize: CGSize? public init(@ViewBuilder _ content: @escaping () -> T) { super.init(frame: .zero) setUpContentView(content) } @available(*, unavailable) required init?(coder: NSCoder) { return nil } private func setUpContentView(_ content: @escaping () -> T) { let contentView = UIHostingConfiguration { [weak self] in VStack(spacing: .zero) { content() .onGeometryChange(for: CGSize.self, of: \.size) { size in self?.preferredContentSize = size self?.invalidateIntrinsicContentSize() } .frame(maxWidth: .infinity, alignment: .center) Spacer(minLength: .zero) } } .minSize(width: .zero, height: .zero) .margins(.all, .zero) .makeContentView() self.contentView = contentView addSubview(contentView) contentView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ contentView.leadingAnchor.constraint(equalTo: leadingAnchor), contentView.trailingAnchor.constraint(equalTo: trailingAnchor), contentView.topAnchor.constraint(equalTo: topAnchor), contentView.heightAnchor.constraint(equalToConstant: CGFloat.greatestFiniteMagnitude), ]) } }
Replies
0
Boosts
0
Views
149
Activity
2w
Correct UIScene Configuration for UISceneAccessory
What is the correct configuration of the Info.plist to get a UISceneAccessory to display on an external monitor? I'm currently getting: Info.plist contained no UIScene configuration dictionary (looking for configuration named "scene-accessory") My Info.plist looks as follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleExternalDisplayNonInteractive</key> <array> <dict> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).AccessorySceneDelegate</string> <key>UISceneConfigurationName</key> <string>scene-accessory</string> </dict> </array> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> </dict> </array> </dict> </dict> </dict> </plist> And the view controller scene registration code: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let sceneConfiguration = UISceneConfiguration(name: "scene-accessory") let accessory = UISceneAccessory.externalNonInteractive(sceneConfiguration: sceneConfiguration) let registration = registerSceneAccessory(accessory) registration.isEnabled = true } } Thanks!
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
149
Activity
2w
What could cause a UIViewController to get viewDidLoad twice and never get viewWillAppear or viewDidAppear?
I've gotten diagnostics from a couple of my users experiencing a rare issue. The logs in the diagnostics clearly show that the view controller where the issue occurs gets viewDidLoad called twice, and then does not get viewWillAppear or viewDidAppear. This triggers a bug for me because the view controller loads the data it's meant to display in viewWillAppear. I can work around this by changing my data loading logic, but I'd like to know what the underlying issue is. Can anyone point me to some possible ways I could be triggering this weird UIKit behavior?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
139
Activity
2w