Construct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.

Posts under UIKit tag

200 Posts

Post

Replies

Boosts

Views

Activity

iOS26 UINavigationController swipe from middle on maps causing issue
I have a UINavigation controller which on the second viewController has a Google Map view. In iOS 18 you would navigate normally around the map, and swipe your finger from the left side of the screen to move the map, this worked correctly. However, in iOS 26 swiping from left to right from anywhere but the far right side of the screen will cause the UI to try to pop the viewController. This does not happen when I add Apple Maps or other map frameworks to the VC. Is there a way to disable the "swipe from middle" in iOS 26?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
51
22h
iOS 26 Liquid Glass - Without any Blur - Possible?
let glassView = UIVisualEffectView(effect: UIGlassEffect(style: .clear)) glassView.frame = CGRect(x: 100, y: 200, width: 200, height: 400) self.view.addSubview(glassView) Though UIGlassEffect has two variants: .regular and .clear, even the clear one has some blur on the background. Is there a way to do get absolute no blur? Edges still have the glass effect. Apple does this in two places: Camera app: Text magnifier:
Topic: Design SubTopic: General Tags:
0
0
177
1d
Missing Top Separator in .plain UITableView Sections on iOS 26
Hi Apple Team and community, We've noticed a change in how UITableView separators are rendered in iOS 26 (tested using Xcode 26.0), and we'd like to confirm if this is an intentional behaviour change or a potential bug. Issue Description In a .plain-style UITableView, the top separator line above the first cell in each section is no longer rendered in iOS 26. We've confirmed that this separator is also absent from the view hierarchy. This issue did not occur in previous iOS versions (e.g., iOS 18), where the top separator above the first cell of a section was rendered as expected. The issue doesn't occur for UITableView with no sections. Expected Behavior When using a .plain style UITableView, the standard top separator should appear above the first cell of each section, as part of the default system rendering. Actual Behavior In iOS 26, this top separator is missing, even though the rest of the separators render normally. Environment iOS version: iOS 26 (Simulator) Xcode version: Xcode 26.0 Tested using: UIKit with Swift, both Storyboard and programmatic view setups Sample app and screenshots: Drive link: https://drive.google.com/drive/folders/1aoXeFHO_Sya-6Rvp0fZ0s2V4KLQucRMb?usp=sharing Questions: Is this a known change in rendering behavior for UITableView in iOS 26? If not, is anyone else experiencing the same issue? We'd appreciate any insights or potential workarounds to restore the top separator in .plain-style table views. Any clarification or guidance would be appreciated. Thanks in advance!
0
0
30
4d
App is moving to Background when user rejected the GSM cellular call.
Application is in foreground state, When a user receives a cellular call and it is in the "ringing" state and application receives a VoIP APNS(video call) which is reported to CallKit. User rejects the Cellular call from CallKit UI, application Video call is also getting rejected (separate feedback - 19017978) and Here the issue is observed that an Application moved to background. Issue is not observed in iOS 18 and older versions. Issue observed only with UISceneDelegate changes. Using traditional UIApplicationDelegate doesn't have the issues. Video and Sysdiagnose logs are added in feedback: FB20187309
0
0
54
4d
What determines the size of a UIScrollEdgeElementContainerInteraction with a hard edge effect?
I've got an iOS app with a custom top toolbar view that uses a UIScrollEdgeElementContainerInteraction to achieve the iOS 26 progressive blur background. It's over top of a web view, and I've set the top edge effect style on its scroll view to .hard so the toolbar's edges are more defined. I'm noticing that the blur doesn't extend fully to the bottom edge of the toolbar, and I'm curious to know if this is a bug or expected behavior. If the latter, what exactly are the details of what's expected? What determines the bottom extent of the blur? I've got this result in a sample project on iOS 26.0. The white border is the label, and the red border is the title bar view itself. Note that the Daring Fireball logo visible inside the bounds of the bar view, and is cut off at the bottom edge of the label. This is the code from the demo app that produced the screenshot. let config = WKWebViewConfiguration() let webView = WKWebView(frame: .zero, configuration: config) self.view.addSubview(webView) webView.translatesAutoresizingMaskIntoConstraints = false webView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true; webView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true; webView.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true; webView.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true; webView.scrollView.topEdgeEffect.style = .hard webView.load(URLRequest(url: URL(string: "https://daringfireball.net")!)) let barView = UIView() self.view.addSubview(barView) barView.translatesAutoresizingMaskIntoConstraints = false barView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true; barView.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true barView.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true let edgeEffect = UIScrollEdgeElementContainerInteraction() edgeEffect.scrollView = webView.scrollView edgeEffect.edge = .top barView.addInteraction(edgeEffect) barView.layer.borderColor = UIColor.red.cgColor barView.layer.borderWidth = 1 let titleLabel = UILabel() barView.addSubview(titleLabel) titleLabel.translatesAutoresizingMaskIntoConstraints = false titleLabel.leftAnchor.constraint(equalTo: barView.leftAnchor).isActive = true titleLabel.rightAnchor.constraint(equalTo: barView.rightAnchor).isActive = true titleLabel.bottomAnchor.constraint(equalTo: barView.bottomAnchor, constant: -20).isActive = true titleLabel.topAnchor.constraint(equalTo: barView.safeAreaLayoutGuide.topAnchor, constant: 8).isActive = true titleLabel.textAlignment = .center titleLabel.text = "Title Here" titleLabel.layer.borderColor = UIColor.green.cgColor titleLabel.layer.borderWidth = 1
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
114
4d
iOS 26 UITargetedPreview not responding to touches
We have a UICollectionView whose cells have custom context menu highlight previews. In the delegate method collectionView(_:contextMenuConfiguration:highlightPreviewForItemAt:), we build a UITargetedPreview whose custom view contains some action buttons. Up until iOS 18, our setup has been working perfectly. But since iOS 26, the custom view is not responding to touches. When the user taps one of its buttons, the context menu gets dismissed as if the touch was outside of the custom view. Is there any UICollectionView-related API change in version 26?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
58
5d
iPadOS 26 UISearchController bug causing presented view controller to be dismissed
Under iPadsOS 26.0 and 26.1, if a view controller is presented with a presentation style of fullScreen or pageSheet, and the view controller is setup with a UISearchController that has obscuresBackgroundDuringPresentation set to true, then when cancelling the search the view controller is being dismissed when it should not be. To replicate, create a new iOS project based on Swift/Storyboard using Xcode 26.0 or Xcode 26.1. Update ViewController.swift with the following code: import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground title = "Root" navigationItem.rightBarButtonItems = [ UIBarButtonItem(title: "Full", primaryAction: .init(handler: { _ in self.showModal(with: .fullScreen) })), UIBarButtonItem(title: "Page", primaryAction: .init(handler: { _ in self.showModal(with: .pageSheet) })), UIBarButtonItem(title: "Form", primaryAction: .init(handler: { _ in self.showModal(with: .formSheet) })), ] } private func showModal(with style: UIModalPresentationStyle) { let vc = ModalViewController() let nc = UINavigationController(rootViewController: vc) // This triggers the double dismiss bug when set to either pageSheet or fullScreen. // If set to formSheet then it works fine. // Bug is only on iPad with iPadOS 26.0 or 26.1 beta 2. // Works fine on iPhone (any iOS) and iPadOS 18 as well as macOS 26.0 (not tested with other versions of macOS). nc.modalPresentationStyle = style self.present(nc, animated: true) } } Then add a new file named ModalViewController.swift with the following code: import UIKit class ModalViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() title = "Modal" view.backgroundColor = .systemBackground setupSearch() } private func setupSearch() { let sc = UISearchController(searchResultsController: UIViewController()) sc.delegate = self // Just for debugging - being set or not does not affect the bug sc.obscuresBackgroundDuringPresentation = true // Critical to reproducing the bug navigationItem.searchController = sc navigationItem.preferredSearchBarPlacement = .stacked } // When the search is cancelled by tapping on the grayed out area below the search bar, // this is called twice when it should only be called once. This happens only if the // view controller is presented with a fullScreen or pageSheet presentation style. // The end result is that the first call properly dismisses the search controller. // The second call results in this view controller being dismissed when it should not be. override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) { print("dismiss ViewController") // Set breakpoint on the following line super.dismiss(animated: flag, completion: completion) } } extension ModalViewController: UISearchControllerDelegate { func willDismissSearchController(_ searchController: UISearchController) { print("willDissmissSearchController") } func didDismissSearchController(_ searchController: UISearchController) { print("didDismissSearchController") } } Build and run the app on a simulated or real iPad running iPadOS 26.0 or 26.1 (beta 2). A root window appears with 3 buttons in the navbar. Each button displays the same view controller but with a different modalPresentationStyle. Tap the Form button. This displays a modal view controller with formSheet style. Tap on the search field. Then tap on the grayed out area of the view controller to cancel the search. This all works just fine. Dismiss the modal (drag it down). Now tap either the Page or Full button. These display the same modal view controller with pageSheet or fullScreen style respectively. Tap on the search field. Then tap on the grayed out area of the view controller to cancel the search. This time, not only is the search cancelled, but the view controller is also dismissed. This is because the view controller’s dismiss(animated:completion:) method is being called twice. See ViewController.swift for the code that presents the modal. See ModalViewController.swift for the code that sets up the search controller. Both contain lots of comments. Besides the use of fullScreen or pageSheet presentation style to reproduce the bug, the search controller must also have its obscuresBackgroundDuringPresentation property set to true. It’s the tap on that obscured background to cancel the search that results in the double call to dismiss. With the breakpoint set in the overloaded dismiss(animated:completion:) function, you can see the two stack traces that lead to the call to dismiss. When presented as a formSheet, the 2nd call to dismiss is not being made. This issue does not affect iPadOS 18 nor any version of iOS on iPhones. Nor does it affect the app using Mac Catalyst on macOS 26.0 (untested with macOS 15 or 26.1). In short, it is expected that cancelling the search in a presented view controller should not also result in the view controller being dismissed. Tested with Xcode 26.1 beta 2 and Xcode 26.0. Tested with iPadOS 26.1 beta 2 (real and simulated) and iPadOS 26.0 (simulated). A version of this post was submitted as FB20569327
0
0
53
5d
List's shadow flickering
When Home tab opened, there is some white shadow on the bottom and the top sides of the list. But when switching to other tab or return to Home tab this shadow disappearing for a second and appearing again. Actual for iOS 26.0.1 on simulator and on real device. Below is short example code that can reproduce issue. When change let pages = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal) to let pages = UIPageViewController(transitionStyle: .pageCurl, navigationOrientation: .horizontal) issue is not reproduced. import SwiftUI @main struct GlassTestApp: App { var body: some Scene { WindowGroup { MainView() .ignoresSafeArea() } } } struct MainView: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> UITabBarController { let controller = UITabBarController() let home = Home() home.tabBarItem = UITabBarItem(title: "Home", image: UIImage(systemName: "house"), tag: 1) let settings = UIHostingController(rootView: Settings()) settings.tabBarItem = UITabBarItem(title: "Settings", image: UIImage(systemName: "gearshape"), tag: 2) controller.viewControllers = [home, settings] return controller } func updateUIViewController(_ uiViewController: UITabBarController, context: Context) { } } class Home: UINavigationController { init() { let pages = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal) pages.setViewControllers([UIHostingController(rootView: Page1())], direction: .forward, animated: false) super.init(rootViewController: pages) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } struct Page1: View { var body: some View { List { ForEach(1...100, id: \.self) { Text("\($0)") } } .listStyle(.plain) } } struct Settings: View { var body: some View { Text("Settings") } }
4
0
194
3h
Prevent screen recording and sharing in app
Hi. I am looking for a UIKit solution that allows me to “prevent” screen recording and sharing on certain pages in application. By “preventing” I mean that the distributed result should be a black content. Me as a user should still see the pages’s content as it is, but the recording or shared screen footage should show a black screen. I have already checked out the workaround solutions with UITextField, but those does not work for me. So I am looking for other suggestion. (Btw I know that nothing stops a user from taking a video of an app with another phone, but I still need a solution to the issue I have described above)
0
0
506
6d
iOS 26: FloatingBarContainerView overlapping the whole custom ViewController
Hi everyone: I'm experiencing an issue in iOS 26. I've implemented a custom ViewController. It's super simple to edit images with flip, crop, zoom in, and zoom out. My question is that it seems very strange to me. It works without problems in iOS 17.5 and iOS 18. However, when I try to run it with iOS 26, the entire ViewController seems disabled; it doesn't recognize touches or anything. When I checked the UI hierarchy, I saw a strange FloatingBarContainerView overlaying the entire ViewController. I searched the documentation for information about this view, but I couldn't find anything. Any help on how to hide or remove this view in iOS 26? This hasn't been implemented anywhere.
2
0
160
6d
Does Mac Catalyst support an "always on top" window scene?
My UIKit/Mac Catalyst app supports a user opening multiple windows (multiple scenes). One of these is a special scene that shows content that I want to appear in front of all other app windows/scenes, even while the user is interacting with one of the app's other scenes. I do not need this special scene to stay in front of the windows of other apps, just in front of the windows of my own app. While I'm not 100% sure, it seems that AppKit supports this through the NSWindow level property. I can't find any equivalent feature in UIKit/Mac Catalyst. UIWindow windowLevel is not the same thing since that only affects the order of windows within a given scene. I need an entire scene (and its windows) to stay in front of my app's other scenes (and their windows). I don't see anything relevant in UIWindow, UIScene, UIWindowScene, UISceneSession, UIScene.ActivationRequestOptions, or UIWindowScene.ActivationRequestOptions.
2
0
71
6d
iOS26: Back button changes appearance when modal screen is shown
I use appearance api to set a custom background image for my navigation bar. At the start color of the back button icon is black. But for some reason color becomes white when new screen is presented modally. My whole project is relied on the appearance api so I cannot remove or replace it. Looks like a bug. The setup code is simple: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. setupappearance() return true } func setupappearance() { let navImage = UIImage(named: "new_navigation_background1") let appearance = UINavigationBarAppearance() appearance.configureWithOpaqueBackground() appearance.backgroundImage = navImage UINavigationBar.appearance().scrollEdgeAppearance = appearance UINavigationBar.appearance().standardAppearance = appearance UINavigationBar.appearance().compactAppearance = appearance UINavigationBar.appearance().compactScrollEdgeAppearance = appearance }
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
147
4d
Xcode build running into issues
I have been trying to run the ios build and facing issues since last few days. I installed xcode with ios26 and switched to xcode 16.2 beta and now in xcode16.1. My development is blocked as am hitting errors one after the other. Can you point me to any configuration which works ? My development is blocked and its real pain.
1
0
106
1w
App Crashes in UICollectionView.m:3974
No Trace of My App is found in Crash Report. The last trace is from UIKitCore. -> Foundation [NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 288 (NSException.m:252) -> UIKitCore [UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:layout:withLayoutAttributes:applyAttributes:] + 1180 (UICollectionView.m:3974) What can be the possible causes for this type of crash?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
100
1w
[iOS 26] Can no longer detect whether iPhone has notch
I'm currently using the extension below to determine whether an iPhone has a notch so I can adjust my UI accordingly. extension UIDevice { var hasNotch: Bool { if userInterfaceIdiom == .phone, let window = (UIApplication.shared.connectedScenes .compactMap { $0 as? UIWindowScene } .flatMap { $0.windows } .first { $0.isKeyWindow }) { return window.safeAreaInsets.bottom > 0 } return false } } (Adapted from https://stackoverflow.com/questions/73946911/how-to-detect-users-device-has-dynamic-island-in-uikit) This no longer works in iOS 26, and I have yet to find a similar method that works. Does anyone have any fixes?
4
0
122
1w
XIB Files line seperator = none not be respected in iOS 26.1 ONLY
Hey All, Curious if you guys are seeing the same thing for those who are using Interface Builder Files (Xib) i set the line seperator to none and on my app (built against ios 18 on the app store, but doesnt matter if i build it against ios 26, or ios 26.1) when running on iOS 26.1 the line seperator will show even when i set it to None. Funny enough if i just play around with the XIB file and set it to single line and maybe RED color the IB file will show it but when running it its the same old default dark greyish color. BUT if i set the line seperator in CODE either to be none or with single line + red it looks good when running on sim / device. So it seems to be an issue with XIB files not being respected in iOS 26.1 (only) i have submitted a feed back FB20466783, hope this helps any xcode devs / uikit devs. thank you !
1
0
82
1w
Recover iPadOS MenuBar state from different scenes
I’m building a Flutter plugin to access the new menubar API on iPadOS. Everything works fine with a single scene, but I’m running into issues when adding support for multiple scenes: Only odd-numbered windows (first, third, etc.) build their menus correctly. Even-numbered windows ignore the menus sent from Flutter and fall back to a default menubar. When switching between scenes, the last rendered menu always persists instead of updating to the current focus. So far, I’ve: Implemented the plugin as a singleton. Tried to persist menu state per scene, but without success. What would be the recommended approach here? Should I avoid a singleton and manage state entirely per UIScene instance? The project is open-source, and if anyone is willing to take a look, here are the relevant files: /ios/Classes/IpadOSMenubarPlugin.swift /example/ios/Runner/AppDelegate.swift Any guidance would be much appreciated.
1
0
81
1w
UIScene based state restoration on tvOS not working
I can’t get UIScene-based state restoration to work on tvOS as it does on iOS. UISceneSession.stateRestorationActivity is always nil in UIWindowSceneDelegate.scene(_:willConnectTo:options:) despite UIWindowSceneDelegate.stateRestorationActivity(for:) being called in the previous lifecycle. The NSUserActivityType is correctly configured in the Info.plist. Has anyone encountered the same issue or knows how to get this to work? Sample Project https://github.com/antiraum/tvosSceneStateRestoration Feedback FB20451479
1
0
52
1w