Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

A layout bug when using Tab View in SwiftUI
I've been getting some unexpected behavior when using TabView as the root view in SwiftUI, which I believe to be a bug. I created a barebones app to isolate the bug and will paste the code at the end for anyone who wants to try to reproduce it if you have a physical Duo device. Details below copied from my Feedback ticket FB25490881. Xcode 27.1. What's the bug? When you have a TabView as the root view inside the ContentView.swift and you open the app on the outer screen, then swipe it to the background, unfold the phone and tap the app to bring it to the foreground, any UI element without a fixed frame size gets moved off screen. And any UI element with a fixed frame size gets moved to the very top of the screen. See my two screenshots of outer vs inner display. How to reproduce: 1- Unzip the project folder and open it in Xcode. 2- With a physical Duo on hand, run the app on the Duo. 3- On the outer screen, launch the app. 4- Swipe the app to the background (Do not swipe completely to close the app, just swipe it to the background so it is still running) 5- Unfold the iPhone Duo completely open. 6- Tap the app icon to bring it to the foreground. 7- Look at the broken UI. Also note even the side tab bar itself is broken, it has no padding with the edge of the screen. This is managed by the system. The workaround to fix it: 1- Go to the ContentView.Swift in Xcode. 2- Uncomment "NavigationStack {" on line 13. 3- Uncomment the closing bracket "}" on line 2. 4- Repeat the previous from how to reproduce the bug. My hypothesis: The system reports 0 height for the inner screen in that moment you bring the app to the foreground. Anything with a fixed frame will move to the top, anything with flexible height will not be visible. This only happens when TabView is the root of the scene. Other Useful Information: I hit a very similar bug to this in my main app that I'm still developing, unfortunately I was not able to reproduce it in a sandbox simple app. The bug was: 1- Open the app on outer screen 2- While the app is open, tilt the Duo to the back at a certain angle 3- Unfold the Duo 4- You get this exact same bug where everything with a flexible height disappears off screen or collapses to zero if it's in between UI elements with fixed heights. And everything moves to the top of the screen. I'm not sure why I wasn't able to reproduce it on a sandbox app, but the fix was the same, either remove the TabView completely or put it inside a NavigationStack. I want to stress that this one had to do with the backwards tilt of the phone itself while unfolding it, very weird I know. ContentView.swift: import SwiftUI @available(iOS 27.1, *) struct ContentView: View { var body: some View { // NavigationStack { TabView { HomeTabView() .tabItem { Label("Home", systemImage: "house") } StoreView() .tabItem { Label("Store", systemImage: "bag") } } .tint(Color.black) // } } } HomeTabView.swift: import SwiftUI @available(iOS 27.1, *) struct HomeTabView: View { var body: some View { VStack { Text("Jenny") .font(.largeTitle) .fontWeight(.bold) .padding() .frame(maxWidth: .infinity) .frame(height: 200) .background(Color.gray, in: .rect(cornerRadius: 28)) Spacer() Circle() .fill(Color.blue) .frame(width: 100, height: 100) .padding(.bottom, 50) } .contentMargins(for: .container, edges: .horizontal) } } StoreView.swift is just an default empty swiftUI file with the default Text("Hello, World!")
2
0
420
1w
TabView(.page) extended under the tab bar shifts its pages up after the container height shrinks while visible
Summary A page-style TabView that extends under the bottom tab bar with .ignoresSafeArea(edges: .bottom) leaves its pages shifted upward after its height shrinks while it is on screen. The shift is half of the bottom safe area (41.67 pt with an 83.33 pt tab bar area), and the top of each page is hidden. The internal UICollectionView (contentInsetAdjustmentBehavior == .automatic) seems to briefly add the bottom safe area to adjustedContentInset.bottom during the resize. The inset goes back to 0 afterwards, but the visible cell is left at frame.minY == -41.67. Environment Xcode 27.0 (27A266a), iPhone Duo Simulator (iOS 27.1), deployment target iOS 18.0 In a unit test it also reproduces when only the window height shrinks (386×678 → 386×600), so it does not depend on the foldable device Steps to reproduce Run the code below on the iPhone Duo Simulator while it is folded Unfold the device Expected The red "Top of page 0" area stays directly below the yellow header, as it does when the app is launched unfolded. Actual The top of the red area is hidden under the header. Log output: folded (launch): height=628.00 adjustedContentInset.bottom=0.00 cell.minY=0.00 after unfolding: height=619.00 adjustedContentInset.bottom=0.00 cell.minY=-41.67In this sample the page returns to its position when the device is folded again. In our app it stays shifted, and after the shift, tapping to switch pages sometimes stops working until the user swipes. Notes Removing .ignoresSafeArea(edges: .bottom) avoids the issue, but the content then no longer extends under the translucent tab bar Setting edgesForExtendedLayout = [] on the hosting controller also avoids it, with the same visual change. safeAreaRegions = [] and setContentScrollView(nil, for:) do not help A non-transparent background on the TabView or its pages, as suggested in https://developer.apple.com/forums/thread/762286, does not help. The trigger here is a size change, not a page switch, so this seems to be a different issue Current workaround: find the internal UICollectionView through the superview chain and set contentInsetAdjustmentBehavior = .never. This works, but it relies on the private view hierarchy. Is there a supported way to avoid this? Minimal reproduction import SwiftUI import UIKit // A TabView(.page) extended under the tab bar with .ignoresSafeArea(edges: .bottom). // Resizing the window while it is visible (e.g. unfolding) shifts the page up. struct PagerView: View { @State private var selection = 0 var body: some View { VStack(spacing: 0) { Color.yellow.frame(height: 50).overlay(Text("Header")) TabView(selection: $selection) { ForEach(0..<2) { index in ScrollView { Color.red.frame(height: 120).overlay(Text("Top of page \(index)")) ForEach(0..<30) { Text("Row \($0)").frame(maxWidth: .infinity, minHeight: 44) } } .tag(index) } } .tabViewStyle(.page(indexDisplayMode: .never)) } .ignoresSafeArea(edges: .bottom) } } final class PagerViewController: UIHostingController<PagerView> { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in self?.logCollectionView() } } private func logCollectionView() { func find(_ view: UIView) -> UICollectionView? { view as? UICollectionView ?? view.subviews.lazy.compactMap(find).first } guard let collectionView = find(view) else { return } let cellMinY = collectionView.visibleCells.first?.frame.minY ?? .nan NSLog("FORUM height=%.2f adjustedContentInset.bottom=%.2f cell.minY=%.2f", collectionView.bounds.height, collectionView.adjustedContentInset.bottom, cellMinY) } } @main final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, configurationForConnecting session: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { let configuration = UISceneConfiguration(name: nil, sessionRole: session.role) configuration.delegateClass = SceneDelegate.self return configuration } } final class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { let pager = PagerViewController(rootView: PagerView()) pager.tabBarItem = UITabBarItem(title: "Pager", image: UIImage(systemName: "square"), tag: 0) let other = UIViewController() other.tabBarItem = UITabBarItem(title: "Other", image: UIImage(systemName: "circle"), tag: 1) let tabBarController = UITabBarController() tabBarController.viewControllers = [pager, other] window = UIWindow(windowScene: scene as! UIWindowScene) window?.rootViewController = tabBarController window?.makeKeyAndVisible() } }
3
2
403
1w
Is a scene always connected when a UIScene app is launched in the background (silent push, BGTask, background URLSession)?
Hello, We are migrating a large UIKit app from the app-delegate lifecycle to the UIScene lifecycle. (Building with Xcode 27 / iOS 27 SDK, our non-scene app crashes at launch with EXC_BREAKPOINT in _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption.) Our startup work runs from application(_:didFinishLaunchingWithOptions:), and we need to know what is guaranteed for background launches. Observed (iPhone 15 Pro, iOS 27.2, app built with Xcode 26.3; also iOS 17.5 simulator): Non-scene build, launched by a content-available push: launchOptions contained UIApplicationLaunchOptionsRemoteNotificationKey. applicationDidEnterBackground was not called during the background run. Non-scene build, launched by a BGProcessingTask: launchOptions empty. applicationDidEnterBackground was not called; the first lifecycle callback was applicationWillEnterForeground when the user opened the app 8 minutes later. Scene build, launched by a BGProcessingTask and by a content-available push: scene(_:willConnectTo:options:) was called 0.15-0.2 s after didFinishLaunching while applicationState == .background (activationState .unattached). connectionOptions had no notificationResponse, URL or shortcut item. In the push launch, scene(_:willConnectTo:options:) was called 37 ms before application(_:didReceiveRemoteNotification:fetchCompletionHandler:). sceneWillEnterForeground / sceneDidEnterBackground were not called before the process was suspended. Scene build, background URLSession relaunch (simulator): the scene also connected right after didFinishLaunching in the background, 6 ms before application(_:handleEventsForBackgroundURLSession:completionHandler:). Question: For a UIScene-based app that the system launches directly into the background (content-available push, BGTaskScheduler task, background URLSession events), is it guaranteed that UIKit connects a scene session (scene(_:willConnectTo:options:)) before the user opens the app, or can a background launch run with no connected scene until the app comes to the foreground? In the same launches, can sceneDidEnterBackground (or applicationDidEnterBackground in a non-scene app) be called for a process that never entered the foreground? Please point us to documentation that describes the guaranteed callbacks and their order for background launches. Thank you.
Topic: UI Frameworks SubTopic: UIKit
0
0
88
1w
iPhone: Inspector Sheet Issue with Navigation Toolbar Toggle
Hello, I think this might be a bug, but I'm not sure (see the code below). FB25486625 On iPhone, when the inspector is presented as a SHEET, swiping down to dismiss it (instead of tapping the close button inside the inspector) causes the navigation toolbar toggle to stop working properly: tapping it once won't reopen the inspector. You have to tap it twice (turning it on and off again) to make the inspector appear again. This doesn't happen when the inspector is presented as a SIDEBAR on iPad or macOS. import SwiftUI struct ContentView: View { @State private var showInspector = false var body: some View { NavigationStack{ Text("Hello, world!") .padding() .inspector(isPresented: $showInspector) { Button("Close Inspector", role: .cancel) { showInspector.toggle() } Text("On iPhone, with inspector as SHEET, if you swipe to close (instead of tap the close button), the toggle in the navigation toolbar won't open the inspector next time (half the time). It doesn't affect inspector as SIDEBAR on iPad") .padding() Spacer() } .toolbar { Toggle(isOn: $showInspector) { Label("Open", systemImage: "sidebar.trailing") } } } } } #Preview { ContentView() }
0
0
106
1w
Persistent scroll stutter on iPhone 17 Pro Max, 18 Pro Max and 18 Pro (iOS 27.2), also on Apple Store demo units
Affected devices (all show the same problem): 1x iPhone 17 Pro Max 2x iPhone 18 Pro Max 1x iPhone 18 Pro Many demo iPhones at several Apple Stores Current iOS version: 27.2 Issue: Vertical scrolling inside apps frequently stutters and drops frames. It happens in many, many apps, including Apple's own App Store and Apple Store apps. During a normal flick-and-decelerate scroll, the content repeatedly freezes for one or more frames and then jumps forward. Because this reproduces on four of my own devices and on many Apple Store demo units, I believe it is a widespread, system-level issue, not a defect of a single device or my settings. Impact: I have been living with this for more than six months. I use my iPhone heavily every day, and the constant stutter has made using it genuinely distressing. Everything else about iPhone feels excellent, which makes this problem even harder to accept. Steps to reproduce: Open the App Store app (or almost any app with a scrolling list). Scroll with a normal flick and let it decelerate. Observe repeated hitches during the scroll. Measurements: I filmed the screen with a second iPhone at 4K 120 fps and measured content movement frame by frame: iPhone 18 Pro Max, third-party video feed: about 4 hitches per second of scrolling, about 4% of frames dropped, mostly single-frame drops. iPhone 18 Pro Max, third-party social app list: about 11 hitches per second, about 12% of frames dropped, at a regular rhythm every 6-8 frames. About a third of the stalls last 2-3 frames, and the content does not catch up afterwards. iPhone 17 Pro Max, third-party comment list: about 5 hitches per second, about 8% of frames dropped, including several full freezes of 50-75 ms. Expected: Smooth 120 Hz scrolling, as ProMotion is designed to deliver. Is Apple aware of this issue? I am happy to provide videos, frame-by-frame data, or sysdiagnose logs.
3
1
342
1w
On iPhone Duo in landscape, the tab bar isn't visible.
Hi, I have an app with a specific view hierarchy, and when I tested it on an iPhone Duo in landscape, I noticed an issue with how the tab bar is displayed or, rather, how it isn’t displayed. On iPhone Duo in landscape and on the main screen, the tab bar for a `UITabBarController` pushed onto a `UINavigationController` (itself inside another `UITabBarController`) isn’t visible. I've tested it in both UIKit and SwiftUI, and the issue is present in both. I could only get the tab bar to appear by presenting the view modally instead of pushing it, but that isn’t a viable solution for my app. For example: ``` UIWindow └─ RootTabBarController (UITabBarController) └─ UINavigationController (tab 2) ├─ FirstTabViewController (root) └─ push └─ NestedTabBarController (UITabBarController) ├─ ItemListViewController (UITableView) ├─ ItemListViewController (UITableView) └─ ItemListViewController (UITableView) ``` I've put together a simplified [demo repo](https://github.com/janossuta/iphone-duo-issue-demo/tree/main) that shows the problem. I've attached two images showing that the tabs disappear in landscape mode and are visible in portrait mode. Can we preserve the original functionality?
Topic: UI Frameworks SubTopic: General
0
0
45
1w
Cannot move window by its background (macOS 27)
Hi, My app (SmashTunes) can display a floating window with artwork of a music track that is displaying. It does for over a decade in multiple versions of macOS. I do this by calling window?.isMovableByWindowBackground = true. This stopped working under macOS 27. I've read some reports of others not being able to move windows. It should supposedly have been fixed in macOS 27.2, but it is not. Has anyone on this forum run into the same problem, or know of a different way to move windows around on the screen? When I add add a titlebar, I can drag it by the titlebar, but that is not really an option for my use case.
Topic: UI Frameworks SubTopic: General
1
0
177
1w
iPhone Duo: vanishing vertical toolbars; odd nav bar behavior.
Two things I've seen using the iPhone Duo simulator. I'm updating a venerable Objective-C app that dates back to iOS 4, but has been updated to be perfectly functional and appearance-appropriate on iOS 26. I'm building using the 21.1 beta SDK in Xcode 27.1 beta. TL;DR version: (1) my toolbar items vanish in vertical mode except while being tapped or dragged; and (2) the nav bar has an opaque, fixed background even as its title scrolls with underlying content. Has anyone else seen these oddities, and any ideas as to how I can fix 'em? First, with the Duo opened and taller than wide, the nav and tab bars in my app appear horizontally, as I would expect them to. But in any other pose or orientation, the bars adopt a vertical display, and aside from the left edge, their items are invisible: When I tap or drag on them, they become visible: When I stop tapping or dragging, they vanish again. Why do the vertical items go invisible, and how can I keep 'em always visible? Second, my scrolling view lies under the nav bar (in z-order) but extends to the top of the screen. If I scroll the view, it moves up onscreen, behind the opaque nav bar, although the nav bar's title scrolls up, too: If I go "far enough", the title scrolls off completely and the view's contents are visible full-height, but with the nav bar's background remaining. If I don't scroll that far, the title reappears when I stop, and the area above the nav bar goes opaque white, too, covering the content: Is it possible to disable the scrolling behavior on the nav bar title? (I'll just position my scrolling view to start below it spatially.) Alternatively, how can I turn off the background opacity? I've tried setting the background to clearColor and opacity to false... nav.navigationBar.backgroundColor = [UIColor clearColor]; nav.navigationBar.opaque = false; ...but these had no effect. Help me Obi-Wan Kenobi, you're my only hope...
Topic: UI Frameworks SubTopic: UIKit
8
0
1.7k
1w
iPhone Duo, Keyboard Events on Rotation?
In our app we're hiding and showing things based on whether the keyboard is on the screen or not so we're observing: UIResponder.keyboardWillShowNotification UIResponder.keyboardWillHideNotification And now that we've got hte iPhone Duo in house, I've been testing on there and noticed that those events are firing when the device is open and rotating? Is this by design? There's no keyboard on screen, but I'm receiving the events? This behavior is not showing on the other iPhone/iPad devices. To double-check I created a sample app and I'm seeing the same behavior 😔 enum KeyboardNotification { case willShow case didShow case willHide case didHide } extension KeyboardNotification: CustomStringConvertible { var description: String { switch self { case .willShow: "Will Show" case .didShow: "Did Show" case .willHide: "Will Hide" case .didHide: "Did Hide" } } } struct NotificationEntry { let notification: KeyboardNotification let date: Date init(_ notification: KeyboardNotification) { self.notification = notification self.date = Date() } } struct TestView: View { @State private var entries: [NotificationEntry] = [] private let dateFormatter: DateFormatter = { let formatter = DateFormatter() formatter.dateStyle = .short formatter.timeStyle = .short return formatter }() var body: some View { ZStack { if !entries.isEmpty { List { ForEach(entries, id: \.date) { entry in VStack(alignment: .leading) { Text(String(describing: entry.notification)) Text(dateFormatter.string(from: entry.date)) .font(.caption) .foregroundStyle(.gray) } } } } else { VStack(alignment: .leading) { Text("No Keyboard Events") Text("Rotate the device to test.") .font(.caption) .foregroundStyle(.gray) } } } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { _ in entries.append(NotificationEntry(.willShow)) } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardDidShowNotification)) { _ in entries.append(NotificationEntry(.didShow)) } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillHideNotification)) { _ in entries.append(NotificationEntry(.willHide)) } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardDidHideNotification)) { _ in entries.append(NotificationEntry(.didHide)) } } }In my test app, the events will not always fire but after messing with it for a little bit it will eventually get in the state where it the events fire. Sometimes I will additionally see them when bringing down the notification center, or slightly going to the app switcher.
0
0
124
1w
IOS 27 getting false response from isInterfaceOrientationLocked when autorotate is on
I have an app almost ready to submit for distribution. It is a game with a fixed background view and a token that moves around on the fixed background. The token is moved by tilting the iPhone/iPad which is translated to movement based on CMMotionManager as roll and pitch readings. This simulates a flat level playing field with gravity pulling the token when the device is tipped. The app works well only when the user has set the device to have Autorotate locked. The following code lets me sample the status of Autorate: guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return } print("Orientation locked: ", windowScene.effectiveGeometry.isInterfaceOrientationLocked) The problem is that I always get a reading of false regardless of whether Autorotate is locked or not. Can anyone help me understand. Is this the wrong approach for getting this information? If so, how is this achieved? Thanks for your attention to this, Mike Ricker
0
0
143
1w
iOS 27 regression - minimized search item in top toolbar breaks its state
struct ContentView: View { @State var searchText: String = "" var body: some View { TabView { Tab { NavigationStack { List { Text("Hello!") Text("Hello!") Text("Hello!") Text("Hello!") Text("Hello!") Text("Hello!") } .navigationTitle("Have a title") .searchable(text: $searchText, placement: .toolbar) .searchToolbarBehavior(.minimize) .toolbar { DefaultToolbarItem(kind: .search, placement: .topBarTrailing) } } } } } } In iOS 26, this worked no problem. In iOS 27, this leaves the search bar either unable to collapse (when pressing the close button) or in a broken state where it cannot be opened again.
Topic: UI Frameworks SubTopic: SwiftUI
10
12
1.9k
2w
UISheetPresentationController's per-detent backgroundEffect doesn't transition during interactive drags
I'm using the new per-detent backgroundEffect (iOS 26.1+) on UISheetPresentationControllerDetent. When the user drags the sheet between two detents with different effects, nothing changes during the drag; the previous detent's effect stays until the finger lifts, then a fixed-length cross-fade runs on its own, decoupled from the sheet's settle animation. It reads as a jump. Minimal setup (form sheet, nothing else): UISheetPresentationControllerDetent *medium = [UISheetPresentationControllerDetent mediumDetent]; UISheetPresentationControllerDetent *tall = [UISheetPresentationControllerDetent customDetentWithIdentifier:@"c90" resolver:^CGFloat(id<UISheetPresentationControllerDetentResolutionContext> ctx) { return ctx.maximumDetentValue * 0.9; }]; medium.backgroundEffect = nil; tall.backgroundEffect = [UIColorEffect effectWithColor:UIColor.systemBackgroundColor]; sheet.detents = @[ medium, tall ];Expected: the effect transition is driven by the drag progress between adjacent detents, or at least runs inside the same settle animation as the height change. Reproduces on iOS 26.5 (23F77) and 27.0 (24A434) Simulator with iPhone 17 Pro, iOS 27.1 (24A94401) Simulator with iPhone Duo. Xcode 27.1. Is this intended, and is there a supported way to tie the per-detent effect transition to the gesture? Filed as FB25459597.
Topic: UI Frameworks SubTopic: UIKit
0
1
53
2w
Inconsistent additionalOverflowItems layout behavior between iOS 18 and iOS 26
I am currently testing additionalOverflowItems with the expectation that it behaves as follows: Keep UIBarButtonItem instances visible directly on the toolbar as icons whenever there is sufficient space. Only move items into the overflow menu when there isn't enough screen real estate. In iOS 26, additionalOverflowItems behaves exactly as described above. However, in iOS 18, the system tends to aggressively move all UIBarButtonItem instances into the overflow menu regardless of available space. Is this change in layout behavior documented anywhere? Can we rely on iOS 26 and future releases maintaining this current behavior, or are the layout heuristics for additionalOverflowItems considered undefined implementation details? Because this behavior isn't clearly documented, I have held off on adopting additionalOverflowItems in production. I have attached screenshots and sample source code below for reference. // On iOS 26, the action mode bar buttons may not fit. iOS then moves the ones that do not fit into its own overflow // menu, listing each by title, and the more button's menu would become a nested "More" submenu there. Instead, in // note and archive action mode, the more button is not shown and its actions are added to the system overflow // menu directly. iOS shows that menu, and moves the buttons that do not fit into it, based on the available space. private var isActionModeMenuInOverflowMenu: Bool { guard #available(iOS 16, *) else { return false } guard actionMode else { return false } switch pageKind { case .notes, .archive: return true default: return false } } private func updateAdditionalOverflowItems() { guard #available(iOS 16, *) else { return } guard isActionModeMenuInOverflowMenu else { navigationItem.additionalOverflowItems = nil return } // Built when the menu is opened, so that it reflects the current selection. navigationItem.additionalOverflowItems = UIDeferredMenuElement.uncached { [weak self] completion in guard let self = self, self.isActionModeMenuInOverflowMenu else { completion([]) return } let selectedNSPlainNotes = self.selectedNSPlainNotes switch self.pageKind { case .notes: completion(self.generateNoteActionModeMenu(selectedNSPlainNotes).children) case .archive: completion(self.generateArchiveActionModeMenu(selectedNSPlainNotes).children) default: completion([]) } } }
Topic: UI Frameworks SubTopic: UIKit
0
0
71
2w
iPadOS: UITextField .phonePad popover does not reopen after dismissal while still first responder
I can reproduce a phone-keypad popover reopening issue in a standalone UIKit app, with no third-party frameworks or custom input view. Environment iPad Pro 11-inch (M4) simulator, iPadOS 26.5, landscape Xcode 27.1 Observed when UIKit presents the small telephone-keypad popover for a UITextField whose keyboardType is .phonePad. Device Hub's hardware/software keyboard settings affect whether this popover or the full-width keyboard appears. Reproduced both in a plain UIViewController inside UINavigationController and in a stock UISplitViewController. Physical-device behavior and other OS versions have not been verified. Steps Add a normal UITextField, set keyboardType = .phonePad, and call becomeFirstResponder() in viewDidAppear. With the small phone-keypad popover visible, tap blank space outside it to dismiss it. Tap the same text field again. Expected: The telephone-keypad popover reopens so the user can continue entering a phone number. Actual: The popover does not reopen. Sometimes an AutoFill edit menu appears instead. The text field still reports isFirstResponder == true. Calling becomeFirstResponder() again returns true but does not restore the keypad. The baseline has no UITextFieldDelegate, custom gesture recognizer, custom inputView, or automatic focus-recovery code. Diagnostic results in this environment Repeating becomeFirstResponder() while already first responder: returns true, keypad remains absent. Explicitly calling reloadInputViews(): keypad reappears. Explicitly calling resignFirstResponder(), then becomeFirstResponder() in a separate button action: keypad reappears. Recreating the view controller: keypad reappears. The attached animated screen recording shows initial presentation, dismissal, a failed retap, a responder-state snapshot, another becomeFirstResponder() call, and recovery after Reload inputs. The diagnostic buttons only perform the named action; no recovery runs automatically. Relevant setup/actions from the standalone app: private let phoneField = UITextField() // viewDidLoad: add phoneField to the view and set its constraints phoneField.keyboardType = .phonePad // viewDidAppear let result = phoneField.becomeFirstResponder() print(result, phoneField.isFirstResponder) // Diagnostic button A, after dismissing and retapping: let again = phoneField.becomeFirstResponder() print(again, phoneField.isFirstResponder) // true, true; keypad absent // Diagnostic button B: phoneField.reloadInputViews() // popover reappears in this testOne additional observation: keyboard hide notifications can be delivered even while the small telephone-keypad popover is visibly present. Therefore, the last keyboard notification/frame is not a reliable visibility signal for this popover in this test. Is this an expected distinction between the phone-keypad popover and the software keyboard, or a UIKit/Simulator issue? What is the recommended public-API approach to allow a user to reopen it after dismissal? In particular, is calling reloadInputViews() when the field is already first responder an appropriate workaround, and is there a supported way to detect this popover's dismissed state? I have not yet filed a Feedback Assistant report, so there is no FB number to reference. I can provide the standalone reproduction project if needed.
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
105
2w
Charts are broken with Xcode 27, Plotting multiple lines
Hi, Charts—specifically those with multiple lines—are broken in Xcode 27. First, I spotted the bug in my program, and then I checked your example. Your own example Plotting-multiple-lines is not working correctly anymore. It shows 1 line or sometimes no lines at all, depending on the order of the data. It depends on how the data is passed to the chart. If the data is passed as separate series, it works. In Visualizing your app’s data it works, but the data is passed as described before. Don't follow Microslop: have the AI ​​generate the code and then skip the tests. This is a serious bug that requires a lot of work to rearrange the data, just to work around the issue. Christian
9
0
1.9k
2w
Catalyst layout sizes unexpected
On a 16" M5 MBP running 26.7.2 I have the display set to "1496 x 967" in the display section of Settings.app; the native resolution of the LCD panel is 3456 wide per the "System Information" report. When I inspect DOM nodes in a full screen width browser window, nodes which span the width of the screen show the expected 1496 CSS pixel width. However, when I run a Mac Catalyst app in Xcode, with its window at full screen width, and I inspect the bounds property of a UIView with the full width of the window, it reports its width as 1943 points wide, which doesn't match the value I expect (1496, same as FF sees) or the 'native point-resolution' of the display at 2x (1728 points). Furthermore, the nativeScale property of the UIWindow is 2, which combined with the point width contradicts the actual resolution of the LCD (i.e. 2*1943 != 3456.) I've looked for documentation but haven't found any. Where is 1943 point width coming from and why is the nativeScale 2? I was expecting 1496 and 1496/3456.
2
0
375
2w
A layout bug when using Tab View in SwiftUI
I've been getting some unexpected behavior when using TabView as the root view in SwiftUI, which I believe to be a bug. I created a barebones app to isolate the bug and will paste the code at the end for anyone who wants to try to reproduce it if you have a physical Duo device. Details below copied from my Feedback ticket FB25490881. Xcode 27.1. What's the bug? When you have a TabView as the root view inside the ContentView.swift and you open the app on the outer screen, then swipe it to the background, unfold the phone and tap the app to bring it to the foreground, any UI element without a fixed frame size gets moved off screen. And any UI element with a fixed frame size gets moved to the very top of the screen. See my two screenshots of outer vs inner display. How to reproduce: 1- Unzip the project folder and open it in Xcode. 2- With a physical Duo on hand, run the app on the Duo. 3- On the outer screen, launch the app. 4- Swipe the app to the background (Do not swipe completely to close the app, just swipe it to the background so it is still running) 5- Unfold the iPhone Duo completely open. 6- Tap the app icon to bring it to the foreground. 7- Look at the broken UI. Also note even the side tab bar itself is broken, it has no padding with the edge of the screen. This is managed by the system. The workaround to fix it: 1- Go to the ContentView.Swift in Xcode. 2- Uncomment "NavigationStack {" on line 13. 3- Uncomment the closing bracket "}" on line 2. 4- Repeat the previous from how to reproduce the bug. My hypothesis: The system reports 0 height for the inner screen in that moment you bring the app to the foreground. Anything with a fixed frame will move to the top, anything with flexible height will not be visible. This only happens when TabView is the root of the scene. Other Useful Information: I hit a very similar bug to this in my main app that I'm still developing, unfortunately I was not able to reproduce it in a sandbox simple app. The bug was: 1- Open the app on outer screen 2- While the app is open, tilt the Duo to the back at a certain angle 3- Unfold the Duo 4- You get this exact same bug where everything with a flexible height disappears off screen or collapses to zero if it's in between UI elements with fixed heights. And everything moves to the top of the screen. I'm not sure why I wasn't able to reproduce it on a sandbox app, but the fix was the same, either remove the TabView completely or put it inside a NavigationStack. I want to stress that this one had to do with the backwards tilt of the phone itself while unfolding it, very weird I know. ContentView.swift: import SwiftUI @available(iOS 27.1, *) struct ContentView: View { var body: some View { // NavigationStack { TabView { HomeTabView() .tabItem { Label("Home", systemImage: "house") } StoreView() .tabItem { Label("Store", systemImage: "bag") } } .tint(Color.black) // } } } HomeTabView.swift: import SwiftUI @available(iOS 27.1, *) struct HomeTabView: View { var body: some View { VStack { Text("Jenny") .font(.largeTitle) .fontWeight(.bold) .padding() .frame(maxWidth: .infinity) .frame(height: 200) .background(Color.gray, in: .rect(cornerRadius: 28)) Spacer() Circle() .fill(Color.blue) .frame(width: 100, height: 100) .padding(.bottom, 50) } .contentMargins(for: .container, edges: .horizontal) } } StoreView.swift is just an default empty swiftUI file with the default Text("Hello, World!")
Replies
2
Boosts
0
Views
420
Activity
1w
TabView(.page) extended under the tab bar shifts its pages up after the container height shrinks while visible
Summary A page-style TabView that extends under the bottom tab bar with .ignoresSafeArea(edges: .bottom) leaves its pages shifted upward after its height shrinks while it is on screen. The shift is half of the bottom safe area (41.67 pt with an 83.33 pt tab bar area), and the top of each page is hidden. The internal UICollectionView (contentInsetAdjustmentBehavior == .automatic) seems to briefly add the bottom safe area to adjustedContentInset.bottom during the resize. The inset goes back to 0 afterwards, but the visible cell is left at frame.minY == -41.67. Environment Xcode 27.0 (27A266a), iPhone Duo Simulator (iOS 27.1), deployment target iOS 18.0 In a unit test it also reproduces when only the window height shrinks (386×678 → 386×600), so it does not depend on the foldable device Steps to reproduce Run the code below on the iPhone Duo Simulator while it is folded Unfold the device Expected The red "Top of page 0" area stays directly below the yellow header, as it does when the app is launched unfolded. Actual The top of the red area is hidden under the header. Log output: folded (launch): height=628.00 adjustedContentInset.bottom=0.00 cell.minY=0.00 after unfolding: height=619.00 adjustedContentInset.bottom=0.00 cell.minY=-41.67In this sample the page returns to its position when the device is folded again. In our app it stays shifted, and after the shift, tapping to switch pages sometimes stops working until the user swipes. Notes Removing .ignoresSafeArea(edges: .bottom) avoids the issue, but the content then no longer extends under the translucent tab bar Setting edgesForExtendedLayout = [] on the hosting controller also avoids it, with the same visual change. safeAreaRegions = [] and setContentScrollView(nil, for:) do not help A non-transparent background on the TabView or its pages, as suggested in https://developer.apple.com/forums/thread/762286, does not help. The trigger here is a size change, not a page switch, so this seems to be a different issue Current workaround: find the internal UICollectionView through the superview chain and set contentInsetAdjustmentBehavior = .never. This works, but it relies on the private view hierarchy. Is there a supported way to avoid this? Minimal reproduction import SwiftUI import UIKit // A TabView(.page) extended under the tab bar with .ignoresSafeArea(edges: .bottom). // Resizing the window while it is visible (e.g. unfolding) shifts the page up. struct PagerView: View { @State private var selection = 0 var body: some View { VStack(spacing: 0) { Color.yellow.frame(height: 50).overlay(Text("Header")) TabView(selection: $selection) { ForEach(0..<2) { index in ScrollView { Color.red.frame(height: 120).overlay(Text("Top of page \(index)")) ForEach(0..<30) { Text("Row \($0)").frame(maxWidth: .infinity, minHeight: 44) } } .tag(index) } } .tabViewStyle(.page(indexDisplayMode: .never)) } .ignoresSafeArea(edges: .bottom) } } final class PagerViewController: UIHostingController<PagerView> { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in self?.logCollectionView() } } private func logCollectionView() { func find(_ view: UIView) -> UICollectionView? { view as? UICollectionView ?? view.subviews.lazy.compactMap(find).first } guard let collectionView = find(view) else { return } let cellMinY = collectionView.visibleCells.first?.frame.minY ?? .nan NSLog("FORUM height=%.2f adjustedContentInset.bottom=%.2f cell.minY=%.2f", collectionView.bounds.height, collectionView.adjustedContentInset.bottom, cellMinY) } } @main final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, configurationForConnecting session: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { let configuration = UISceneConfiguration(name: nil, sessionRole: session.role) configuration.delegateClass = SceneDelegate.self return configuration } } final class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { let pager = PagerViewController(rootView: PagerView()) pager.tabBarItem = UITabBarItem(title: "Pager", image: UIImage(systemName: "square"), tag: 0) let other = UIViewController() other.tabBarItem = UITabBarItem(title: "Other", image: UIImage(systemName: "circle"), tag: 1) let tabBarController = UITabBarController() tabBarController.viewControllers = [pager, other] window = UIWindow(windowScene: scene as! UIWindowScene) window?.rootViewController = tabBarController window?.makeKeyAndVisible() } }
Replies
3
Boosts
2
Views
403
Activity
1w
Is a scene always connected when a UIScene app is launched in the background (silent push, BGTask, background URLSession)?
Hello, We are migrating a large UIKit app from the app-delegate lifecycle to the UIScene lifecycle. (Building with Xcode 27 / iOS 27 SDK, our non-scene app crashes at launch with EXC_BREAKPOINT in _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption.) Our startup work runs from application(_:didFinishLaunchingWithOptions:), and we need to know what is guaranteed for background launches. Observed (iPhone 15 Pro, iOS 27.2, app built with Xcode 26.3; also iOS 17.5 simulator): Non-scene build, launched by a content-available push: launchOptions contained UIApplicationLaunchOptionsRemoteNotificationKey. applicationDidEnterBackground was not called during the background run. Non-scene build, launched by a BGProcessingTask: launchOptions empty. applicationDidEnterBackground was not called; the first lifecycle callback was applicationWillEnterForeground when the user opened the app 8 minutes later. Scene build, launched by a BGProcessingTask and by a content-available push: scene(_:willConnectTo:options:) was called 0.15-0.2 s after didFinishLaunching while applicationState == .background (activationState .unattached). connectionOptions had no notificationResponse, URL or shortcut item. In the push launch, scene(_:willConnectTo:options:) was called 37 ms before application(_:didReceiveRemoteNotification:fetchCompletionHandler:). sceneWillEnterForeground / sceneDidEnterBackground were not called before the process was suspended. Scene build, background URLSession relaunch (simulator): the scene also connected right after didFinishLaunching in the background, 6 ms before application(_:handleEventsForBackgroundURLSession:completionHandler:). Question: For a UIScene-based app that the system launches directly into the background (content-available push, BGTaskScheduler task, background URLSession events), is it guaranteed that UIKit connects a scene session (scene(_:willConnectTo:options:)) before the user opens the app, or can a background launch run with no connected scene until the app comes to the foreground? In the same launches, can sceneDidEnterBackground (or applicationDidEnterBackground in a non-scene app) be called for a process that never entered the foreground? Please point us to documentation that describes the guaranteed callbacks and their order for background launches. Thank you.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
88
Activity
1w
iPhone: Inspector Sheet Issue with Navigation Toolbar Toggle
Hello, I think this might be a bug, but I'm not sure (see the code below). FB25486625 On iPhone, when the inspector is presented as a SHEET, swiping down to dismiss it (instead of tapping the close button inside the inspector) causes the navigation toolbar toggle to stop working properly: tapping it once won't reopen the inspector. You have to tap it twice (turning it on and off again) to make the inspector appear again. This doesn't happen when the inspector is presented as a SIDEBAR on iPad or macOS. import SwiftUI struct ContentView: View { @State private var showInspector = false var body: some View { NavigationStack{ Text("Hello, world!") .padding() .inspector(isPresented: $showInspector) { Button("Close Inspector", role: .cancel) { showInspector.toggle() } Text("On iPhone, with inspector as SHEET, if you swipe to close (instead of tap the close button), the toggle in the navigation toolbar won't open the inspector next time (half the time). It doesn't affect inspector as SIDEBAR on iPad") .padding() Spacer() } .toolbar { Toggle(isOn: $showInspector) { Label("Open", systemImage: "sidebar.trailing") } } } } } #Preview { ContentView() }
Replies
0
Boosts
0
Views
106
Activity
1w
Persistent scroll stutter on iPhone 17 Pro Max, 18 Pro Max and 18 Pro (iOS 27.2), also on Apple Store demo units
Affected devices (all show the same problem): 1x iPhone 17 Pro Max 2x iPhone 18 Pro Max 1x iPhone 18 Pro Many demo iPhones at several Apple Stores Current iOS version: 27.2 Issue: Vertical scrolling inside apps frequently stutters and drops frames. It happens in many, many apps, including Apple's own App Store and Apple Store apps. During a normal flick-and-decelerate scroll, the content repeatedly freezes for one or more frames and then jumps forward. Because this reproduces on four of my own devices and on many Apple Store demo units, I believe it is a widespread, system-level issue, not a defect of a single device or my settings. Impact: I have been living with this for more than six months. I use my iPhone heavily every day, and the constant stutter has made using it genuinely distressing. Everything else about iPhone feels excellent, which makes this problem even harder to accept. Steps to reproduce: Open the App Store app (or almost any app with a scrolling list). Scroll with a normal flick and let it decelerate. Observe repeated hitches during the scroll. Measurements: I filmed the screen with a second iPhone at 4K 120 fps and measured content movement frame by frame: iPhone 18 Pro Max, third-party video feed: about 4 hitches per second of scrolling, about 4% of frames dropped, mostly single-frame drops. iPhone 18 Pro Max, third-party social app list: about 11 hitches per second, about 12% of frames dropped, at a regular rhythm every 6-8 frames. About a third of the stalls last 2-3 frames, and the content does not catch up afterwards. iPhone 17 Pro Max, third-party comment list: about 5 hitches per second, about 8% of frames dropped, including several full freezes of 50-75 ms. Expected: Smooth 120 Hz scrolling, as ProMotion is designed to deliver. Is Apple aware of this issue? I am happy to provide videos, frame-by-frame data, or sysdiagnose logs.
Replies
3
Boosts
1
Views
342
Activity
1w
On iPhone Duo in landscape, the tab bar isn't visible.
Hi, I have an app with a specific view hierarchy, and when I tested it on an iPhone Duo in landscape, I noticed an issue with how the tab bar is displayed or, rather, how it isn’t displayed. On iPhone Duo in landscape and on the main screen, the tab bar for a `UITabBarController` pushed onto a `UINavigationController` (itself inside another `UITabBarController`) isn’t visible. I've tested it in both UIKit and SwiftUI, and the issue is present in both. I could only get the tab bar to appear by presenting the view modally instead of pushing it, but that isn’t a viable solution for my app. For example: ``` UIWindow └─ RootTabBarController (UITabBarController) └─ UINavigationController (tab 2) ├─ FirstTabViewController (root) └─ push └─ NestedTabBarController (UITabBarController) ├─ ItemListViewController (UITableView) ├─ ItemListViewController (UITableView) └─ ItemListViewController (UITableView) ``` I've put together a simplified [demo repo](https://github.com/janossuta/iphone-duo-issue-demo/tree/main) that shows the problem. I've attached two images showing that the tabs disappear in landscape mode and are visible in portrait mode. Can we preserve the original functionality?
Topic: UI Frameworks SubTopic: General
Replies
0
Boosts
0
Views
45
Activity
1w
Cannot move window by its background (macOS 27)
Hi, My app (SmashTunes) can display a floating window with artwork of a music track that is displaying. It does for over a decade in multiple versions of macOS. I do this by calling window?.isMovableByWindowBackground = true. This stopped working under macOS 27. I've read some reports of others not being able to move windows. It should supposedly have been fixed in macOS 27.2, but it is not. Has anyone on this forum run into the same problem, or know of a different way to move windows around on the screen? When I add add a titlebar, I can drag it by the titlebar, but that is not really an option for my use case.
Topic: UI Frameworks SubTopic: General
Replies
1
Boosts
0
Views
177
Activity
1w
iPhone Duo: vanishing vertical toolbars; odd nav bar behavior.
Two things I've seen using the iPhone Duo simulator. I'm updating a venerable Objective-C app that dates back to iOS 4, but has been updated to be perfectly functional and appearance-appropriate on iOS 26. I'm building using the 21.1 beta SDK in Xcode 27.1 beta. TL;DR version: (1) my toolbar items vanish in vertical mode except while being tapped or dragged; and (2) the nav bar has an opaque, fixed background even as its title scrolls with underlying content. Has anyone else seen these oddities, and any ideas as to how I can fix 'em? First, with the Duo opened and taller than wide, the nav and tab bars in my app appear horizontally, as I would expect them to. But in any other pose or orientation, the bars adopt a vertical display, and aside from the left edge, their items are invisible: When I tap or drag on them, they become visible: When I stop tapping or dragging, they vanish again. Why do the vertical items go invisible, and how can I keep 'em always visible? Second, my scrolling view lies under the nav bar (in z-order) but extends to the top of the screen. If I scroll the view, it moves up onscreen, behind the opaque nav bar, although the nav bar's title scrolls up, too: If I go "far enough", the title scrolls off completely and the view's contents are visible full-height, but with the nav bar's background remaining. If I don't scroll that far, the title reappears when I stop, and the area above the nav bar goes opaque white, too, covering the content: Is it possible to disable the scrolling behavior on the nav bar title? (I'll just position my scrolling view to start below it spatially.) Alternatively, how can I turn off the background opacity? I've tried setting the background to clearColor and opacity to false... nav.navigationBar.backgroundColor = [UIColor clearColor]; nav.navigationBar.opaque = false; ...but these had no effect. Help me Obi-Wan Kenobi, you're my only hope...
Topic: UI Frameworks SubTopic: UIKit
Replies
8
Boosts
0
Views
1.7k
Activity
1w
iPhone Duo, Keyboard Events on Rotation?
In our app we're hiding and showing things based on whether the keyboard is on the screen or not so we're observing: UIResponder.keyboardWillShowNotification UIResponder.keyboardWillHideNotification And now that we've got hte iPhone Duo in house, I've been testing on there and noticed that those events are firing when the device is open and rotating? Is this by design? There's no keyboard on screen, but I'm receiving the events? This behavior is not showing on the other iPhone/iPad devices. To double-check I created a sample app and I'm seeing the same behavior 😔 enum KeyboardNotification { case willShow case didShow case willHide case didHide } extension KeyboardNotification: CustomStringConvertible { var description: String { switch self { case .willShow: "Will Show" case .didShow: "Did Show" case .willHide: "Will Hide" case .didHide: "Did Hide" } } } struct NotificationEntry { let notification: KeyboardNotification let date: Date init(_ notification: KeyboardNotification) { self.notification = notification self.date = Date() } } struct TestView: View { @State private var entries: [NotificationEntry] = [] private let dateFormatter: DateFormatter = { let formatter = DateFormatter() formatter.dateStyle = .short formatter.timeStyle = .short return formatter }() var body: some View { ZStack { if !entries.isEmpty { List { ForEach(entries, id: \.date) { entry in VStack(alignment: .leading) { Text(String(describing: entry.notification)) Text(dateFormatter.string(from: entry.date)) .font(.caption) .foregroundStyle(.gray) } } } } else { VStack(alignment: .leading) { Text("No Keyboard Events") Text("Rotate the device to test.") .font(.caption) .foregroundStyle(.gray) } } } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { _ in entries.append(NotificationEntry(.willShow)) } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardDidShowNotification)) { _ in entries.append(NotificationEntry(.didShow)) } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillHideNotification)) { _ in entries.append(NotificationEntry(.willHide)) } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardDidHideNotification)) { _ in entries.append(NotificationEntry(.didHide)) } } }In my test app, the events will not always fire but after messing with it for a little bit it will eventually get in the state where it the events fire. Sometimes I will additionally see them when bringing down the notification center, or slightly going to the app switcher.
Replies
0
Boosts
0
Views
124
Activity
1w
IOS 27 getting false response from isInterfaceOrientationLocked when autorotate is on
I have an app almost ready to submit for distribution. It is a game with a fixed background view and a token that moves around on the fixed background. The token is moved by tilting the iPhone/iPad which is translated to movement based on CMMotionManager as roll and pitch readings. This simulates a flat level playing field with gravity pulling the token when the device is tipped. The app works well only when the user has set the device to have Autorotate locked. The following code lets me sample the status of Autorate: guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return } print("Orientation locked: ", windowScene.effectiveGeometry.isInterfaceOrientationLocked) The problem is that I always get a reading of false regardless of whether Autorotate is locked or not. Can anyone help me understand. Is this the wrong approach for getting this information? If so, how is this achieved? Thanks for your attention to this, Mike Ricker
Replies
0
Boosts
0
Views
143
Activity
1w
iOS 27 regression - minimized search item in top toolbar breaks its state
struct ContentView: View { @State var searchText: String = "" var body: some View { TabView { Tab { NavigationStack { List { Text("Hello!") Text("Hello!") Text("Hello!") Text("Hello!") Text("Hello!") Text("Hello!") } .navigationTitle("Have a title") .searchable(text: $searchText, placement: .toolbar) .searchToolbarBehavior(.minimize) .toolbar { DefaultToolbarItem(kind: .search, placement: .topBarTrailing) } } } } } } In iOS 26, this worked no problem. In iOS 27, this leaves the search bar either unable to collapse (when pressing the close button) or in a broken state where it cannot be opened again.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
10
Boosts
12
Views
1.9k
Activity
2w
UISheetPresentationController's per-detent backgroundEffect doesn't transition during interactive drags
I'm using the new per-detent backgroundEffect (iOS 26.1+) on UISheetPresentationControllerDetent. When the user drags the sheet between two detents with different effects, nothing changes during the drag; the previous detent's effect stays until the finger lifts, then a fixed-length cross-fade runs on its own, decoupled from the sheet's settle animation. It reads as a jump. Minimal setup (form sheet, nothing else): UISheetPresentationControllerDetent *medium = [UISheetPresentationControllerDetent mediumDetent]; UISheetPresentationControllerDetent *tall = [UISheetPresentationControllerDetent customDetentWithIdentifier:@"c90" resolver:^CGFloat(id<UISheetPresentationControllerDetentResolutionContext> ctx) { return ctx.maximumDetentValue * 0.9; }]; medium.backgroundEffect = nil; tall.backgroundEffect = [UIColorEffect effectWithColor:UIColor.systemBackgroundColor]; sheet.detents = @[ medium, tall ];Expected: the effect transition is driven by the drag progress between adjacent detents, or at least runs inside the same settle animation as the height change. Reproduces on iOS 26.5 (23F77) and 27.0 (24A434) Simulator with iPhone 17 Pro, iOS 27.1 (24A94401) Simulator with iPhone Duo. Xcode 27.1. Is this intended, and is there a supported way to tie the per-detent effect transition to the gesture? Filed as FB25459597.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
1
Views
53
Activity
2w
Inconsistent additionalOverflowItems layout behavior between iOS 18 and iOS 26
I am currently testing additionalOverflowItems with the expectation that it behaves as follows: Keep UIBarButtonItem instances visible directly on the toolbar as icons whenever there is sufficient space. Only move items into the overflow menu when there isn't enough screen real estate. In iOS 26, additionalOverflowItems behaves exactly as described above. However, in iOS 18, the system tends to aggressively move all UIBarButtonItem instances into the overflow menu regardless of available space. Is this change in layout behavior documented anywhere? Can we rely on iOS 26 and future releases maintaining this current behavior, or are the layout heuristics for additionalOverflowItems considered undefined implementation details? Because this behavior isn't clearly documented, I have held off on adopting additionalOverflowItems in production. I have attached screenshots and sample source code below for reference. // On iOS 26, the action mode bar buttons may not fit. iOS then moves the ones that do not fit into its own overflow // menu, listing each by title, and the more button's menu would become a nested "More" submenu there. Instead, in // note and archive action mode, the more button is not shown and its actions are added to the system overflow // menu directly. iOS shows that menu, and moves the buttons that do not fit into it, based on the available space. private var isActionModeMenuInOverflowMenu: Bool { guard #available(iOS 16, *) else { return false } guard actionMode else { return false } switch pageKind { case .notes, .archive: return true default: return false } } private func updateAdditionalOverflowItems() { guard #available(iOS 16, *) else { return } guard isActionModeMenuInOverflowMenu else { navigationItem.additionalOverflowItems = nil return } // Built when the menu is opened, so that it reflects the current selection. navigationItem.additionalOverflowItems = UIDeferredMenuElement.uncached { [weak self] completion in guard let self = self, self.isActionModeMenuInOverflowMenu else { completion([]) return } let selectedNSPlainNotes = self.selectedNSPlainNotes switch self.pageKind { case .notes: completion(self.generateNoteActionModeMenu(selectedNSPlainNotes).children) case .archive: completion(self.generateArchiveActionModeMenu(selectedNSPlainNotes).children) default: completion([]) } } }
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
71
Activity
2w
iPadOS: UITextField .phonePad popover does not reopen after dismissal while still first responder
I can reproduce a phone-keypad popover reopening issue in a standalone UIKit app, with no third-party frameworks or custom input view. Environment iPad Pro 11-inch (M4) simulator, iPadOS 26.5, landscape Xcode 27.1 Observed when UIKit presents the small telephone-keypad popover for a UITextField whose keyboardType is .phonePad. Device Hub's hardware/software keyboard settings affect whether this popover or the full-width keyboard appears. Reproduced both in a plain UIViewController inside UINavigationController and in a stock UISplitViewController. Physical-device behavior and other OS versions have not been verified. Steps Add a normal UITextField, set keyboardType = .phonePad, and call becomeFirstResponder() in viewDidAppear. With the small phone-keypad popover visible, tap blank space outside it to dismiss it. Tap the same text field again. Expected: The telephone-keypad popover reopens so the user can continue entering a phone number. Actual: The popover does not reopen. Sometimes an AutoFill edit menu appears instead. The text field still reports isFirstResponder == true. Calling becomeFirstResponder() again returns true but does not restore the keypad. The baseline has no UITextFieldDelegate, custom gesture recognizer, custom inputView, or automatic focus-recovery code. Diagnostic results in this environment Repeating becomeFirstResponder() while already first responder: returns true, keypad remains absent. Explicitly calling reloadInputViews(): keypad reappears. Explicitly calling resignFirstResponder(), then becomeFirstResponder() in a separate button action: keypad reappears. Recreating the view controller: keypad reappears. The attached animated screen recording shows initial presentation, dismissal, a failed retap, a responder-state snapshot, another becomeFirstResponder() call, and recovery after Reload inputs. The diagnostic buttons only perform the named action; no recovery runs automatically. Relevant setup/actions from the standalone app: private let phoneField = UITextField() // viewDidLoad: add phoneField to the view and set its constraints phoneField.keyboardType = .phonePad // viewDidAppear let result = phoneField.becomeFirstResponder() print(result, phoneField.isFirstResponder) // Diagnostic button A, after dismissing and retapping: let again = phoneField.becomeFirstResponder() print(again, phoneField.isFirstResponder) // true, true; keypad absent // Diagnostic button B: phoneField.reloadInputViews() // popover reappears in this testOne additional observation: keyboard hide notifications can be delivered even while the small telephone-keypad popover is visibly present. Therefore, the last keyboard notification/frame is not a reliable visibility signal for this popover in this test. Is this an expected distinction between the phone-keypad popover and the software keyboard, or a UIKit/Simulator issue? What is the recommended public-API approach to allow a user to reopen it after dismissal? In particular, is calling reloadInputViews() when the field is already first responder an appropriate workaround, and is there a supported way to detect this popover's dismissed state? I have not yet filed a Feedback Assistant report, so there is no FB number to reference. I can provide the standalone reproduction project if needed.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
0
Boosts
0
Views
105
Activity
2w
Charts are broken with Xcode 27, Plotting multiple lines
Hi, Charts—specifically those with multiple lines—are broken in Xcode 27. First, I spotted the bug in my program, and then I checked your example. Your own example Plotting-multiple-lines is not working correctly anymore. It shows 1 line or sometimes no lines at all, depending on the order of the data. It depends on how the data is passed to the chart. If the data is passed as separate series, it works. In Visualizing your app’s data it works, but the data is passed as described before. Don't follow Microslop: have the AI ​​generate the code and then skip the tests. This is a serious bug that requires a lot of work to rearrange the data, just to work around the issue. Christian
Replies
9
Boosts
0
Views
1.9k
Activity
2w
Catalyst layout sizes unexpected
On a 16" M5 MBP running 26.7.2 I have the display set to "1496 x 967" in the display section of Settings.app; the native resolution of the LCD panel is 3456 wide per the "System Information" report. When I inspect DOM nodes in a full screen width browser window, nodes which span the width of the screen show the expected 1496 CSS pixel width. However, when I run a Mac Catalyst app in Xcode, with its window at full screen width, and I inspect the bounds property of a UIView with the full width of the window, it reports its width as 1943 points wide, which doesn't match the value I expect (1496, same as FF sees) or the 'native point-resolution' of the display at 2x (1728 points). Furthermore, the nativeScale property of the UIWindow is 2, which combined with the point width contradicts the actual resolution of the LCD (i.e. 2*1943 != 3456.) I've looked for documentation but haven't found any. Where is 1943 point width coming from and why is the nativeScale 2? I was expecting 1496 and 1496/3456.
Replies
2
Boosts
0
Views
375
Activity
2w