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

App launched in the background by liveactivitiesd when a Live Activity reaches its scheduled end
What we're doing During time-limited sales, our app shows a countdown Live Activity on the Lock Screen. It's started locally when the user opens the app (no push, no pushType, no push tokens), and its end is scheduled for the sale's start/end time: let activity = try Activity<SaleAttributes>.request(attributes: attributes, contentState: .init()) await activity.end(using: .init(), dismissalPolicy: .after(saleEndDate))The sale time is the same for every user, so the Live Activity ends at the same second on every device. What we expected At saleEndDate, the system removes the Live Activity from the Lock Screen, and nothing else happens. What actually happens If the app isn't running at that moment (the user left it earlier and didn't swipe it away), the system removes the Live Activity and then launches our app in the background: 01:18:59.995 SpringBoard [BundleID: com.example.app] finished, removing from the list... 01:19:00.019 liveactivitiesd Sending request to open "com.example.app" 01:19:00.023 SpringBoard Received trusted open application request … from <… com.apple.liveactivitiesd …> 01:19:00.069 SpringBoard Bootstrapping app<com.example.app> with intent backgroundThe app receives a normal application(_:didFinishLaunchingWithOptions:) with applicationState == .background and empty launchOptions. No other app delegate callback follows. Our app can't tell this apart from any other launch, so it runs its full startup: it builds the home screen and calls our backend APIs. Because this happens on a large number of devices in the same second, our backend gets a sharp burst of traffic exactly at sale start and sale end, from users who never opened the app. What we've checked App still running in the background at the end time: no new launch. App swiped away by the user before the end time: no launch. Live Activity removed by the user before the end time: no launch at the end time. Steps to reproduce Open the app; it starts a Live Activity with its end scheduled 15 minutes ahead. Leave the app with the Home gesture (don't swipe it away) and lock the device. Wait until the system terminates the app process. At the scheduled end time, the Live Activity is removed and the app is launched in the background (log above). Environment iPhone 15, iOS 26.6 (23G71) UIKit app, UIApplicationDelegate lifecycle (no scenes) NSSupportsLiveActivities = YES; UIBackgroundModes = [processing, remote-notification] Questions Why does the system launch the app when a Live Activity reaches its scheduled end? Is this intended? Can we avoid it? Is there a supported way to end a Live Activity at a scheduled time without the system launching the app? If not, how should we handle it? Is there a way to know at launch that it was caused by the Live Activity ending, or what's the recommended way to avoid running the full startup (UI and network calls) for this launch?
1
0
101
1h
iPhone Duo side bar is empty after a full-screen modal closes, when a child UITabBarController is sized with Auto Layout
Hi, On iPhone Duo, the vertical tab bar (side bar) shows no tabs after a full-screen modal closes. This happens when the device opened while the modal showed. I filed it as FB25719774. Environment: Xcode 27.2, iPhone Duo simulator, iOS 27.2 (24B91016s). Setup: A container view controller holds a UITabBarController as a child. Auto Layout constraints pin the child view to the 4 edges of the container. override func viewDidLoad() { super.viewDidLoad() addChild(child) child.view.translatesAutoresizingMaskIntoConstraints = false view.addSubview(child.view) NSLayoutConstraint.activate([ child.view.topAnchor.constraint(equalTo: view.topAnchor), child.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), child.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), child.view.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) child.didMove(toParent: self) }Steps: Fold the device. The side bar shows 4 tabs. Present a view controller with modalPresentationStyle = .fullScreen. While the modal shows, open the device flat. Close the modal. Expected: The side bar shows the 4 tabs, as it did before the modal. Actual: The side bar is empty. The child gets the right frame one layout pass later. But the side bar stays empty, even though tabBar is not hidden and has a normal frame. Workaround: Size the child view with an autoresizing mask while the container is off the window: child.view.frame = view.bounds child.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]However, we could not use the mask all the time. On iOS 17.5, it caused a second issue: after a rotation, a compositional layout inside the child kept the old size classes (FB25719805). So we turn on the mask only while the container is off the window. Related: FB25261013 (https://developer.apple.com/forums/thread/852478) shows the same empty side bar. There, the UITabBarController is added as a child with constraints while the Duo is open. In both cases, Auto Layout has not updated the child frame yet when UIKit sets up the side bar. Link to demo project here: https://transfer.it/t/jd07S2pjxb6A
0
0
56
10h
Vertical tab bar doesn't appear when tab bar controller is added to view controller while iPhone Duo is unfolded
Hi, I would like to share an issue with UITabBarController's vertical tab bar and iPhone Duo's unfolded pose. On iPhone Duo (27.2 beta 3), when tab bar controller is added to the view controller while in unfolded pose, the vertical tab bar doesn't appear unless the tab bar controller view's frame is set manually before adding it to the parent's view. Show any VC. Use unfolded Duo pose. After some time/on button press add a UITabBarController to it: (https://developer.apple.com/documentation/uikit/creating-a-custom-container-view-controller#Add-a-child-view-controller-programmatically-to-your-content) with Auto Layout constraints. Vertical tab bar does not appear. Fold and unfold the device. The tab bar appears. Expected: Tab bar appears after adding the UITabBarController in unfolded Duo pose. Actual: Tab bar does not appear after adding the UITabBarController in unfolded Duo pose. In Feedback Assistant report (FB25261013) I attached minimal reproduction example and recordings showing the different behavior in folded and unfolded poses and behavior with manual frame application fix (commented out in minimal reproduction example). Minimal reproduction example: // SceneDelegate.swift import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } window = UIWindow(windowScene: windowScene) window?.rootViewController = ViewController() window?.makeKeyAndVisible() } } // ViewController.swift import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground let button = UIButton(configuration: .filled(), primaryAction: UIAction(title: "Show Tab Bar Controller") { [weak self] _ in self?.showTabBarController() }) button.translatesAutoresizingMaskIntoConstraints = false view.addSubview(button) NSLayoutConstraint.activate([ button.centerXAnchor.constraint(equalTo: view.centerXAnchor), button.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) } private func showTabBarController() { let tabBarController = UITabBarController() tabBarController.tabs = ["First", "Second", "Third"].map { title in UITab(title: title, image: UIImage(systemName: "circle"), identifier: title) { _ in let viewController = UIViewController() viewController.view.backgroundColor = .systemBackground return viewController } } addChild(tabBarController) // Uncomment to show the tab bar on the unfolded iPhone Duo. tabBarController.view.frame = view.bounds view.addSubview(tabBarController.view) tabBarController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ tabBarController.view.topAnchor.constraint(equalTo: view.topAnchor), tabBarController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), tabBarController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), tabBarController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), ]) tabBarController.didMove(toParent: self) } } Thank you in advance.
Topic: UI Frameworks SubTopic: UIKit Tags:
7
0
956
11h
No lifecycle notification when entering App Switcher while app remains inactive after Face ID
We use LAContext.evaluatePolicy(.deviceOwnerAuthentication) for a local app lock. On an iPhone 16 Pro running iOS 26.6.2, after authentication succeeds, UIApplication.shared.applicationState can remain .inactive for approximately 2–8 seconds although the app UI is visible. If the user enters the App Switcher during this interval, the app receives no additional willResignActive or didEnterBackground notification. Returning to the app produces only didBecomeActive. This means the app cannot distinguish between: remaining in the app while the Face ID UI finishes dismissing; and entering the App Switcher and returning during the same inactive interval. Reproduction: Run a minimal UIKit app on a physical Face ID device. Call evaluatePolicy(.deviceOwnerAuthentication). Immediately after successful authentication, enter the App Switcher before didBecomeActive. Wait three seconds and return. Is there a supported public API or lifecycle pattern that lets an app lock immediately in this situation without keeping its content covered until didBecomeActive?
2
0
79
1d
Trouble Zooming an SKView with SKCameraNode and UIScrollView
For the app I'm working on, I'm trying to leverage SpriteKit to do some render, but leverage UIKit and UIScrollView for scrolling phsyics that people expect from iOS. I've got things wired up such that the scroll view is layered on top of the SKView instance, and scrolling works as I expect. There's an SKCameraNode attached to the SpriteKit scene, and as a user scrolls the scroll view, it properly adjusts the camera node so that the content in my SpriteKit hierarchy is "scrolled" the same as the scroll view. However, when I zoom, I don't get the zooming behavior I expect. When pinching to zoom, the camera node properly adjusts its scale based off of the zoomScale of the scroll view, but it doesn't maintain the right origin for the zoom. I would expect that the zoom happens where the user is pinching, like it does with other zoomable content like a webpage in Safari, but I'm finding that the zooming causes my SpriteKit content to not match that. As best as I can tell from some other experiments with UIScrollView, the scroll view's contentOffset should properly be representing the pinch when zooming, so any calculations based off of that I would expect to zoom the content like I'm expecting. Scrolling does work correctly, no matter the zoom scale off the scroll view. I almost get the feeling that some value is being doubled or something and that's causing this, but I'm not sure where given my calculations. The gist of what I'm doing is listed below. class MapSceneView: UIView, UIScrollViewDelegate { private let scrollView: UIScrollView private let camera: SKCameraNode private func adjustCameraPosition() { let cameraPosition: CGPoint if let map { let visibleRect = CGRect( x: scrollView.contentOffset.x / scrollView.zoomScale, y: scrollView.contentOffset.y / scrollView.zoomScale, width: scrollView.visibleSize.width / scrollView.zoomScale, height: scrollView.visibleSize.height / scrollView.zoomScale ) cameraPosition = CGPoint( x: visibleRect.midX, // `map` is a value that corresponds to what my SpriteKit content is // displaying. `sizeInPixels` is intentionally in pixels, as we're // displaying image content that's always at a 1x scale. Subtracting // the height from the mid point should "flip" the coordinate system // to what's expected for SpriteKit. y: map.resolution.sizeInPixels.height - visibleRect.midY ) } else { cameraPosition = .zero } camera.setScale(1 / scrollView.zoomScale) camera.position = cameraPosition } func scrollViewDidScroll(_ scrollView: UIScrollView) { adjustCameraPosition() } }
0
0
34
1d
Shortcut run from the share sheet never returns its output to the host app
My app presents UIActivityViewController with a string and reads returnedItems in completionWithItemsHandler, so the user can transform text with an action. This works with third-party action extensions that call completeRequest(returningItems:). Shortcuts with "Show in Share Sheet" enabled appear in the same list and receive the text as input, but I never get anything back. With a shortcut that is just Receive input from Share Sheet Change Case: Change Shortcut Input to UPPERCASE Stop and Output: Updated Text the handler is called like this: activityType=com.apple.shortcuts.Run-Workflow.(null) completed=NO error=nil returnedItems=0while my own action extension doing the same thing gives: activityType=com.example.ShareSheetReturn.UppercaseControl completed=YES error=nil returnedItems=1 attachmentTypes=[public.plain-text]The shortcut does run and computes the right result. The Shortcuts logs for the run show the request being created with "output behavior: Ignore" and the run ending with no output: request: <WFWorkflowRunRequest: 0x109a63d40, runSource: action_extension, input: yes, presentationMode: Persistent, output behavior: Ignore, ...> Action <WFHandleCustomIntentAction: 0x1019d4620, identifier: is.workflow.actions.text.changecase> finished with output of 1 items and first item: <WFStringContentItem: 0x107958690>: HELLO SHORTCUTS Shortcut <WFWorkflow: 0x1019d3900, name: Change Case, actions: 2> has finished running with output: (null).Previous versions of Shortcuts did pass the result back through the share sheet, so this looks like a regression. Tested on the iOS 27.3 simulator with Xcode 27.3 beta. Is there any way for a shortcut run from the share sheet to hand its output back to the presenting app, or any configuration of the shortcut that makes this work? If not, I would like the output of "Stop and Output" to be returned as NSExtensionItems again. Filed as FB25701248 with a minimal sample project (a text view, a button and a control action extension).
0
0
70
1d
UINavigationController: pushViewController(animated: false) with hidesBottomBarWhenPushed makes the incoming view controller visibly resize from an undersized frame to full screen (iOS 27+)
Hi everyone, I believe I've found a behavior change (or regression) in iOS 27 around UINavigationController when pushing with animated: false to a view controller that sets hidesBottomBarWhenPushed = true. Observed behavior On iOS 27, the incoming view controller appears on screen at a size that still accounts for the tab bar, then expands to the full screen height on the next frame. Since there's no transition animation to mask it, the user sees the whole screen — including its background color — visibly "grow" into place. On iOS 18 and earlier the same code showed the destination view controller instantly at its final size, with no visible resize. That's why this only surfaced after upgrading the device to iOS 27. Minimal reproduction The destination view controller contains no subviews, no xib, no constraints and no layout code — only a background color. So this is unrelated to the content of the pushed screen. UITabBarController subclass with two tabs, each wrapped in a UINavigationController: final class MainTabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() tabBar.tintColor = .systemOrange viewControllers = [ makeNavigationController(root: ViewController(), title: "Home", image: UIImage(systemName: "house")), makeNavigationController(root: PlaceholderViewController(), title: "MENU", image: UIImage(systemName: "safari")), ] } private func makeNavigationController(root: UIViewController, title: String, image: UIImage?) -> UINavigationController { let nav = UINavigationController(rootViewController: root) let appearance = UINavigationBarAppearance() appearance.configureWithOpaqueBackground() appearance.backgroundColor = .white appearance.shadowColor = .clear nav.navigationBar.standardAppearance = appearance nav.navigationBar.scrollEdgeAppearance = appearance nav.tabBarItem = UITabBarItem(title: title, image: image, selectedImage: image) return nav } }ViewController (tab 1 root) — the trigger: class ViewController: UIViewController { private let pushButton: UIButton = { var config = UIButton.Configuration.filled() config.title = "Push" config.baseBackgroundColor = .systemOrange let button = UIButton(configuration: config) button.translatesAutoresizingMaskIntoConstraints = false return button }() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground title = "Home" view.addSubview(pushButton) pushButton.addTarget(self, action: #selector(didTapPushButton), for: .touchUpInside) NSLayoutConstraint.activate([ pushButton.centerXAnchor.constraint(equalTo: view.centerXAnchor), pushButton.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) } @objc private func didTapPushButton() { let vc = OrangeViewController() vc.hidesBottomBarWhenPushed = true // (1) navigationController?.pushViewController(vc, animated: false) // (2) } }OrangeViewController — the destination: final class OrangeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .orange } }Steps to reproduce Run on an iOS 27 device or simulator. On the first tab, tap the "Push" button. The orange screen first appears with a height that excludes the tab bar, then expands to full screen on the next frame. What I've already ruled out Both conditions must be present: hidesBottomBarWhenPushedanimatedResulttruefalse❌ Visible resizetruetrue✅ Normal slide-in transitionfalsefalse✅ No visible resizeAdditional findings: The destination view controller has no subviews or constraints, so this isn't a layout problem in my own hierarchy. I also verified that the same resize occurs with a completely empty UIViewController created purely in code — the destination has no storyboard, nib, or constraints at all. Reproduces with a plain UITabBarController + UINavigationController setup — no custom transitions, no UINavigationControllerDelegate, no appearance customization beyond a plain opaque white nav bar. Reproduces on a fresh project created from Xcode's default template. Environment iOS 27.0 (24A434) — device and simulator Xcode 27.0 (27A266a) Fresh project, default template Questions Is pushViewController(animated: false) onto a view controller with hidesBottomBarWhenPushed = true still a supported combination on iOS 27? The behavior change makes me wonder whether this is intended (requiring a workaround on my side) or a regression. If it's a regression, what's the recommended way to perform an animation-less push into a tab-bar-hiding view controller without the intermediate undersized frame? I've tried loadViewIfNeeded() plus manually assigning view.frame before pushing, but I'd rather not depend on private layout timing. I noticed the new UIView.AnimationOptions.flushUpdates (iOS 26+) documentation about flushing pending layout when animation scopes change. Is this behavior change related? Should view controllers pushed without animation be using flushUpdates? Happy to attach the sample project and a screen recording — just let me know the preferred way to submit them. Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
391
1d
iOS 27b3 SDK: iOS App on Mac crashes on UISearchBar focus
Our app crashes when compiled with the iOS 27 beta 3 SDK and run as an iOS app on Mac, on both macOS 26 and macOS 27, as soon as a UISearchBar receives focus. The crash is due to this exception: *** Assertion failure in BOOL _screenBasedFocusUnsupported(void)(), UIScreen.m:3.725 Accessing the focus system through UIScreen is no longer supported. ( 0 CoreFoundation 0x000000018bea31c0 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018b91e91c objc_exception_throw + 88 2 Foundation 0x000000018e092644 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0 3 UIKitCore 0x00000001c5dae8ec _screenBasedFocusUnsupported + 272 4 UIKitCore 0x00000001c5dae960 -[UIScreen _preferredFocusedWindow] + 24 5 UIKitCore 0x00000001c4ea3a60 -[UIScreen _mainSceneReferenceBounds] + 200 6 UIKitCore 0x00000001c4ea3914 -[UIScreen _mainSceneBoundsForInterfaceOrientation:] + 40 7 UIKitCore 0x00000001c5708134 +[UINavigationBar defaultSizeForOrientation:] + 76 8 UIKitCore 0x00000001c6222c88 -[_UISearchPresentationController _layoutPresentationWithSize:transitionCoordinator:] + 704 9 UIKitCore 0x00000001c622296c -[_UISearchPresentationController containerViewWillLayoutSubviews] + 84 10 UIKitCore 0x00000001c549304c block_destroy_helper.13 + 25112 11 UIKitCore 0x00000001c549344c block_destroy_helper.13 + 26136 12 UIKitCore 0x00000001c4ea26a8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1648 13 QuartzCore 0x0000000196103dbc _ZN2CA5Layer15perform_update_EPS0_P7CALayerjNS_17LayerUpdateReasonEPNS_11TransactionE + 460 14 QuartzCore 0x000000019610390c _ZN2CA5Layer17update_if_needed_EPNS_11TransactionENS_17LayerUpdateReasonE + 692 15 QuartzCore 0x0000000196035d2c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 608 16 QuartzCore 0x0000000195e69520 _ZN2CA11Transaction6commitEv + 652 17 AppKit 0x0000000190fe116c __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.7 + 44 18 CoreFoundation 0x000000018be34ad0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 19 CoreFoundation 0x000000018be34a10 __CFRunLoopDoBlocks + 396 20 CoreFoundation 0x000000018be33e54 __CFRunLoopRun + 2356 21 CoreFoundation 0x000000018bf06234 _CFRunLoopRunSpecificWithOptions + 532 22 HIToolbox 0x0000000198c1f560 RunCurrentEventLoopInMode + 320 23 HIToolbox 0x0000000198c228bc ReceiveNextEventCommon + 488 24 HIToolbox 0x0000000198dac14c _BlockUntilNextEventMatchingListInMode + 48 25 AppKit 0x00000001909163d0 _DPSBlockUntilNextEventMatchingListInMode + 228 26 AppKit 0x000000019026a084 _DPSNextEvent + 576 27 AppKit 0x0000000190dff96c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 28 AppKit 0x0000000190dff678 -[NSApplication(NSEventRouting) nextEventMatchingMask:untilDate:inMode:dequeue:] + 72 29 AppKit 0x000000019025d13c -[NSApplication run] + 368 30 AppKit 0x00000001902357b0 NSApplicationMain + 880 31 AppKit 0x000000019047c958 +[NSWindow _savedFrameFromString:] + 0 32 UIKitMacHelper 0x00000001aa2651bc UINSApplicationMain + 972 33 UIKitCore 0x00000001c4e1aed4 UIApplicationMain + 144 34 UIKitCore 0x00000001c548bda0 block_destroy_helper.31 + 8880 35 DigitalConcertHall.debug.dylib 0x0000000106e41bd8 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 128 36 DigitalConcertHall.debug.dylib 0x0000000106e41b4c $s18DigitalConcertHall11AppDelegateC5$mainyyFZ + 32 37 DigitalConcertHall.debug.dylib 0x0000000106e4afc0 __debug_main_executable_dylib_entry_point + 28 38 dyld 0x000000018b9ac4e4 start + 6992 ) I could not test with the iOS 27 beta 4 SDK due to this blocking issue: https://developer.apple.com/forums/thread/839012 However, when I tried to set up a simple sample project, I could not reproduce the issue. Does anybody know what might be causing this? I filed feedback FB24201508
9
2
2.3k
1d
make search bar appear as bottom toolbar button on iPad? (UIKit)
In UIKit, I really like the layout convention on iPhone where the search bar appears as a button in the toolbar at the bottom of the screen, and the user can tap it to see the actual search bar, also at the bottom. viewController.navigationItem.searchBarPlacementAllowsToolbarIntegration = true viewController.navigationItem.preferredSearchBarPlacement = .integratedButton let spacer = UIBarButtonItem.flexibleSpace() let searchbarPlacer = viewController.navigationItem.searchBarPlacementBarButtonItem viewController.toolbarItems = [spacer, searchbarPlacer]However, on iPad I'm having trouble getting the same effect; the search button wants to appear at the top, in the navigation bar, even though I'm specifically asking it to appear at the bottom, in the toolbar. How do I get the same layout on iPad?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
48
2d
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.
4
2
459
4d
Public API for the iPhone Duo inner-display glow in tent mode
Feature request: Public API for the iPhone Duo inner-display glow in tent mode I’d like a public API for the colored glow that the StandBy alarm casts onto the table in tent mode. It’s a subtle detail that would work well in other apps. The outer display could keep showing the app while the inner glow picks up a color from album artwork or shifts as a timer counts down. The private UIKitCore methods +[_UISceneCompanion _alarmGlowContent] and +[_UISceneCompanion _highlightCompanionWithColor:] point to the effect I mean. SpringBoard also defines SBCompanionScenePresentationModeInnerDisplayStandbyAlarmGlow. In SwiftUI, I could imagine using it like this: .sceneAccessory { InnerDisplayGlowAccessory(color: glowColor) }An optional intensity parameter would be nice, too. That would let apps keep the glow faint during playback or brighten it briefly when something changes, within brightness limits set by iOS.
0
0
117
4d
Mac Catalyst: disabled SwiftUI toolbar buttons turn into pills and don’t update their state
Hi everyone, we’ve been fighting with disabled toolbar buttons in our Mac Catalyst app and wanted to check whether others are seeing the same thing, or whether we’re missing something. Our toolbar lives in a SwiftUI NavigationStack, so Catalyst bridges it into the window’s NSToolbar. Enabled buttons look and work great: native buttons with a round 36 × 36 pt glass. But as soon as a button uses .disabled(_:), things fall apart: It turns into a wider pill. A button that is disabled when it appears becomes an image item instead of a button (NSToolbarImageView with a UIImage), and its glass grows to 47 × 36 pt. Its state doesn’t update. Toggling .disabled(_:) doesn’t reach the existing toolbar item. It only changes if we give the ToolbarItem a new id, which then brings back the pill. Disabling the NSToolbarItem ourselves doesn’t stick. UIKit revalidates the toolbar whenever any item changes, and copies the bar button’s enabled state back over ours. Drawing our own image to fix the shape crashed AppKit (“Unable to install constraint on view”) as soon as the item switched back to enabled. For now we keep the SwiftUI button enabled on the Mac and disable the native NSToolbarItem ourselves. We find the toolbar via NSToolbar.willAddItemNotification and use KVO to put the state back whenever UIKit overrides it. It works, but it feels like it shouldn’t be necessary. Here’s a minimal example: struct ContentView: View { @State private var canUndo = false var body: some View { NavigationStack { Button("Toggle") { canUndo.toggle() } .toolbar { ToolbarItem(placement: .topBarLeading) { Button("Undo", systemImage: "arrow.uturn.backward") {} .labelStyle(.iconOnly) .disabled(!canUndo) } } } } }Seen on macOS 27.2 and 26.7.1, Xcode 27.2. Filed as FB25597608. Is there a supported way to get a disabled toolbar button that stays a normal native button? Any hints are very welcome. Thanks!
0
0
72
5d
Can an iOS Custom Keyboard Legally Launch Its Containing App for a User-Initiated Speech Recording?
I’m developing an iOS application with a custom keyboard extension and a companion app. Our intended user experience: The user is typing in an app such as WhatsApp using our custom keyboard. They tap the Speech button. Our companion app opens automatically. The companion app establishes a microphone session. iOS returns the user to the original host app. The user continues dictating through the keyboard. What we have already implemented: A Swift-based custom keyboard and companion app. App Groups and Darwin notifications for communication between the two targets. Microphone recording through the companion app. Apple Speech Recognition with on-device recognition. A warm background audio session. Subsequent recordings and text insertion work on a physical iPhone once the warm session is established. Our current blocker: The keyboard extension cannot successfully open its companion app when the warm session is inactive. We previously tried NSExtensionContext.open(), but it did not work. We want to avoid private APIs, responder-chain workarounds, and anything that could violate App Store Review Guidelines. My questions: Does Apple provide any officially supported public API that allows a custom keyboard extension to launch its containing app in response to an explicit user tap? Can App Intents or ForegroundContinuableIntent legitimately achieve this from a keyboard extension? Does App Review Guideline 4.4.1 prohibit this particular user-initiated handoff? If direct launching is prohibited, what Apple-supported architecture or interaction pattern would you recommend for this use case? Is there a supported way for the companion app to return the user to the original host app after establishing the microphone session? We are looking for guidance based on actual iOS platform restrictions and supported APIs, preferably from developers who have shipped custom keyboard applications. Thank you.
1
0
63
5d
State Restoration no longer works in a Mac Catalyst based app when run on macOS 27.x
As reported in FB25363417: A UIKit based app running on macOS 27.2 (or macOS 27.0.1) via Mac Catalyst no longer has functioning state restoration. Upon app restart, there is no NSUserActivity being provided to the scene in the UISceneDelegate method scene(_:willConnectTo:options:). This can be tested with Apple’s own sample app “Restoring your app’s state”. Just update the sample project with support for a Mac Catalyst build. Using Xcode 27.2 on a Mac with macOS 27.0 or 27.2, build and run the Mac Catalyst version of the app. The main screen appears with a list of products. Select any product so you see details of the product. Quit the app. Run the app again. Note that you are not returned to the previously selected product detail screen. Instead, you just see the main list of products. If you run the same app and perform the same steps on a Mac running macOS 26.x, then when the app is restarted, you correctly get returned to the previously selected product detail screen. The problem is being caused by no NSUserActivity being passed into the scene delegate on app startup. While running the app on a Mac with macOS 27.x, put a breakpoint on the initial guard statement in scene(_:willConnectTo:options:) and you will see there is no activity on app restart. This is impacting paid customers of my existing app since upgrading to macOS 27. They no longer get returned to the app’s previous state when restarting the app. It is expected that state restoration should work on macOS 27 just as well as it does under macOS 26 in an app built with Mac Catalyst.
1
0
181
6d
iPhone Duo vertical bar: system back button ignores custom back indicator image (UINavigationBarAppearance.setBackIndicatorImage)
On iPhone Duo (iOS 27.1), when UIKit moves a navigation controller's system back button into the vertical bar, the button always shows the system chevron. Every public API for customizing the back indicator image is ignored there, although the same configuration is honored in the horizontal (top) navigation bar. APIs tested (each one alone, on the second view controller of a UINavigationController stack, with no leftBarButtonItem): A. Nothing set (default). B. UINavigationBar.standardAppearance set to a UINavigationBarAppearance on which setBackIndicatorImage(_:transitionMaskImage:) was called. C. Same appearance assigned to all four UINavigationBar properties: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. D. Same appearance assigned to all four UINavigationItem properties of the pushed view controller: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. E. Legacy UINavigationBar.backIndicatorImage and UINavigationBar.backIndicatorTransitionMaskImage, with no appearance objects set. F. UINavigationBar.appearance() proxy: all four appearance properties, set before the navigation controller is created. G. UINavigationItem.backBarButtonItem of the previous view controller set to UIBarButtonItem(image:style:target:action:). H. Control: UINavigationItem.leftBarButtonItem set to UIBarButtonItem(image:style:target:action:) with the same image (axisBehavior left at .automatic). The marker image is UIImage(systemName: "arrow.uturn.backward"), so it cannot be mistaken for the system chevron. Results: Top navigation bar (iPhone 17 Pro iOS 27.0, and iPhone Duo open with portrait UI): B, C, D, E and F show the custom image. G shows the chevron followed by the image. Vertical bar (iPhone Duo closed; iPhone Duo open with landscape UI; also inside a UITabBarController with the tab bar hidden or visible): A through G all show the system chevron. Only H shows the custom image. At viewDidAppear, the app confirms that the configuration is in place: navigationBar.standardAppearance.backIndicatorImage is the marker image (B, C), navigationItem.standardAppearance is non-nil (D), and traitCollection.verticalBarEdge is .trailing. This contradicts the guidance given by an Apple Technology Evangelist in https://developer.apple.com/forums/thread/847875: "If you are only replacing the icon on the back button, you could use set the backIndicatorImage and maintain default system behavior. This would be the recommended approach." As things stand, the only way to show a custom back icon in the vertical bar is to replace the system back button with a leading item. That loses the system behavior that comes with it: UINavigationController.interactivePopGestureRecognizer, interactiveContentPopGestureRecognizer and the back-history menu.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
3
563
6d
UITableView row reordering no longer works under macOS 27 with Mac Catalyst
Under macOS 27 using Mac Catalyst for a UIKit-based app, If you present a view controller with a table view as a form sheet or page sheet, row reordering fails to function. You can drag a row as expected but the blue movement bar never appears and if you drop the row it simply returns to its original location. The exact same view controller presented as a popover works just fine. The exact same view controller not presented as a modal (such as the app's root controller) works just fine. This is a serious bug affecting existing applications and being reported by paying customers. This has been reported as FB25038883 which includes a simple sample app demonstrating the issue.
4
1
593
6d
iPhone Duo Unfolded Safe Areas
Hi, my app is currently built on Xcode 27.1 I am working on upgrading to Xcode 27.2 We have a regression issue whereby, the top safeArea is 82 despite the vertical bar being opted in and active. This only happens on unfolded landscape. Our right safeArea is 0 for the window and is 84 for the view safeArea. Both window and view safeAreas have the top safe area of 82 though. We would like to know what could be the cause behind the top safeArea being activated. Note: this is not an issue for iOS 27.1
2
0
220
6d
SwiftUI Architecture Guide
Application Types Applications are divided into Document-based and Library-based. A document-based application stores user data in individual, standalone files. Users manually name and organize those files in a local system or synced cloud storage such as iCloud. The software typically opens multiple windows for different projects. This framing is for standalone, complex files that need to be shared, exported, or handled independently. A library-based application manages data in one unified, central repository, locally or through remote cloud databases. Spotify, Netflix, and Notion are the examples shown. The file system is hidden; updates are saved automatically in real time; and a single window supports browsing, search, and access to the synchronized data collection from any device. Model Types Four model types: Data, Domain, Application, and Presentation. Apple Platforms In Apple MVC (AppKit / UIKit), the model branches to Data, Domain, and Presentation. In SwiftUI, Model branches to Data and Domain. Project Structure SwiftUI App Folders Swift Package Folders App Modularization Not every module in a large application needs to be extracted into a separate framework or Swift Package. Logical modularization can also be achieved through a well-organized folder structure within the main project. Introduce separate packages or frameworks only when there is a clear benefit, such as independent reuse, distribution, build isolation or ownership. Avoid unnecessary project and dependency management overhead. State Management & Data Flow Source of truth is “a key concept in SwiftUI”: a single place to store a piece of data, with everywhere else reading the same piece of data. Environment is SwiftUI’s native dependency-injection mechanism. It allows shared dependencies, domain models, and services to be injected at the appropriate view-hierarchy level and accessed where needed without explicit parameter passing or unnecessary coupling. It is described as a tool for managing dependencies and sharing state across the view hierarchy. Domain Model Ownership Domain Models should be owned by the highest relevant SwiftUI view in the hierarchy that defines their context and lifecycle. NavigationStack owns the Domain Models for its navigation context and makes them available to descendant views through @Environment. When a NavigationStack is embedded in a TabView or NavigationSplitView, ownership moves up to the TabView or NavigationSplitView so the models can be shared across tabs or split views. The stated result is clear ownership scope, sharing where needed, and isolation between independent navigation contexts. Previews & UI Testing Environment injection makes SwiftUI Previews and UI Tests easier to configure by allowing real Domain Models to be replaced with mock or dummy instances. Views can be tested independently with controlled data and predictable states, without requiring real services, network requests, or application setup. Domain and Data Model Examples For a library-based app with remote data. Additional Domain Model Examples E-commerce Catalog, ShoppingCart, OrderHistory, Wishlist Banking MyAccounts, MyCards, MyTransactions, MyInvestments Social Network Feed, Conversations, Notifications, Friends Healthcare MyAppointments, MedicalHistory, Prescriptions, MyHealth Education Courses, MyCourses, Assignments, MyGrades, LearningProgress Real Estate PropertyCatalog, MyProperties, Favorites, Appointments Hotel Booking Destinations, Search, MyBookings, TravelHistory Food Delivery RestaurantCatalog, ShoppingCart, MyOrders, DeliveryTracking Project Management Projects, MyTasks, TeamMembers, Notifications Insurance MyPolicies, MyClaims, Coverage, Documents Smart Home MyHomes, Devices, Automations, EnergyUsage Fitness MyPlans, MyProgress, MyGoals, WorkoutHistory Other Search, Dashboard, Favorites, Notifications, Settings, ActivityHistory, Recommendations, Subscription, DocumentLibrary ViewModel? - MVVM In SwiftUI, the View encapsulates the UI content (body), its state (properties), and its actions or tasks (functions). This is possible because SwiftUI is designed around a declarative, state-driven UI model. In Android and .NET platforms, a separate ViewModel is typically required to hold and manage the View's state. Projects that intoduce ViewModels in SwiftUI add unnecessary architectural complexity, boilerplate, and code duplication; synchronization issues; unclear state ownership; additional lifecycle management; more abstractions; harder debugging; and increased maintenance, without meaningful benefits over SwiftUI's native state management. In UIKit, introducing a separate ViewModel layer is often unnecessary, as UIViewController already serves as the presentation model, handling presentation logic and coordinating the view. Non-UI responsibilities can be delegated to dedicated ModelControllers or Managers, avoiding unnecessary layers and abstractions. Domain Models vs. ViewModels Domain Models are view-independent, while ViewModels are view-dependent. A ViewModel is tightly coupled to the structure, state, and lifecycle of a specific View. Whenever the View code changes, its ViewModel often requires corresponding coding changes, and vice versa, creating additional maintenance and synchronization overhead. Domain Models, on the other hand, represent application context and business functionality independently of the UI. This separation preserves UI independence and allows the same Domain Models to be shared across different screens and platforms, such as iPhone, iPhone Duo, iPad, and macOS, without duplicating or adapting business logic for each View. This makes Domain Models a more scalable and maintainable approach for modern SwiftUI applications, particularly those targeting multiple screen sizes and platforms.
1
0
292
6d
A bug in iOS 27.3 beta 2 where the UIHingeInteraction value is received even though it is not an iPhone Duo device.
The device currently showing the symptom is iPhone SE3, iOS 27.3 Beta 2 version installed. (Same symptom exists in Beta 1 as well.) On screen A When switching to another ViewController (screen B) with pushViewController of UINavigationController Declare UIHingeInteraction on screen A and self.view.addInteraction(hInteraction) I added it like the code above. Hinge value comes in. In the sample code below update.hinge value is not nil The update.hinge!.angle value is also displayed as 0. let hInteraction:UIHingeInteraction = UIHingeInteraction { interaction, update in if update.hinge != nil { let hingeAngle:CGFloat = update.hinge!.angle..... }} In apps installed on other iPhone 17 devices (with iOS 27.2 installed), the value does not appear there. A quick fix is ​​needed. I have also submitted a report via Apple Feedback; please ensure this is addressed in the upcoming Beta 3 release. *** Plus *** The horizontalSizeClass and verticalSizeClass properties are returning "Regular" values, similar to how they behave on the iPhone Duo's internal display. Please fix the above issue as well.
0
1
151
1w
App launched in the background by liveactivitiesd when a Live Activity reaches its scheduled end
What we're doing During time-limited sales, our app shows a countdown Live Activity on the Lock Screen. It's started locally when the user opens the app (no push, no pushType, no push tokens), and its end is scheduled for the sale's start/end time: let activity = try Activity<SaleAttributes>.request(attributes: attributes, contentState: .init()) await activity.end(using: .init(), dismissalPolicy: .after(saleEndDate))The sale time is the same for every user, so the Live Activity ends at the same second on every device. What we expected At saleEndDate, the system removes the Live Activity from the Lock Screen, and nothing else happens. What actually happens If the app isn't running at that moment (the user left it earlier and didn't swipe it away), the system removes the Live Activity and then launches our app in the background: 01:18:59.995 SpringBoard [BundleID: com.example.app] finished, removing from the list... 01:19:00.019 liveactivitiesd Sending request to open "com.example.app" 01:19:00.023 SpringBoard Received trusted open application request … from <… com.apple.liveactivitiesd …> 01:19:00.069 SpringBoard Bootstrapping app<com.example.app> with intent backgroundThe app receives a normal application(_:didFinishLaunchingWithOptions:) with applicationState == .background and empty launchOptions. No other app delegate callback follows. Our app can't tell this apart from any other launch, so it runs its full startup: it builds the home screen and calls our backend APIs. Because this happens on a large number of devices in the same second, our backend gets a sharp burst of traffic exactly at sale start and sale end, from users who never opened the app. What we've checked App still running in the background at the end time: no new launch. App swiped away by the user before the end time: no launch. Live Activity removed by the user before the end time: no launch at the end time. Steps to reproduce Open the app; it starts a Live Activity with its end scheduled 15 minutes ahead. Leave the app with the Home gesture (don't swipe it away) and lock the device. Wait until the system terminates the app process. At the scheduled end time, the Live Activity is removed and the app is launched in the background (log above). Environment iPhone 15, iOS 26.6 (23G71) UIKit app, UIApplicationDelegate lifecycle (no scenes) NSSupportsLiveActivities = YES; UIBackgroundModes = [processing, remote-notification] Questions Why does the system launch the app when a Live Activity reaches its scheduled end? Is this intended? Can we avoid it? Is there a supported way to end a Live Activity at a scheduled time without the system launching the app? If not, how should we handle it? Is there a way to know at launch that it was caused by the Live Activity ending, or what's the recommended way to avoid running the full startup (UI and network calls) for this launch?
Replies
1
Boosts
0
Views
101
Activity
1h
iPhone Duo side bar is empty after a full-screen modal closes, when a child UITabBarController is sized with Auto Layout
Hi, On iPhone Duo, the vertical tab bar (side bar) shows no tabs after a full-screen modal closes. This happens when the device opened while the modal showed. I filed it as FB25719774. Environment: Xcode 27.2, iPhone Duo simulator, iOS 27.2 (24B91016s). Setup: A container view controller holds a UITabBarController as a child. Auto Layout constraints pin the child view to the 4 edges of the container. override func viewDidLoad() { super.viewDidLoad() addChild(child) child.view.translatesAutoresizingMaskIntoConstraints = false view.addSubview(child.view) NSLayoutConstraint.activate([ child.view.topAnchor.constraint(equalTo: view.topAnchor), child.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), child.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), child.view.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) child.didMove(toParent: self) }Steps: Fold the device. The side bar shows 4 tabs. Present a view controller with modalPresentationStyle = .fullScreen. While the modal shows, open the device flat. Close the modal. Expected: The side bar shows the 4 tabs, as it did before the modal. Actual: The side bar is empty. The child gets the right frame one layout pass later. But the side bar stays empty, even though tabBar is not hidden and has a normal frame. Workaround: Size the child view with an autoresizing mask while the container is off the window: child.view.frame = view.bounds child.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]However, we could not use the mask all the time. On iOS 17.5, it caused a second issue: after a rotation, a compositional layout inside the child kept the old size classes (FB25719805). So we turn on the mask only while the container is off the window. Related: FB25261013 (https://developer.apple.com/forums/thread/852478) shows the same empty side bar. There, the UITabBarController is added as a child with constraints while the Duo is open. In both cases, Auto Layout has not updated the child frame yet when UIKit sets up the side bar. Link to demo project here: https://transfer.it/t/jd07S2pjxb6A
Replies
0
Boosts
0
Views
56
Activity
10h
Vertical tab bar doesn't appear when tab bar controller is added to view controller while iPhone Duo is unfolded
Hi, I would like to share an issue with UITabBarController's vertical tab bar and iPhone Duo's unfolded pose. On iPhone Duo (27.2 beta 3), when tab bar controller is added to the view controller while in unfolded pose, the vertical tab bar doesn't appear unless the tab bar controller view's frame is set manually before adding it to the parent's view. Show any VC. Use unfolded Duo pose. After some time/on button press add a UITabBarController to it: (https://developer.apple.com/documentation/uikit/creating-a-custom-container-view-controller#Add-a-child-view-controller-programmatically-to-your-content) with Auto Layout constraints. Vertical tab bar does not appear. Fold and unfold the device. The tab bar appears. Expected: Tab bar appears after adding the UITabBarController in unfolded Duo pose. Actual: Tab bar does not appear after adding the UITabBarController in unfolded Duo pose. In Feedback Assistant report (FB25261013) I attached minimal reproduction example and recordings showing the different behavior in folded and unfolded poses and behavior with manual frame application fix (commented out in minimal reproduction example). Minimal reproduction example: // SceneDelegate.swift import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } window = UIWindow(windowScene: windowScene) window?.rootViewController = ViewController() window?.makeKeyAndVisible() } } // ViewController.swift import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground let button = UIButton(configuration: .filled(), primaryAction: UIAction(title: "Show Tab Bar Controller") { [weak self] _ in self?.showTabBarController() }) button.translatesAutoresizingMaskIntoConstraints = false view.addSubview(button) NSLayoutConstraint.activate([ button.centerXAnchor.constraint(equalTo: view.centerXAnchor), button.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) } private func showTabBarController() { let tabBarController = UITabBarController() tabBarController.tabs = ["First", "Second", "Third"].map { title in UITab(title: title, image: UIImage(systemName: "circle"), identifier: title) { _ in let viewController = UIViewController() viewController.view.backgroundColor = .systemBackground return viewController } } addChild(tabBarController) // Uncomment to show the tab bar on the unfolded iPhone Duo. tabBarController.view.frame = view.bounds view.addSubview(tabBarController.view) tabBarController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ tabBarController.view.topAnchor.constraint(equalTo: view.topAnchor), tabBarController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), tabBarController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), tabBarController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), ]) tabBarController.didMove(toParent: self) } } Thank you in advance.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
7
Boosts
0
Views
956
Activity
11h
No lifecycle notification when entering App Switcher while app remains inactive after Face ID
We use LAContext.evaluatePolicy(.deviceOwnerAuthentication) for a local app lock. On an iPhone 16 Pro running iOS 26.6.2, after authentication succeeds, UIApplication.shared.applicationState can remain .inactive for approximately 2–8 seconds although the app UI is visible. If the user enters the App Switcher during this interval, the app receives no additional willResignActive or didEnterBackground notification. Returning to the app produces only didBecomeActive. This means the app cannot distinguish between: remaining in the app while the Face ID UI finishes dismissing; and entering the App Switcher and returning during the same inactive interval. Reproduction: Run a minimal UIKit app on a physical Face ID device. Call evaluatePolicy(.deviceOwnerAuthentication). Immediately after successful authentication, enter the App Switcher before didBecomeActive. Wait three seconds and return. Is there a supported public API or lifecycle pattern that lets an app lock immediately in this situation without keeping its content covered until didBecomeActive?
Replies
2
Boosts
0
Views
79
Activity
1d
Trouble Zooming an SKView with SKCameraNode and UIScrollView
For the app I'm working on, I'm trying to leverage SpriteKit to do some render, but leverage UIKit and UIScrollView for scrolling phsyics that people expect from iOS. I've got things wired up such that the scroll view is layered on top of the SKView instance, and scrolling works as I expect. There's an SKCameraNode attached to the SpriteKit scene, and as a user scrolls the scroll view, it properly adjusts the camera node so that the content in my SpriteKit hierarchy is "scrolled" the same as the scroll view. However, when I zoom, I don't get the zooming behavior I expect. When pinching to zoom, the camera node properly adjusts its scale based off of the zoomScale of the scroll view, but it doesn't maintain the right origin for the zoom. I would expect that the zoom happens where the user is pinching, like it does with other zoomable content like a webpage in Safari, but I'm finding that the zooming causes my SpriteKit content to not match that. As best as I can tell from some other experiments with UIScrollView, the scroll view's contentOffset should properly be representing the pinch when zooming, so any calculations based off of that I would expect to zoom the content like I'm expecting. Scrolling does work correctly, no matter the zoom scale off the scroll view. I almost get the feeling that some value is being doubled or something and that's causing this, but I'm not sure where given my calculations. The gist of what I'm doing is listed below. class MapSceneView: UIView, UIScrollViewDelegate { private let scrollView: UIScrollView private let camera: SKCameraNode private func adjustCameraPosition() { let cameraPosition: CGPoint if let map { let visibleRect = CGRect( x: scrollView.contentOffset.x / scrollView.zoomScale, y: scrollView.contentOffset.y / scrollView.zoomScale, width: scrollView.visibleSize.width / scrollView.zoomScale, height: scrollView.visibleSize.height / scrollView.zoomScale ) cameraPosition = CGPoint( x: visibleRect.midX, // `map` is a value that corresponds to what my SpriteKit content is // displaying. `sizeInPixels` is intentionally in pixels, as we're // displaying image content that's always at a 1x scale. Subtracting // the height from the mid point should "flip" the coordinate system // to what's expected for SpriteKit. y: map.resolution.sizeInPixels.height - visibleRect.midY ) } else { cameraPosition = .zero } camera.setScale(1 / scrollView.zoomScale) camera.position = cameraPosition } func scrollViewDidScroll(_ scrollView: UIScrollView) { adjustCameraPosition() } }
Replies
0
Boosts
0
Views
34
Activity
1d
Shortcut run from the share sheet never returns its output to the host app
My app presents UIActivityViewController with a string and reads returnedItems in completionWithItemsHandler, so the user can transform text with an action. This works with third-party action extensions that call completeRequest(returningItems:). Shortcuts with "Show in Share Sheet" enabled appear in the same list and receive the text as input, but I never get anything back. With a shortcut that is just Receive input from Share Sheet Change Case: Change Shortcut Input to UPPERCASE Stop and Output: Updated Text the handler is called like this: activityType=com.apple.shortcuts.Run-Workflow.(null) completed=NO error=nil returnedItems=0while my own action extension doing the same thing gives: activityType=com.example.ShareSheetReturn.UppercaseControl completed=YES error=nil returnedItems=1 attachmentTypes=[public.plain-text]The shortcut does run and computes the right result. The Shortcuts logs for the run show the request being created with "output behavior: Ignore" and the run ending with no output: request: <WFWorkflowRunRequest: 0x109a63d40, runSource: action_extension, input: yes, presentationMode: Persistent, output behavior: Ignore, ...> Action <WFHandleCustomIntentAction: 0x1019d4620, identifier: is.workflow.actions.text.changecase> finished with output of 1 items and first item: <WFStringContentItem: 0x107958690>: HELLO SHORTCUTS Shortcut <WFWorkflow: 0x1019d3900, name: Change Case, actions: 2> has finished running with output: (null).Previous versions of Shortcuts did pass the result back through the share sheet, so this looks like a regression. Tested on the iOS 27.3 simulator with Xcode 27.3 beta. Is there any way for a shortcut run from the share sheet to hand its output back to the presenting app, or any configuration of the shortcut that makes this work? If not, I would like the output of "Stop and Output" to be returned as NSExtensionItems again. Filed as FB25701248 with a minimal sample project (a text view, a button and a control action extension).
Replies
0
Boosts
0
Views
70
Activity
1d
UINavigationController: pushViewController(animated: false) with hidesBottomBarWhenPushed makes the incoming view controller visibly resize from an undersized frame to full screen (iOS 27+)
Hi everyone, I believe I've found a behavior change (or regression) in iOS 27 around UINavigationController when pushing with animated: false to a view controller that sets hidesBottomBarWhenPushed = true. Observed behavior On iOS 27, the incoming view controller appears on screen at a size that still accounts for the tab bar, then expands to the full screen height on the next frame. Since there's no transition animation to mask it, the user sees the whole screen — including its background color — visibly "grow" into place. On iOS 18 and earlier the same code showed the destination view controller instantly at its final size, with no visible resize. That's why this only surfaced after upgrading the device to iOS 27. Minimal reproduction The destination view controller contains no subviews, no xib, no constraints and no layout code — only a background color. So this is unrelated to the content of the pushed screen. UITabBarController subclass with two tabs, each wrapped in a UINavigationController: final class MainTabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() tabBar.tintColor = .systemOrange viewControllers = [ makeNavigationController(root: ViewController(), title: "Home", image: UIImage(systemName: "house")), makeNavigationController(root: PlaceholderViewController(), title: "MENU", image: UIImage(systemName: "safari")), ] } private func makeNavigationController(root: UIViewController, title: String, image: UIImage?) -> UINavigationController { let nav = UINavigationController(rootViewController: root) let appearance = UINavigationBarAppearance() appearance.configureWithOpaqueBackground() appearance.backgroundColor = .white appearance.shadowColor = .clear nav.navigationBar.standardAppearance = appearance nav.navigationBar.scrollEdgeAppearance = appearance nav.tabBarItem = UITabBarItem(title: title, image: image, selectedImage: image) return nav } }ViewController (tab 1 root) — the trigger: class ViewController: UIViewController { private let pushButton: UIButton = { var config = UIButton.Configuration.filled() config.title = "Push" config.baseBackgroundColor = .systemOrange let button = UIButton(configuration: config) button.translatesAutoresizingMaskIntoConstraints = false return button }() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground title = "Home" view.addSubview(pushButton) pushButton.addTarget(self, action: #selector(didTapPushButton), for: .touchUpInside) NSLayoutConstraint.activate([ pushButton.centerXAnchor.constraint(equalTo: view.centerXAnchor), pushButton.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) } @objc private func didTapPushButton() { let vc = OrangeViewController() vc.hidesBottomBarWhenPushed = true // (1) navigationController?.pushViewController(vc, animated: false) // (2) } }OrangeViewController — the destination: final class OrangeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .orange } }Steps to reproduce Run on an iOS 27 device or simulator. On the first tab, tap the "Push" button. The orange screen first appears with a height that excludes the tab bar, then expands to full screen on the next frame. What I've already ruled out Both conditions must be present: hidesBottomBarWhenPushedanimatedResulttruefalse❌ Visible resizetruetrue✅ Normal slide-in transitionfalsefalse✅ No visible resizeAdditional findings: The destination view controller has no subviews or constraints, so this isn't a layout problem in my own hierarchy. I also verified that the same resize occurs with a completely empty UIViewController created purely in code — the destination has no storyboard, nib, or constraints at all. Reproduces with a plain UITabBarController + UINavigationController setup — no custom transitions, no UINavigationControllerDelegate, no appearance customization beyond a plain opaque white nav bar. Reproduces on a fresh project created from Xcode's default template. Environment iOS 27.0 (24A434) — device and simulator Xcode 27.0 (27A266a) Fresh project, default template Questions Is pushViewController(animated: false) onto a view controller with hidesBottomBarWhenPushed = true still a supported combination on iOS 27? The behavior change makes me wonder whether this is intended (requiring a workaround on my side) or a regression. If it's a regression, what's the recommended way to perform an animation-less push into a tab-bar-hiding view controller without the intermediate undersized frame? I've tried loadViewIfNeeded() plus manually assigning view.frame before pushing, but I'd rather not depend on private layout timing. I noticed the new UIView.AnimationOptions.flushUpdates (iOS 26+) documentation about flushing pending layout when animation scopes change. Is this behavior change related? Should view controllers pushed without animation be using flushUpdates? Happy to attach the sample project and a screen recording — just let me know the preferred way to submit them. Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
2
Boosts
0
Views
391
Activity
1d
iOS 27b3 SDK: iOS App on Mac crashes on UISearchBar focus
Our app crashes when compiled with the iOS 27 beta 3 SDK and run as an iOS app on Mac, on both macOS 26 and macOS 27, as soon as a UISearchBar receives focus. The crash is due to this exception: *** Assertion failure in BOOL _screenBasedFocusUnsupported(void)(), UIScreen.m:3.725 Accessing the focus system through UIScreen is no longer supported. ( 0 CoreFoundation 0x000000018bea31c0 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018b91e91c objc_exception_throw + 88 2 Foundation 0x000000018e092644 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0 3 UIKitCore 0x00000001c5dae8ec _screenBasedFocusUnsupported + 272 4 UIKitCore 0x00000001c5dae960 -[UIScreen _preferredFocusedWindow] + 24 5 UIKitCore 0x00000001c4ea3a60 -[UIScreen _mainSceneReferenceBounds] + 200 6 UIKitCore 0x00000001c4ea3914 -[UIScreen _mainSceneBoundsForInterfaceOrientation:] + 40 7 UIKitCore 0x00000001c5708134 +[UINavigationBar defaultSizeForOrientation:] + 76 8 UIKitCore 0x00000001c6222c88 -[_UISearchPresentationController _layoutPresentationWithSize:transitionCoordinator:] + 704 9 UIKitCore 0x00000001c622296c -[_UISearchPresentationController containerViewWillLayoutSubviews] + 84 10 UIKitCore 0x00000001c549304c block_destroy_helper.13 + 25112 11 UIKitCore 0x00000001c549344c block_destroy_helper.13 + 26136 12 UIKitCore 0x00000001c4ea26a8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1648 13 QuartzCore 0x0000000196103dbc _ZN2CA5Layer15perform_update_EPS0_P7CALayerjNS_17LayerUpdateReasonEPNS_11TransactionE + 460 14 QuartzCore 0x000000019610390c _ZN2CA5Layer17update_if_needed_EPNS_11TransactionENS_17LayerUpdateReasonE + 692 15 QuartzCore 0x0000000196035d2c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 608 16 QuartzCore 0x0000000195e69520 _ZN2CA11Transaction6commitEv + 652 17 AppKit 0x0000000190fe116c __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.7 + 44 18 CoreFoundation 0x000000018be34ad0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 19 CoreFoundation 0x000000018be34a10 __CFRunLoopDoBlocks + 396 20 CoreFoundation 0x000000018be33e54 __CFRunLoopRun + 2356 21 CoreFoundation 0x000000018bf06234 _CFRunLoopRunSpecificWithOptions + 532 22 HIToolbox 0x0000000198c1f560 RunCurrentEventLoopInMode + 320 23 HIToolbox 0x0000000198c228bc ReceiveNextEventCommon + 488 24 HIToolbox 0x0000000198dac14c _BlockUntilNextEventMatchingListInMode + 48 25 AppKit 0x00000001909163d0 _DPSBlockUntilNextEventMatchingListInMode + 228 26 AppKit 0x000000019026a084 _DPSNextEvent + 576 27 AppKit 0x0000000190dff96c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 28 AppKit 0x0000000190dff678 -[NSApplication(NSEventRouting) nextEventMatchingMask:untilDate:inMode:dequeue:] + 72 29 AppKit 0x000000019025d13c -[NSApplication run] + 368 30 AppKit 0x00000001902357b0 NSApplicationMain + 880 31 AppKit 0x000000019047c958 +[NSWindow _savedFrameFromString:] + 0 32 UIKitMacHelper 0x00000001aa2651bc UINSApplicationMain + 972 33 UIKitCore 0x00000001c4e1aed4 UIApplicationMain + 144 34 UIKitCore 0x00000001c548bda0 block_destroy_helper.31 + 8880 35 DigitalConcertHall.debug.dylib 0x0000000106e41bd8 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 128 36 DigitalConcertHall.debug.dylib 0x0000000106e41b4c $s18DigitalConcertHall11AppDelegateC5$mainyyFZ + 32 37 DigitalConcertHall.debug.dylib 0x0000000106e4afc0 __debug_main_executable_dylib_entry_point + 28 38 dyld 0x000000018b9ac4e4 start + 6992 ) I could not test with the iOS 27 beta 4 SDK due to this blocking issue: https://developer.apple.com/forums/thread/839012 However, when I tried to set up a simple sample project, I could not reproduce the issue. Does anybody know what might be causing this? I filed feedback FB24201508
Replies
9
Boosts
2
Views
2.3k
Activity
1d
make search bar appear as bottom toolbar button on iPad? (UIKit)
In UIKit, I really like the layout convention on iPhone where the search bar appears as a button in the toolbar at the bottom of the screen, and the user can tap it to see the actual search bar, also at the bottom. viewController.navigationItem.searchBarPlacementAllowsToolbarIntegration = true viewController.navigationItem.preferredSearchBarPlacement = .integratedButton let spacer = UIBarButtonItem.flexibleSpace() let searchbarPlacer = viewController.navigationItem.searchBarPlacementBarButtonItem viewController.toolbarItems = [spacer, searchbarPlacer]However, on iPad I'm having trouble getting the same effect; the search button wants to appear at the top, in the navigation bar, even though I'm specifically asking it to appear at the bottom, in the toolbar. How do I get the same layout on iPad?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
0
Boosts
0
Views
48
Activity
2d
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
4
Boosts
2
Views
459
Activity
4d
Public API for the iPhone Duo inner-display glow in tent mode
Feature request: Public API for the iPhone Duo inner-display glow in tent mode I’d like a public API for the colored glow that the StandBy alarm casts onto the table in tent mode. It’s a subtle detail that would work well in other apps. The outer display could keep showing the app while the inner glow picks up a color from album artwork or shifts as a timer counts down. The private UIKitCore methods +[_UISceneCompanion _alarmGlowContent] and +[_UISceneCompanion _highlightCompanionWithColor:] point to the effect I mean. SpringBoard also defines SBCompanionScenePresentationModeInnerDisplayStandbyAlarmGlow. In SwiftUI, I could imagine using it like this: .sceneAccessory { InnerDisplayGlowAccessory(color: glowColor) }An optional intensity parameter would be nice, too. That would let apps keep the glow faint during playback or brighten it briefly when something changes, within brightness limits set by iOS.
Replies
0
Boosts
0
Views
117
Activity
4d
Mac Catalyst: disabled SwiftUI toolbar buttons turn into pills and don’t update their state
Hi everyone, we’ve been fighting with disabled toolbar buttons in our Mac Catalyst app and wanted to check whether others are seeing the same thing, or whether we’re missing something. Our toolbar lives in a SwiftUI NavigationStack, so Catalyst bridges it into the window’s NSToolbar. Enabled buttons look and work great: native buttons with a round 36 × 36 pt glass. But as soon as a button uses .disabled(_:), things fall apart: It turns into a wider pill. A button that is disabled when it appears becomes an image item instead of a button (NSToolbarImageView with a UIImage), and its glass grows to 47 × 36 pt. Its state doesn’t update. Toggling .disabled(_:) doesn’t reach the existing toolbar item. It only changes if we give the ToolbarItem a new id, which then brings back the pill. Disabling the NSToolbarItem ourselves doesn’t stick. UIKit revalidates the toolbar whenever any item changes, and copies the bar button’s enabled state back over ours. Drawing our own image to fix the shape crashed AppKit (“Unable to install constraint on view”) as soon as the item switched back to enabled. For now we keep the SwiftUI button enabled on the Mac and disable the native NSToolbarItem ourselves. We find the toolbar via NSToolbar.willAddItemNotification and use KVO to put the state back whenever UIKit overrides it. It works, but it feels like it shouldn’t be necessary. Here’s a minimal example: struct ContentView: View { @State private var canUndo = false var body: some View { NavigationStack { Button("Toggle") { canUndo.toggle() } .toolbar { ToolbarItem(placement: .topBarLeading) { Button("Undo", systemImage: "arrow.uturn.backward") {} .labelStyle(.iconOnly) .disabled(!canUndo) } } } } }Seen on macOS 27.2 and 26.7.1, Xcode 27.2. Filed as FB25597608. Is there a supported way to get a disabled toolbar button that stays a normal native button? Any hints are very welcome. Thanks!
Replies
0
Boosts
0
Views
72
Activity
5d
Can an iOS Custom Keyboard Legally Launch Its Containing App for a User-Initiated Speech Recording?
I’m developing an iOS application with a custom keyboard extension and a companion app. Our intended user experience: The user is typing in an app such as WhatsApp using our custom keyboard. They tap the Speech button. Our companion app opens automatically. The companion app establishes a microphone session. iOS returns the user to the original host app. The user continues dictating through the keyboard. What we have already implemented: A Swift-based custom keyboard and companion app. App Groups and Darwin notifications for communication between the two targets. Microphone recording through the companion app. Apple Speech Recognition with on-device recognition. A warm background audio session. Subsequent recordings and text insertion work on a physical iPhone once the warm session is established. Our current blocker: The keyboard extension cannot successfully open its companion app when the warm session is inactive. We previously tried NSExtensionContext.open(), but it did not work. We want to avoid private APIs, responder-chain workarounds, and anything that could violate App Store Review Guidelines. My questions: Does Apple provide any officially supported public API that allows a custom keyboard extension to launch its containing app in response to an explicit user tap? Can App Intents or ForegroundContinuableIntent legitimately achieve this from a keyboard extension? Does App Review Guideline 4.4.1 prohibit this particular user-initiated handoff? If direct launching is prohibited, what Apple-supported architecture or interaction pattern would you recommend for this use case? Is there a supported way for the companion app to return the user to the original host app after establishing the microphone session? We are looking for guidance based on actual iOS platform restrictions and supported APIs, preferably from developers who have shipped custom keyboard applications. Thank you.
Replies
1
Boosts
0
Views
63
Activity
5d
State Restoration no longer works in a Mac Catalyst based app when run on macOS 27.x
As reported in FB25363417: A UIKit based app running on macOS 27.2 (or macOS 27.0.1) via Mac Catalyst no longer has functioning state restoration. Upon app restart, there is no NSUserActivity being provided to the scene in the UISceneDelegate method scene(_:willConnectTo:options:). This can be tested with Apple’s own sample app “Restoring your app’s state”. Just update the sample project with support for a Mac Catalyst build. Using Xcode 27.2 on a Mac with macOS 27.0 or 27.2, build and run the Mac Catalyst version of the app. The main screen appears with a list of products. Select any product so you see details of the product. Quit the app. Run the app again. Note that you are not returned to the previously selected product detail screen. Instead, you just see the main list of products. If you run the same app and perform the same steps on a Mac running macOS 26.x, then when the app is restarted, you correctly get returned to the previously selected product detail screen. The problem is being caused by no NSUserActivity being passed into the scene delegate on app startup. While running the app on a Mac with macOS 27.x, put a breakpoint on the initial guard statement in scene(_:willConnectTo:options:) and you will see there is no activity on app restart. This is impacting paid customers of my existing app since upgrading to macOS 27. They no longer get returned to the app’s previous state when restarting the app. It is expected that state restoration should work on macOS 27 just as well as it does under macOS 26 in an app built with Mac Catalyst.
Replies
1
Boosts
0
Views
181
Activity
6d
iPhone Duo vertical bar: system back button ignores custom back indicator image (UINavigationBarAppearance.setBackIndicatorImage)
On iPhone Duo (iOS 27.1), when UIKit moves a navigation controller's system back button into the vertical bar, the button always shows the system chevron. Every public API for customizing the back indicator image is ignored there, although the same configuration is honored in the horizontal (top) navigation bar. APIs tested (each one alone, on the second view controller of a UINavigationController stack, with no leftBarButtonItem): A. Nothing set (default). B. UINavigationBar.standardAppearance set to a UINavigationBarAppearance on which setBackIndicatorImage(_:transitionMaskImage:) was called. C. Same appearance assigned to all four UINavigationBar properties: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. D. Same appearance assigned to all four UINavigationItem properties of the pushed view controller: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. E. Legacy UINavigationBar.backIndicatorImage and UINavigationBar.backIndicatorTransitionMaskImage, with no appearance objects set. F. UINavigationBar.appearance() proxy: all four appearance properties, set before the navigation controller is created. G. UINavigationItem.backBarButtonItem of the previous view controller set to UIBarButtonItem(image:style:target:action:). H. Control: UINavigationItem.leftBarButtonItem set to UIBarButtonItem(image:style:target:action:) with the same image (axisBehavior left at .automatic). The marker image is UIImage(systemName: "arrow.uturn.backward"), so it cannot be mistaken for the system chevron. Results: Top navigation bar (iPhone 17 Pro iOS 27.0, and iPhone Duo open with portrait UI): B, C, D, E and F show the custom image. G shows the chevron followed by the image. Vertical bar (iPhone Duo closed; iPhone Duo open with landscape UI; also inside a UITabBarController with the tab bar hidden or visible): A through G all show the system chevron. Only H shows the custom image. At viewDidAppear, the app confirms that the configuration is in place: navigationBar.standardAppearance.backIndicatorImage is the marker image (B, C), navigationItem.standardAppearance is non-nil (D), and traitCollection.verticalBarEdge is .trailing. This contradicts the guidance given by an Apple Technology Evangelist in https://developer.apple.com/forums/thread/847875: "If you are only replacing the icon on the back button, you could use set the backIndicatorImage and maintain default system behavior. This would be the recommended approach." As things stand, the only way to show a custom back icon in the vertical bar is to replace the system back button with a leading item. That loses the system behavior that comes with it: UINavigationController.interactivePopGestureRecognizer, interactiveContentPopGestureRecognizer and the back-history menu.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
2
Boosts
3
Views
563
Activity
6d
UITableView row reordering no longer works under macOS 27 with Mac Catalyst
Under macOS 27 using Mac Catalyst for a UIKit-based app, If you present a view controller with a table view as a form sheet or page sheet, row reordering fails to function. You can drag a row as expected but the blue movement bar never appears and if you drop the row it simply returns to its original location. The exact same view controller presented as a popover works just fine. The exact same view controller not presented as a modal (such as the app's root controller) works just fine. This is a serious bug affecting existing applications and being reported by paying customers. This has been reported as FB25038883 which includes a simple sample app demonstrating the issue.
Replies
4
Boosts
1
Views
593
Activity
6d
iPhone Duo Unfolded Safe Areas
Hi, my app is currently built on Xcode 27.1 I am working on upgrading to Xcode 27.2 We have a regression issue whereby, the top safeArea is 82 despite the vertical bar being opted in and active. This only happens on unfolded landscape. Our right safeArea is 0 for the window and is 84 for the view safeArea. Both window and view safeAreas have the top safe area of 82 though. We would like to know what could be the cause behind the top safeArea being activated. Note: this is not an issue for iOS 27.1
Replies
2
Boosts
0
Views
220
Activity
6d
SwiftUI Architecture Guide
Application Types Applications are divided into Document-based and Library-based. A document-based application stores user data in individual, standalone files. Users manually name and organize those files in a local system or synced cloud storage such as iCloud. The software typically opens multiple windows for different projects. This framing is for standalone, complex files that need to be shared, exported, or handled independently. A library-based application manages data in one unified, central repository, locally or through remote cloud databases. Spotify, Netflix, and Notion are the examples shown. The file system is hidden; updates are saved automatically in real time; and a single window supports browsing, search, and access to the synchronized data collection from any device. Model Types Four model types: Data, Domain, Application, and Presentation. Apple Platforms In Apple MVC (AppKit / UIKit), the model branches to Data, Domain, and Presentation. In SwiftUI, Model branches to Data and Domain. Project Structure SwiftUI App Folders Swift Package Folders App Modularization Not every module in a large application needs to be extracted into a separate framework or Swift Package. Logical modularization can also be achieved through a well-organized folder structure within the main project. Introduce separate packages or frameworks only when there is a clear benefit, such as independent reuse, distribution, build isolation or ownership. Avoid unnecessary project and dependency management overhead. State Management & Data Flow Source of truth is “a key concept in SwiftUI”: a single place to store a piece of data, with everywhere else reading the same piece of data. Environment is SwiftUI’s native dependency-injection mechanism. It allows shared dependencies, domain models, and services to be injected at the appropriate view-hierarchy level and accessed where needed without explicit parameter passing or unnecessary coupling. It is described as a tool for managing dependencies and sharing state across the view hierarchy. Domain Model Ownership Domain Models should be owned by the highest relevant SwiftUI view in the hierarchy that defines their context and lifecycle. NavigationStack owns the Domain Models for its navigation context and makes them available to descendant views through @Environment. When a NavigationStack is embedded in a TabView or NavigationSplitView, ownership moves up to the TabView or NavigationSplitView so the models can be shared across tabs or split views. The stated result is clear ownership scope, sharing where needed, and isolation between independent navigation contexts. Previews & UI Testing Environment injection makes SwiftUI Previews and UI Tests easier to configure by allowing real Domain Models to be replaced with mock or dummy instances. Views can be tested independently with controlled data and predictable states, without requiring real services, network requests, or application setup. Domain and Data Model Examples For a library-based app with remote data. Additional Domain Model Examples E-commerce Catalog, ShoppingCart, OrderHistory, Wishlist Banking MyAccounts, MyCards, MyTransactions, MyInvestments Social Network Feed, Conversations, Notifications, Friends Healthcare MyAppointments, MedicalHistory, Prescriptions, MyHealth Education Courses, MyCourses, Assignments, MyGrades, LearningProgress Real Estate PropertyCatalog, MyProperties, Favorites, Appointments Hotel Booking Destinations, Search, MyBookings, TravelHistory Food Delivery RestaurantCatalog, ShoppingCart, MyOrders, DeliveryTracking Project Management Projects, MyTasks, TeamMembers, Notifications Insurance MyPolicies, MyClaims, Coverage, Documents Smart Home MyHomes, Devices, Automations, EnergyUsage Fitness MyPlans, MyProgress, MyGoals, WorkoutHistory Other Search, Dashboard, Favorites, Notifications, Settings, ActivityHistory, Recommendations, Subscription, DocumentLibrary ViewModel? - MVVM In SwiftUI, the View encapsulates the UI content (body), its state (properties), and its actions or tasks (functions). This is possible because SwiftUI is designed around a declarative, state-driven UI model. In Android and .NET platforms, a separate ViewModel is typically required to hold and manage the View's state. Projects that intoduce ViewModels in SwiftUI add unnecessary architectural complexity, boilerplate, and code duplication; synchronization issues; unclear state ownership; additional lifecycle management; more abstractions; harder debugging; and increased maintenance, without meaningful benefits over SwiftUI's native state management. In UIKit, introducing a separate ViewModel layer is often unnecessary, as UIViewController already serves as the presentation model, handling presentation logic and coordinating the view. Non-UI responsibilities can be delegated to dedicated ModelControllers or Managers, avoiding unnecessary layers and abstractions. Domain Models vs. ViewModels Domain Models are view-independent, while ViewModels are view-dependent. A ViewModel is tightly coupled to the structure, state, and lifecycle of a specific View. Whenever the View code changes, its ViewModel often requires corresponding coding changes, and vice versa, creating additional maintenance and synchronization overhead. Domain Models, on the other hand, represent application context and business functionality independently of the UI. This separation preserves UI independence and allows the same Domain Models to be shared across different screens and platforms, such as iPhone, iPhone Duo, iPad, and macOS, without duplicating or adapting business logic for each View. This makes Domain Models a more scalable and maintainable approach for modern SwiftUI applications, particularly those targeting multiple screen sizes and platforms.
Replies
1
Boosts
0
Views
292
Activity
6d
A bug in iOS 27.3 beta 2 where the UIHingeInteraction value is received even though it is not an iPhone Duo device.
The device currently showing the symptom is iPhone SE3, iOS 27.3 Beta 2 version installed. (Same symptom exists in Beta 1 as well.) On screen A When switching to another ViewController (screen B) with pushViewController of UINavigationController Declare UIHingeInteraction on screen A and self.view.addInteraction(hInteraction) I added it like the code above. Hinge value comes in. In the sample code below update.hinge value is not nil The update.hinge!.angle value is also displayed as 0. let hInteraction:UIHingeInteraction = UIHingeInteraction { interaction, update in if update.hinge != nil { let hingeAngle:CGFloat = update.hinge!.angle..... }} In apps installed on other iPhone 17 devices (with iOS 27.2 installed), the value does not appear there. A quick fix is ​​needed. I have also submitted a report via Apple Feedback; please ensure this is addressed in the upcoming Beta 3 release. *** Plus *** The horizontalSizeClass and verticalSizeClass properties are returning "Regular" values, similar to how they behave on the iPhone Duo's internal display. Please fix the above issue as well.
Replies
0
Boosts
1
Views
151
Activity
1w