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 Summary of the iPhone Duo Group Lab
Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the iPhone Duo Group Labs: How should apps preserve navigation and UI state when switching between the inner and outer displays? Treat display transitions as size-class and trait changes, not a scene disconnect or app termination; your process stays alive. For more information, see Prepare your app for iPhone Duo. For state that must survive a scene disconnect/reconnect, implement stateRestorationActivity(for:) to save an NSUserActivity Restoring your app's state. Do multiple instances of the same app on iPhone Duo share UserDefaults/@AppStorage state? Multiple instances of your app's UI on iPhone Duo behave similarly to multi-window support on iPadOS. To learn more, see Leverage multiple displays and scenes on iPhone Duo. Both UserDefaults and AppStorage are app-wide, not per-window, stores. If a full-screen app on the inner display is closed, does it move to the outer display or get backgrounded? iPhone Duo honors UIRequiresFullScreen and apps adapt in place as the device opens and closes rather than backgrounding. To learn more, watch Prepare your app for iPhone Duo. How should apps preserve state — text input, scroll position, video playback, camera sessions — during hinge angle transitions? For example, when a LazyVGrid's column count changes because the device folds, does SwiftUI preserve scroll position automatically, or should you use scrollPosition(id:)? The system generally preserves text input and scroll position automatically since hinge angle changes are represented as size-class and trait updates, not a scene disconnect or app termination. This applies even to cases like a LazyVGrid column-count change triggered by opening or closing the device — apps typically don't need to manually manage scroll position with scrollPosition(id:anchor:) for this transition. For more info, see Prepare your app for iPhone Duo. How can apps preserve what someone is doing when switching displays or folding/unfolding? Treat this as a resize/trait-change event, not app teardown — your process keeps running as size classes change. See Prepare your app for iPhone Duo to learn more. For scenes that actually disconnect and reconnect, implement stateRestorationActivity(for:) to save an NSUserActivity Restoring your app's state. How does actively playing video behave through the hinge angle animation? The system generally preserves video playback and player position automatically since hinge angle changes are represented as size-class and trait updates, not a scene disconnect or app termination. AVKit will scale and resize the video automatically. If a user folds or unfolds the device mid-checkout, what does the system preserve automatically, and what should the app manage itself to avoid lost input or duplicate requests? When someone opens or closes an iPhone Duo, the system represents this as a size-class and trait collection change, not a scene disconnect or app teardown, so in-memory state like input fields typically persists automatically since the app’s process keeps running. For more info, see Prepare your app for iPhone Duo. How should apps handle the keyboard and text input when the device folds or unfolds while typing? As iPhone Duo folds or unfolds, the available screen geometry and framing change. Ensure your app adopts standard layout controls, containers, and size classes to handle resizability gracefully across all poses. When a text field becomes first responder, the system automatically shows the keyboard and binds its input to the text field. Because the appearance of the keyboard has the potential to obscure portions of your user interface, you should update your interface as needed to ensure that the text field being edited remains visible. Use keyboard notifications such as keyboardWillShowNotification, keyboardWillHideNotification, and keyboardWillChangeFrameNotification to detect the appearance and disappearance of the keyboard and to make necessary changes to your interface layout. To learn more, see UITextField. If someone is typing and closes iPhone Duo, does the keyboard/editing session survive the hinge transition, or does it get a new scene? When a user types and closes iPhone Duo, the active editing session and keyboard do not get a completely new scene. Instead, the app undergoes a dynamic resizing and transitions from the inner display to the compact outer display, maintaining the existing scene and application state. For more info, watch Prepare your app for iPhone Duo.
16
0
7.5k
Sep ’26
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
30
4h
SwiftUI TabView with a .prominent tab exhibits unexpected rendering behavior during iPhone Duo display transitions
Hi Apple Support Team, I would like to report an iPhone Duo-specific regression that appears in iOS 27.2.1. The same application behaves correctly on iOS 27.1, and I have been able to reproduce the issue consistently using a minimal sample application. When running the application on iPhone Duo, transitioning from the outer display to the inner display while the device is opened in landscape orientation results in unexpected UI rendering. Specifically, a large arc-shaped visual element associated with a tab configured with the .prominent role appears on screen after the transition. In addition to the rendering issue, we have observed unexpected UI presentation behavior during these display transitions when a tab is assigned the .prominent role. The issue appears to be tied to the .prominent tab role. When all tabs use the default role, the application behaves as expected and neither the rendering issue nor the unexpected UI behavior is observed. A sample application reproducing the issue is attached. Steps to Reproduce Launch the attached sample application on iPhone Duo running iOS 27.2.1. Ensure that one of the tabs is configured with the .prominent role. Start on the outer display. Open the device and transition to the inner display in landscape orientation. Observe the UI during and after the transition. Expected Result TabView should transition cleanly between the outer and inner displays without rendering artifacts or unexpected UI behavior. Actual Result A large arc-shaped visual artifact appears on screen. Unexpected view presentation behavior may occur during the display transition. Multiple animation- and transform-related warnings are logged. // Attached run time logs. Additional Notes Reproducible in both our production application and the attached sample application. The issue appears to be tied to SwiftUI TabView when a tab is assigned the .prominent role. The issue was not observed on iOS 27.1. The issue occurs during transitions between the outer and inner displays on iPhone Duo. Removing the .prominent role eliminates the issue. Could you please let us know whether this is a known issue with SwiftUI TabView and .prominent tabs during iPhone Duo display transitions on iOS 27.2.1? If there is an existing Feedback report, Apple Developer Forums discussion, internal tracking issue, or recommended workaround, we would greatly appreciate any guidance. Screenshots and a sample project are attached. Thank you for your time and assistance. Please let me know if any additional diagnostics, sysdiagnose captures, logs, or sample projects would be helpful. Best regards, Manish
1
0
181
13h
Can a CGVirtualDisplay-based display receive direct touch in macOS 27 (Touch on Mac)?
We ship a macOS app that creates a virtual display with CGVirtualDisplay and streams it to a tablet, which acts as a second screen. Today we deliver the tablet's touches as mouse events (CGEvent), so the system sees a pointer, not touch. With Touch on Mac in macOS 27, we would like the system to treat that display as touch-capable, the way it does for an iPad connected with Sidecar: Can a display created with CGVirtualDisplay report touch capability (NSScreen.touchCapabilities including .multiTouch) and receive direct touches? If not directly, is a virtual HID digitizer (DriverKit or CoreHID) associated with the display's UUID the supported path? Is the com.apple.developer.hid.virtual.device entitlement available for this use? If neither is supported today, what is the recommended way to deliver touch input to a virtual display without mouse emulation? We asked this in the Touch on Mac Group Lab on 20 November and were directed here. Thank you.
0
0
149
14h
Regression: AxisValueLabel multiLabelAlignment parameter ignored in iOS 27
Hello Apple SwiftUI / Swift Charts Engineering Team, I am writing to report a layout regression regarding Swift Charts in iOS 27. The multiLabelAlignment property on AxisValueLabel has stopped working as expected, whereas it functions perfectly in iOS 26. Bug Description: When configuring custom string values within AxisMarks using AxisValueLabel with multiLabelAlignment: .trailing, the alignment configuration is completely ignored on iOS 27. Labels fail to align text properly to the trailing edge, causing rendering layout issues for multi-line or custom text labels on the Y-axis. This exact same implementation compiles and aligns correctly on iOS 26. Code Snippet to Reproduce: swift struct YAxisAlignmentBugView: View { // data points to render the chart frame let data = [(date: Date(), revenue: 3000.0), (date: Date().addingTimeInterval(10000), revenue: 4000.0)] var body: some View { Chart(data, id: .date) { item in LineMark(x: .value("Date", item.date), y: .value("Revenue", item.revenue)) } .frame(height: 300) .padding() .chartYAxis { AxisMarks(preset: .aligned, position: .trailing, values: [12.0, 600.0, 3000.0, 6000.0]) { value in if let revenue = value.as(Double.self) { // BUG: multiLabelAlignment: .trailing is completely ignored on iOS 27 AxisValueLabel("y-(Int(revenue))", anchor: .leading, multiLabelAlignment: .trailing) } } } } } Steps to Reproduce: Render a Swift Chart containing a .chartYAxis configuration with position: .trailing. Pass a string directly using AxisValueLabel(customText, anchor: .leading, multiLabelAlignment: .trailing). Run the application on an iOS 26 simulator (text aligns properly to the trailing edge). Run the identical application code on an iOS 27 simulator. Expected Behavior: The text inside the AxisValueLabel should honor the multiLabelAlignment: .trailing parameter and align the text strings flush right. Actual Behavior: The multiLabelAlignment layout modifier is ignored on iOS 27, resulting in unexpected default left-alignment of the text strings. Attachments: I have attached screenshots from the Xcode Simulator demonstrating the regression: Please let me know if you need any further diagnostic details. Best regards, Soumyajit Das
3
0
311
16h
Regression: AxisValueLabel anchor parameter ignores .topLeading on iOS 27
Hello Apple SwiftUI / Swift Charts Engineering Team, I am writing to report a layout regression regarding Swift Charts in iOS 27. The anchor property on AxisValueLabel has stopped honoring the .topLeading layout coordinate, whereas it functions perfectly in iOS 26. Bug Description: To prevent the first label on a bottom X-axis from clipping past the left screen edge, a .topLeading anchor is applied. In iOS 27, this specific anchor alignment is completely ignored. The chart falls back to a standard top-center alignment, causing the initial boundary label to clip off-screen. Core Code Snippet to Reproduce: struct XAxisAnchorBugView: View { let dates = [ Calendar.current.date(from: DateComponents(year: 2026, month: 10, day: 1))!, Calendar.current.date(from: DateComponents(year: 2026, month: 10, day: 2))! ] var body: some View { Chart(dates, id: .self) { date in LineMark(x: .value("Date", date), y: .value("Value", 100)) } .frame(height: 300) .padding() .chartXAxis { AxisMarks(preset: .aligned, position: .bottom, values: .stride(by: .day, count: 1)) { value in AxisTick() let currentAnchor: UnitPoint = { guard let currentDate = value.as(Date.self) else { return .top } // BUG: .topLeading layout anchor parameter is completely ignored on iOS 27 return (currentDate == dates.first) ? .topLeading : .top }() AxisValueLabel(format: .dateTime.month(.abbreviated).day(), anchor: currentAnchor) } } } } Steps to Reproduce: Render an X-axis with a .bottom position. Assign anchor: .topLeading strictly to the first axis element's label. Run on an iOS 26 simulator (the first label anchors its top-left corner correctly, preventing edge clipping). Run on an iOS 27 simulator (the .topLeading anchor is ignored, reverting to standard top-center alignment). Expected Behavior: AxisValueLabel should position its layout bounding box using the .topLeading anchor point when specified. Actual Behavior: The layout engine ignores the .topLeading parameter on iOS 27, causing the boundary text to shift left and clip. Attachments: I have attached Xcode Simulator screenshots demonstrating this regression: Best regards, Soumyajit Das
3
0
334
17h
How to handle all the core AppleEvents
Glancing through the APIs, SwiftUI can handle the open app, reopen app, open doc, and quit core events (with the “aevt” suite ID). What about the print doc and open content events? If there are no hooks (yet), how can I implement them the traditional way without clashing with SwiftUI?
2
0
789
18h
macOS 27.2: NSStatusItem tooltip stays on screen, then jumps to the pointer when toolTip changes
Environment: macOS Golden Gate 27.3 (26C5035r) arm64, Apple silicon, one display at 2240×1260 (scaled). Symptom. A tooltip window stays on screen at full opacity after the pointer has left. Sometimes it sits in the middle of the screen, far from the menu bar item it belongs to. Hovering or clicking that menu bar item clears it. I've seen it with seven apps: Syncthing, DriveDx and Private Internet Access (menu bar items), and Google Chrome, Chrome Beta, Opera and iTerm2 (tooltips inside their windows). What I measured (polling CGWindowListCopyWindowInfo, plus sample): The stuck window belongs to the app's own process, at window layer 103, alpha 1.0. The app is idle while it's stuck: its main thread is in mach_msg2_trap in 85–100% of samples. In the Chrome and Opera samples the tooltip is handled by NSToolTipManager (displayToolTip:, mouseEnteredToolTip:inWindow:pointInWindow:, fadeToolTip:). Every tooltip is drawn 19–20 pt below where the pointer was when it was shown, so a mid-screen tooltip was shown while the pointer was there. Syncthing (open source) only sets statusItem.button.toolTip, on the main thread, when its status changes. It has no tracking areas or mouse handling of its own. Reproducible part (Syncthing's menu bar item): Have its tooltip stuck. This happens on its own from time to time. I can't trigger it on demand. Leave the pointer anywhere away from the menu bar and change a file in a synced folder, so that Syncthing updates its status and sets a new toolTip. Result: the stuck tooltip window (same window number) moves to 19–20 pt below the current pointer position and stays there. It happened twice in a row, 25 seconds apart, at two different pointer positions. Control: with nothing stuck, 9 such changes (some local, some synced in from another machine) showed no tooltip anywhere. Expected: a tooltip is only shown while the pointer is over its view, and a toolTip change while the pointer is elsewhere shows nothing. So setting toolTip doesn't show a tooltip on its own, it only moves one that is already stuck. I don't know what leaves it stuck in the first place. Possibly related: FB23329983 (status item buttons not getting hover events on macOS 27 betas, reported fixed in beta 5), from this thread. Screenshots of sample tooltips attached.
Topic: UI Frameworks SubTopic: AppKit Tags:
7
2
980
19h
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
155
1d
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
544
1d
didUpdateEffectiveGeometry reports outer display frame when app is send to background while using the inner display.
On iPhone Duo, when the app goes into background while being used on the inner display, windowScene(_:didUpdateEffectiveGeometry:) is called with a frame matching the geometry of the outer display.  When the app returns to the foreground, the callback fires again with the inner display geometry. We reload our layouts based on this callback so the transient frame cause a visible relayout when returning to the app. This also reproduces when building with Xcode 27.3 beta and on OS version 27.2.0. Snippet: func windowScene(_ windowScene: UIWindowScene, didUpdateEffectiveGeometry previousEffectiveGeometry: UIWindowScene.Geometry) { log("didUpdateEffectiveGeometry", windowScene) } func sceneDidEnterBackground(_ scene: UIScene) { log("sceneDidEnterBackground", scene) } func sceneWillEnterForeground(_ scene: UIScene) { log("sceneWillEnterForeground", scene) } private func log(_ event: String, _ scene: UIScene) { guard let windowScene = scene as? UIWindowScene else { return } let state = windowScene.activationState == .background ? "background" : "foreground" let size = windowScene.effectiveGeometry.coordinateSpace.bounds.size print("\(event) | state: \(state) | size: \(Int(size.width)) x \(Int(size.height))") }Logs: sceneDidEnterBackground | state: background | size: 951 x 669 didUpdateEffectiveGeometry | state: background | size: 466 x 678 <- outer display size, device NOT folded didUpdateEffectiveGeometry | state: background | size: 951 x 669 sceneWillEnterForeground | state: background | size: 951 x 669Is this the expected behaviour, or a known issue? If it’s expected, what’s the recommended way to distinguish the effective geometry change?
Topic: UI Frameworks SubTopic: UIKit
0
0
24
1d
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
565
1d
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
192
1d
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
251
1d
SwiftUI custom focusable view cannot acquire focus programmatically on iPad with a hardware keyboard connected
On iPad, a SwiftUI view using .focusable(interactions: .edit) and .focused($isFocused) cannot acquire focus when a hardware keyboard is already connected. Setting isFocused = true from a button leaves it false. Tapping the view also leaves it unfocused, although the tap is received. Pressing Tab can focus the same view. struct FocusProbeView: View { @FocusState private var isFocused: Bool var body: some View { VStack { Text("Target") .focusable(interactions: .edit) .focused($isFocused) .onTapGesture { print("Target tapped") } Text("isFocused = \(isFocused)") Button("Focus target") { isFocused = true } } .defaultFocus($isFocused, true) } }Steps to reproduce: Run this view on an iPad with a hardware keyboard connected. Tap “Focus target”, then tap “Target”. Observe that isFocused remains false. Press Tab. The target can receive focus through keyboard navigation. Disconnect the keyboard. Restart the app and tap “Focus target” again. isFocused becomes true. Reconnecting the keyboard does not remove that focus. Expected: A visible custom view marked .focusable(interactions: .edit) can receive focus through @FocusState, including when a hardware keyboard is connected. Actual: Programmatic focus fails when the keyboard is already connected. A native TextField tested with the same button and @FocusState does receive focus. Environment: iPad model: MU1V2NF/A; iPadOS version: 26.7.2; Xcode version: 27.2; hardware keyboard: Logi Folio Touch. iPad model: Device Hub iPad Pro 11-inch (M5); iPadOS version: 27.2; Xcode version: 27.2; hardware keyboard: Device Hub.
1
0
225
1d
Various menu bar NSStatusItem issues with macOS 27
It seems like macOS 27 beta 2 has some issues with NSStatusItem buttons added to the menu bar - this creates difficulties for some menu bar extra apps. NSStatusItem buttons does not receive mouse hover/movement events - FB23329983 On macOS 27, views inside an NSStatusItem button no longer receive hover or mouse-movement events. The same code works correctly on macOS 26. What I tried: An NSTrackingArea attached to a subview of NSStatusBarButton An NSTrackingArea attached directly to the status-bar button Replacing NSStatusItem.view with a custom view Embedding an NSHostingView and using SwiftUI onHover/onContinuousHover NSStatusItem button highlight cannot be set programmatically. - FB23330269 The following code no longer has any effect (does not provide the highlight capsule): NSStatusItem.button?.highlight(true) NSStatusItem window occlusionState no longer reflects hidden menu bar visibility - FB23349447 The following no longer works: statusItem.button?.window?.occlusionState.contains(.visible) These changes may be related to some of the touch related changes or maybe it's about how menu items are now seemingly more "managed" in a way that their position, visibility may change in a way that is transparent/undetectable to the app.
9
2
1.8k
1d
Inversed swipe gesture in VStack/LazyVStack vs List
I'm using a row swipe to delete gesture in a LazyVStack just the same way I would do in a List and I have to inverse the gesture (from left to right) to allow the Delete button appearing whereas in a List, the left to right swipe gesture works as expected. The following code reveals that unexpected/anti natural behavior. iOS works as expected for the same code. import SwiftUI import Playgrounds struct ContentView: View { var body: some View { VStack { // anti-natural and inconsistent gesture // LazyVStack { // anti-natural and inconsistent gesture // List { // natural gesture HStack { Text("Swipe Test") Spacer() } .padding(10) .frame(height: 40) .background { Color.blue } .swipeActions(edge: .trailing, allowsFullSwipe: false) { Button("Delete", role: .destructive) {} } } } }Setup: Macbook Pro M1 Max / macOS 27.2.1 / Xcode 27.2
0
0
33
1d
iOS 27: FBSScene crashes in objc_release_x26 after a scene settings update
Feedback Assistant: FB25454822 On iOS 27, our app (com.netshort.abroad) crashes inside FrontBoardServices while releasing an object saved across a synchronous scene-update callout. The stack has only system frames. A build shipped in September 2025 (1.8.3) hits the same crash as soon as the device is updated to iOS 27, so this is not a recent app change. OS: iOS 27.0.0 (24A435), iOS 27.0.1 (24A446) On build 2.3.4: 1264 events, 1216 users 0 libobjc.A.dylib objc_release_x26 + 8 1 FrontBoardServices -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 780 2 FrontBoardServices _queue_updateScene…_block_invoke_2.cold.1 + 352 3 FrontBoardServices _queue_updateScene…_block_invoke_2 + 96 4 FrontBoardServices _calloutQueue_executeCalloutFromSource:withBlock: + 168 On 27.0.0 these frames show as <redacted> in Crashlytics. FrontBoardServices 0x19a88 is this method at 0x1977c plus 780, matching symbolicated 27.0.1 reports. In the 27.0.1 FrontBoardServices binary, +776 is objc_release(x26) and +780 is the return address. x26 is transitionContext.actions. The callout into UIKit is the bl at +0x2ac. The crash happens after that callout returns. 34 Apple crash reports with register state show the same pattern: the low byte of saved x26 is 0x01. 20 reports: objc_release_x26 + 8, x26 = 0x1 14 reports: objc_release_x26 + 16, x26 ends in 0x01 (for example 0x13c373a01) A nil actions value 0x0 becomes 0x1. A real pointer only has its low byte changed, so the isa read is off by one. In the +16 reports, x16 (0x8001000001fa8d89) is that isa shifted by one byte. This looks like a one-byte store of YES into the stack slot where x26 was saved across the callout. There is no single user action that reproduces it. It happens when the system delivers a scene settings update. The frame that wrote the byte is already gone, because the crash is recorded after the callout returns. Has anyone else seen this on iOS 27? I attached three .crash files with full register state to FB25454822.
Topic: UI Frameworks SubTopic: UIKit
1
1
395
2d
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
0
96
2d
Supported way to hide the system time in a full-screen watchOS clock app?
I'm building a standalone watchOS app (SwiftUI, watch-only) whose main screen is its own full-screen clock. The system time in the top-right corner duplicates our clock, so we'd like to hide it while this view is visible. I'd like to know which API is supported for this in an App Store app. What I tried (watchOS 27.2 SDK, Xcode 27.2): .persistentSystemOverlays(.hidden) on the root view and on the scene. The system time stays visible. In a variant with a NavigationStack and a hidden navigation bar, the time was briefly absent after launch, but it came back within about 20 seconds. .statusBarHidden(_:) and .toolbarVisibility(.hidden, for: .statusBar) are marked unavailable on watchOS in the SDK. View._statusBarHidden(_:) hides the system time reliably. In the watchOS SwiftUI interface it is public, available on watchOS since 6.0, and has no @_spi. It inlines to _statusBar(hidden:). However, it's underscored and I can't find documentation for it. Minimal example: struct ClockView: View { var body: some View { MyFullScreenClock() .persistentSystemOverlays(.hidden) // documented, but time remains visible ._statusBarHidden(true) // hides the time, but undocumented } }I've noticed this modifier in shipping open-source watchOS code, for example Home Assistant's watch app (Sources/WatchApp/Home/WatchHomeView.swift). That doesn't tell me whether Apple supports it, though. Questions: Is _statusBarHidden(_:) / _statusBar(hidden:) a supported API for a distributed watchOS app? If not, is there a documented way for a full-screen clock app to hide the system time, or is the system time intentionally always shown in third-party apps? I can share a small sample project that toggles between the documented overlay preference and the underscored modifier. Thanks!
2
0
81
2d
A Summary of the iPhone Duo Group Lab
Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the iPhone Duo Group Labs: How should apps preserve navigation and UI state when switching between the inner and outer displays? Treat display transitions as size-class and trait changes, not a scene disconnect or app termination; your process stays alive. For more information, see Prepare your app for iPhone Duo. For state that must survive a scene disconnect/reconnect, implement stateRestorationActivity(for:) to save an NSUserActivity Restoring your app's state. Do multiple instances of the same app on iPhone Duo share UserDefaults/@AppStorage state? Multiple instances of your app's UI on iPhone Duo behave similarly to multi-window support on iPadOS. To learn more, see Leverage multiple displays and scenes on iPhone Duo. Both UserDefaults and AppStorage are app-wide, not per-window, stores. If a full-screen app on the inner display is closed, does it move to the outer display or get backgrounded? iPhone Duo honors UIRequiresFullScreen and apps adapt in place as the device opens and closes rather than backgrounding. To learn more, watch Prepare your app for iPhone Duo. How should apps preserve state — text input, scroll position, video playback, camera sessions — during hinge angle transitions? For example, when a LazyVGrid's column count changes because the device folds, does SwiftUI preserve scroll position automatically, or should you use scrollPosition(id:)? The system generally preserves text input and scroll position automatically since hinge angle changes are represented as size-class and trait updates, not a scene disconnect or app termination. This applies even to cases like a LazyVGrid column-count change triggered by opening or closing the device — apps typically don't need to manually manage scroll position with scrollPosition(id:anchor:) for this transition. For more info, see Prepare your app for iPhone Duo. How can apps preserve what someone is doing when switching displays or folding/unfolding? Treat this as a resize/trait-change event, not app teardown — your process keeps running as size classes change. See Prepare your app for iPhone Duo to learn more. For scenes that actually disconnect and reconnect, implement stateRestorationActivity(for:) to save an NSUserActivity Restoring your app's state. How does actively playing video behave through the hinge angle animation? The system generally preserves video playback and player position automatically since hinge angle changes are represented as size-class and trait updates, not a scene disconnect or app termination. AVKit will scale and resize the video automatically. If a user folds or unfolds the device mid-checkout, what does the system preserve automatically, and what should the app manage itself to avoid lost input or duplicate requests? When someone opens or closes an iPhone Duo, the system represents this as a size-class and trait collection change, not a scene disconnect or app teardown, so in-memory state like input fields typically persists automatically since the app’s process keeps running. For more info, see Prepare your app for iPhone Duo. How should apps handle the keyboard and text input when the device folds or unfolds while typing? As iPhone Duo folds or unfolds, the available screen geometry and framing change. Ensure your app adopts standard layout controls, containers, and size classes to handle resizability gracefully across all poses. When a text field becomes first responder, the system automatically shows the keyboard and binds its input to the text field. Because the appearance of the keyboard has the potential to obscure portions of your user interface, you should update your interface as needed to ensure that the text field being edited remains visible. Use keyboard notifications such as keyboardWillShowNotification, keyboardWillHideNotification, and keyboardWillChangeFrameNotification to detect the appearance and disappearance of the keyboard and to make necessary changes to your interface layout. To learn more, see UITextField. If someone is typing and closes iPhone Duo, does the keyboard/editing session survive the hinge transition, or does it get a new scene? When a user types and closes iPhone Duo, the active editing session and keyboard do not get a completely new scene. Instead, the app undergoes a dynamic resizing and transitions from the inner display to the compact outer display, maintaining the existing scene and application state. For more info, watch Prepare your app for iPhone Duo.
Replies
16
Boosts
0
Views
7.5k
Activity
Sep ’26
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
30
Activity
4h
SwiftUI TabView with a .prominent tab exhibits unexpected rendering behavior during iPhone Duo display transitions
Hi Apple Support Team, I would like to report an iPhone Duo-specific regression that appears in iOS 27.2.1. The same application behaves correctly on iOS 27.1, and I have been able to reproduce the issue consistently using a minimal sample application. When running the application on iPhone Duo, transitioning from the outer display to the inner display while the device is opened in landscape orientation results in unexpected UI rendering. Specifically, a large arc-shaped visual element associated with a tab configured with the .prominent role appears on screen after the transition. In addition to the rendering issue, we have observed unexpected UI presentation behavior during these display transitions when a tab is assigned the .prominent role. The issue appears to be tied to the .prominent tab role. When all tabs use the default role, the application behaves as expected and neither the rendering issue nor the unexpected UI behavior is observed. A sample application reproducing the issue is attached. Steps to Reproduce Launch the attached sample application on iPhone Duo running iOS 27.2.1. Ensure that one of the tabs is configured with the .prominent role. Start on the outer display. Open the device and transition to the inner display in landscape orientation. Observe the UI during and after the transition. Expected Result TabView should transition cleanly between the outer and inner displays without rendering artifacts or unexpected UI behavior. Actual Result A large arc-shaped visual artifact appears on screen. Unexpected view presentation behavior may occur during the display transition. Multiple animation- and transform-related warnings are logged. // Attached run time logs. Additional Notes Reproducible in both our production application and the attached sample application. The issue appears to be tied to SwiftUI TabView when a tab is assigned the .prominent role. The issue was not observed on iOS 27.1. The issue occurs during transitions between the outer and inner displays on iPhone Duo. Removing the .prominent role eliminates the issue. Could you please let us know whether this is a known issue with SwiftUI TabView and .prominent tabs during iPhone Duo display transitions on iOS 27.2.1? If there is an existing Feedback report, Apple Developer Forums discussion, internal tracking issue, or recommended workaround, we would greatly appreciate any guidance. Screenshots and a sample project are attached. Thank you for your time and assistance. Please let me know if any additional diagnostics, sysdiagnose captures, logs, or sample projects would be helpful. Best regards, Manish
Replies
1
Boosts
0
Views
181
Activity
13h
Can a CGVirtualDisplay-based display receive direct touch in macOS 27 (Touch on Mac)?
We ship a macOS app that creates a virtual display with CGVirtualDisplay and streams it to a tablet, which acts as a second screen. Today we deliver the tablet's touches as mouse events (CGEvent), so the system sees a pointer, not touch. With Touch on Mac in macOS 27, we would like the system to treat that display as touch-capable, the way it does for an iPad connected with Sidecar: Can a display created with CGVirtualDisplay report touch capability (NSScreen.touchCapabilities including .multiTouch) and receive direct touches? If not directly, is a virtual HID digitizer (DriverKit or CoreHID) associated with the display's UUID the supported path? Is the com.apple.developer.hid.virtual.device entitlement available for this use? If neither is supported today, what is the recommended way to deliver touch input to a virtual display without mouse emulation? We asked this in the Touch on Mac Group Lab on 20 November and were directed here. Thank you.
Replies
0
Boosts
0
Views
149
Activity
14h
Regression: AxisValueLabel multiLabelAlignment parameter ignored in iOS 27
Hello Apple SwiftUI / Swift Charts Engineering Team, I am writing to report a layout regression regarding Swift Charts in iOS 27. The multiLabelAlignment property on AxisValueLabel has stopped working as expected, whereas it functions perfectly in iOS 26. Bug Description: When configuring custom string values within AxisMarks using AxisValueLabel with multiLabelAlignment: .trailing, the alignment configuration is completely ignored on iOS 27. Labels fail to align text properly to the trailing edge, causing rendering layout issues for multi-line or custom text labels on the Y-axis. This exact same implementation compiles and aligns correctly on iOS 26. Code Snippet to Reproduce: swift struct YAxisAlignmentBugView: View { // data points to render the chart frame let data = [(date: Date(), revenue: 3000.0), (date: Date().addingTimeInterval(10000), revenue: 4000.0)] var body: some View { Chart(data, id: .date) { item in LineMark(x: .value("Date", item.date), y: .value("Revenue", item.revenue)) } .frame(height: 300) .padding() .chartYAxis { AxisMarks(preset: .aligned, position: .trailing, values: [12.0, 600.0, 3000.0, 6000.0]) { value in if let revenue = value.as(Double.self) { // BUG: multiLabelAlignment: .trailing is completely ignored on iOS 27 AxisValueLabel("y-(Int(revenue))", anchor: .leading, multiLabelAlignment: .trailing) } } } } } Steps to Reproduce: Render a Swift Chart containing a .chartYAxis configuration with position: .trailing. Pass a string directly using AxisValueLabel(customText, anchor: .leading, multiLabelAlignment: .trailing). Run the application on an iOS 26 simulator (text aligns properly to the trailing edge). Run the identical application code on an iOS 27 simulator. Expected Behavior: The text inside the AxisValueLabel should honor the multiLabelAlignment: .trailing parameter and align the text strings flush right. Actual Behavior: The multiLabelAlignment layout modifier is ignored on iOS 27, resulting in unexpected default left-alignment of the text strings. Attachments: I have attached screenshots from the Xcode Simulator demonstrating the regression: Please let me know if you need any further diagnostic details. Best regards, Soumyajit Das
Replies
3
Boosts
0
Views
311
Activity
16h
Regression: AxisValueLabel anchor parameter ignores .topLeading on iOS 27
Hello Apple SwiftUI / Swift Charts Engineering Team, I am writing to report a layout regression regarding Swift Charts in iOS 27. The anchor property on AxisValueLabel has stopped honoring the .topLeading layout coordinate, whereas it functions perfectly in iOS 26. Bug Description: To prevent the first label on a bottom X-axis from clipping past the left screen edge, a .topLeading anchor is applied. In iOS 27, this specific anchor alignment is completely ignored. The chart falls back to a standard top-center alignment, causing the initial boundary label to clip off-screen. Core Code Snippet to Reproduce: struct XAxisAnchorBugView: View { let dates = [ Calendar.current.date(from: DateComponents(year: 2026, month: 10, day: 1))!, Calendar.current.date(from: DateComponents(year: 2026, month: 10, day: 2))! ] var body: some View { Chart(dates, id: .self) { date in LineMark(x: .value("Date", date), y: .value("Value", 100)) } .frame(height: 300) .padding() .chartXAxis { AxisMarks(preset: .aligned, position: .bottom, values: .stride(by: .day, count: 1)) { value in AxisTick() let currentAnchor: UnitPoint = { guard let currentDate = value.as(Date.self) else { return .top } // BUG: .topLeading layout anchor parameter is completely ignored on iOS 27 return (currentDate == dates.first) ? .topLeading : .top }() AxisValueLabel(format: .dateTime.month(.abbreviated).day(), anchor: currentAnchor) } } } } Steps to Reproduce: Render an X-axis with a .bottom position. Assign anchor: .topLeading strictly to the first axis element's label. Run on an iOS 26 simulator (the first label anchors its top-left corner correctly, preventing edge clipping). Run on an iOS 27 simulator (the .topLeading anchor is ignored, reverting to standard top-center alignment). Expected Behavior: AxisValueLabel should position its layout bounding box using the .topLeading anchor point when specified. Actual Behavior: The layout engine ignores the .topLeading parameter on iOS 27, causing the boundary text to shift left and clip. Attachments: I have attached Xcode Simulator screenshots demonstrating this regression: Best regards, Soumyajit Das
Replies
3
Boosts
0
Views
334
Activity
17h
How to handle all the core AppleEvents
Glancing through the APIs, SwiftUI can handle the open app, reopen app, open doc, and quit core events (with the “aevt” suite ID). What about the print doc and open content events? If there are no hooks (yet), how can I implement them the traditional way without clashing with SwiftUI?
Replies
2
Boosts
0
Views
789
Activity
18h
macOS 27.2: NSStatusItem tooltip stays on screen, then jumps to the pointer when toolTip changes
Environment: macOS Golden Gate 27.3 (26C5035r) arm64, Apple silicon, one display at 2240×1260 (scaled). Symptom. A tooltip window stays on screen at full opacity after the pointer has left. Sometimes it sits in the middle of the screen, far from the menu bar item it belongs to. Hovering or clicking that menu bar item clears it. I've seen it with seven apps: Syncthing, DriveDx and Private Internet Access (menu bar items), and Google Chrome, Chrome Beta, Opera and iTerm2 (tooltips inside their windows). What I measured (polling CGWindowListCopyWindowInfo, plus sample): The stuck window belongs to the app's own process, at window layer 103, alpha 1.0. The app is idle while it's stuck: its main thread is in mach_msg2_trap in 85–100% of samples. In the Chrome and Opera samples the tooltip is handled by NSToolTipManager (displayToolTip:, mouseEnteredToolTip:inWindow:pointInWindow:, fadeToolTip:). Every tooltip is drawn 19–20 pt below where the pointer was when it was shown, so a mid-screen tooltip was shown while the pointer was there. Syncthing (open source) only sets statusItem.button.toolTip, on the main thread, when its status changes. It has no tracking areas or mouse handling of its own. Reproducible part (Syncthing's menu bar item): Have its tooltip stuck. This happens on its own from time to time. I can't trigger it on demand. Leave the pointer anywhere away from the menu bar and change a file in a synced folder, so that Syncthing updates its status and sets a new toolTip. Result: the stuck tooltip window (same window number) moves to 19–20 pt below the current pointer position and stays there. It happened twice in a row, 25 seconds apart, at two different pointer positions. Control: with nothing stuck, 9 such changes (some local, some synced in from another machine) showed no tooltip anywhere. Expected: a tooltip is only shown while the pointer is over its view, and a toolTip change while the pointer is elsewhere shows nothing. So setting toolTip doesn't show a tooltip on its own, it only moves one that is already stuck. I don't know what leaves it stuck in the first place. Possibly related: FB23329983 (status item buttons not getting hover events on macOS 27 betas, reported fixed in beta 5), from this thread. Screenshots of sample tooltips attached.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
7
Boosts
2
Views
980
Activity
19h
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
155
Activity
1d
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
544
Activity
1d
didUpdateEffectiveGeometry reports outer display frame when app is send to background while using the inner display.
On iPhone Duo, when the app goes into background while being used on the inner display, windowScene(_:didUpdateEffectiveGeometry:) is called with a frame matching the geometry of the outer display.  When the app returns to the foreground, the callback fires again with the inner display geometry. We reload our layouts based on this callback so the transient frame cause a visible relayout when returning to the app. This also reproduces when building with Xcode 27.3 beta and on OS version 27.2.0. Snippet: func windowScene(_ windowScene: UIWindowScene, didUpdateEffectiveGeometry previousEffectiveGeometry: UIWindowScene.Geometry) { log("didUpdateEffectiveGeometry", windowScene) } func sceneDidEnterBackground(_ scene: UIScene) { log("sceneDidEnterBackground", scene) } func sceneWillEnterForeground(_ scene: UIScene) { log("sceneWillEnterForeground", scene) } private func log(_ event: String, _ scene: UIScene) { guard let windowScene = scene as? UIWindowScene else { return } let state = windowScene.activationState == .background ? "background" : "foreground" let size = windowScene.effectiveGeometry.coordinateSpace.bounds.size print("\(event) | state: \(state) | size: \(Int(size.width)) x \(Int(size.height))") }Logs: sceneDidEnterBackground | state: background | size: 951 x 669 didUpdateEffectiveGeometry | state: background | size: 466 x 678 <- outer display size, device NOT folded didUpdateEffectiveGeometry | state: background | size: 951 x 669 sceneWillEnterForeground | state: background | size: 951 x 669Is this the expected behaviour, or a known issue? If it’s expected, what’s the recommended way to distinguish the effective geometry change?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
24
Activity
1d
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
565
Activity
1d
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
192
Activity
1d
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
251
Activity
1d
SwiftUI custom focusable view cannot acquire focus programmatically on iPad with a hardware keyboard connected
On iPad, a SwiftUI view using .focusable(interactions: .edit) and .focused($isFocused) cannot acquire focus when a hardware keyboard is already connected. Setting isFocused = true from a button leaves it false. Tapping the view also leaves it unfocused, although the tap is received. Pressing Tab can focus the same view. struct FocusProbeView: View { @FocusState private var isFocused: Bool var body: some View { VStack { Text("Target") .focusable(interactions: .edit) .focused($isFocused) .onTapGesture { print("Target tapped") } Text("isFocused = \(isFocused)") Button("Focus target") { isFocused = true } } .defaultFocus($isFocused, true) } }Steps to reproduce: Run this view on an iPad with a hardware keyboard connected. Tap “Focus target”, then tap “Target”. Observe that isFocused remains false. Press Tab. The target can receive focus through keyboard navigation. Disconnect the keyboard. Restart the app and tap “Focus target” again. isFocused becomes true. Reconnecting the keyboard does not remove that focus. Expected: A visible custom view marked .focusable(interactions: .edit) can receive focus through @FocusState, including when a hardware keyboard is connected. Actual: Programmatic focus fails when the keyboard is already connected. A native TextField tested with the same button and @FocusState does receive focus. Environment: iPad model: MU1V2NF/A; iPadOS version: 26.7.2; Xcode version: 27.2; hardware keyboard: Logi Folio Touch. iPad model: Device Hub iPad Pro 11-inch (M5); iPadOS version: 27.2; Xcode version: 27.2; hardware keyboard: Device Hub.
Replies
1
Boosts
0
Views
225
Activity
1d
Various menu bar NSStatusItem issues with macOS 27
It seems like macOS 27 beta 2 has some issues with NSStatusItem buttons added to the menu bar - this creates difficulties for some menu bar extra apps. NSStatusItem buttons does not receive mouse hover/movement events - FB23329983 On macOS 27, views inside an NSStatusItem button no longer receive hover or mouse-movement events. The same code works correctly on macOS 26. What I tried: An NSTrackingArea attached to a subview of NSStatusBarButton An NSTrackingArea attached directly to the status-bar button Replacing NSStatusItem.view with a custom view Embedding an NSHostingView and using SwiftUI onHover/onContinuousHover NSStatusItem button highlight cannot be set programmatically. - FB23330269 The following code no longer has any effect (does not provide the highlight capsule): NSStatusItem.button?.highlight(true) NSStatusItem window occlusionState no longer reflects hidden menu bar visibility - FB23349447 The following no longer works: statusItem.button?.window?.occlusionState.contains(.visible) These changes may be related to some of the touch related changes or maybe it's about how menu items are now seemingly more "managed" in a way that their position, visibility may change in a way that is transparent/undetectable to the app.
Replies
9
Boosts
2
Views
1.8k
Activity
1d
Inversed swipe gesture in VStack/LazyVStack vs List
I'm using a row swipe to delete gesture in a LazyVStack just the same way I would do in a List and I have to inverse the gesture (from left to right) to allow the Delete button appearing whereas in a List, the left to right swipe gesture works as expected. The following code reveals that unexpected/anti natural behavior. iOS works as expected for the same code. import SwiftUI import Playgrounds struct ContentView: View { var body: some View { VStack { // anti-natural and inconsistent gesture // LazyVStack { // anti-natural and inconsistent gesture // List { // natural gesture HStack { Text("Swipe Test") Spacer() } .padding(10) .frame(height: 40) .background { Color.blue } .swipeActions(edge: .trailing, allowsFullSwipe: false) { Button("Delete", role: .destructive) {} } } } }Setup: Macbook Pro M1 Max / macOS 27.2.1 / Xcode 27.2
Replies
0
Boosts
0
Views
33
Activity
1d
iOS 27: FBSScene crashes in objc_release_x26 after a scene settings update
Feedback Assistant: FB25454822 On iOS 27, our app (com.netshort.abroad) crashes inside FrontBoardServices while releasing an object saved across a synchronous scene-update callout. The stack has only system frames. A build shipped in September 2025 (1.8.3) hits the same crash as soon as the device is updated to iOS 27, so this is not a recent app change. OS: iOS 27.0.0 (24A435), iOS 27.0.1 (24A446) On build 2.3.4: 1264 events, 1216 users 0 libobjc.A.dylib objc_release_x26 + 8 1 FrontBoardServices -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 780 2 FrontBoardServices _queue_updateScene…_block_invoke_2.cold.1 + 352 3 FrontBoardServices _queue_updateScene…_block_invoke_2 + 96 4 FrontBoardServices _calloutQueue_executeCalloutFromSource:withBlock: + 168 On 27.0.0 these frames show as <redacted> in Crashlytics. FrontBoardServices 0x19a88 is this method at 0x1977c plus 780, matching symbolicated 27.0.1 reports. In the 27.0.1 FrontBoardServices binary, +776 is objc_release(x26) and +780 is the return address. x26 is transitionContext.actions. The callout into UIKit is the bl at +0x2ac. The crash happens after that callout returns. 34 Apple crash reports with register state show the same pattern: the low byte of saved x26 is 0x01. 20 reports: objc_release_x26 + 8, x26 = 0x1 14 reports: objc_release_x26 + 16, x26 ends in 0x01 (for example 0x13c373a01) A nil actions value 0x0 becomes 0x1. A real pointer only has its low byte changed, so the isa read is off by one. In the +16 reports, x16 (0x8001000001fa8d89) is that isa shifted by one byte. This looks like a one-byte store of YES into the stack slot where x26 was saved across the callout. There is no single user action that reproduces it. It happens when the system delivers a scene settings update. The frame that wrote the byte is already gone, because the crash is recorded after the callout returns. Has anyone else seen this on iOS 27? I attached three .crash files with full register state to FB25454822.
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
1
Views
395
Activity
2d
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
0
Views
96
Activity
2d
Supported way to hide the system time in a full-screen watchOS clock app?
I'm building a standalone watchOS app (SwiftUI, watch-only) whose main screen is its own full-screen clock. The system time in the top-right corner duplicates our clock, so we'd like to hide it while this view is visible. I'd like to know which API is supported for this in an App Store app. What I tried (watchOS 27.2 SDK, Xcode 27.2): .persistentSystemOverlays(.hidden) on the root view and on the scene. The system time stays visible. In a variant with a NavigationStack and a hidden navigation bar, the time was briefly absent after launch, but it came back within about 20 seconds. .statusBarHidden(_:) and .toolbarVisibility(.hidden, for: .statusBar) are marked unavailable on watchOS in the SDK. View._statusBarHidden(_:) hides the system time reliably. In the watchOS SwiftUI interface it is public, available on watchOS since 6.0, and has no @_spi. It inlines to _statusBar(hidden:). However, it's underscored and I can't find documentation for it. Minimal example: struct ClockView: View { var body: some View { MyFullScreenClock() .persistentSystemOverlays(.hidden) // documented, but time remains visible ._statusBarHidden(true) // hides the time, but undocumented } }I've noticed this modifier in shipping open-source watchOS code, for example Home Assistant's watch app (Sources/WatchApp/Home/WatchHomeView.swift). That doesn't tell me whether Apple supports it, though. Questions: Is _statusBarHidden(_:) / _statusBar(hidden:) a supported API for a distributed watchOS app? If not, is there a documented way for a full-screen clock app to hide the system time, or is the system time intentionally always shown in third-party apps? I can share a small sample project that toggles between the documented overlay preference and the underscored modifier. Thanks!
Replies
2
Boosts
0
Views
81
Activity
2d