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

Button or onTapGesture grows its hit region by a fixed amount past the view’s bounds.
SwiftUI Button hit area extends ~16pt beyond its visual frame — expected OS behavior? Hi everyone, I’m working on a custom SwiftUI segmented control and noticed some unexpected hit-testing behavior with Button. I have a button structured roughly like this: Button { selectItem(at: index) } label: { ZStack { if selectedIndex == index { selectedBackground } SegmentCellView( tab: tab, isSelected: selectedIndex == index ) } .frame(maxWidth: .infinity) .contentShape(Rectangle()) } .accessibilityLabel(Text(tab.labelText)) The visual frame of the button has a certain height, but when testing on a real device, I can tap approximately 16pt outside the button's visible frame and the button still receives the tap. This seems to happen even though I explicitly use: .contentShape(Rectangle()) to define the tappable shape. My questions are: Is this ~16pt expansion of the interactive area expected SwiftUI/OS behavior? Is this related to Apple's minimum hit-target/accessibility guidelines being automatically applied to controls such as Button? If so, is there an official API/documentation describing this behavior? Is there a recommended way to make the Button's hit-testing area exactly match the bounds defined by .contentShape(Rectangle()), if that is actually possible? I'm particularly interested in understanding whether this is intentional system behavior or something caused by the ButtonStyle / layout hierarchy. Thanks!
2
1
150
1w
CPU spike when using RealityView in iOS
CPU spikes to over 100% and stays in that range when realityView (even without content) is added to an iOS view in SwiftUI. On device, it takes approximately 20 seconds before you see this behavior. How are developers getting around this in iOS apps? Is it getting past app review? Xcode 27.2, iOS27.2.1
0
0
81
1w
UIKIt, iOS 27, UIDocumentPickerViewController(forExporting: [fileURL])
My App saves files using the UIDocumentPickerViewController. This works from iOS 17 to 26. Usually, you have a file with a given name in your sandbox, which you can then export via the pickerVC. In the pickerVC you change the name. In iOS 27 the file name is greyed-out and you can't change it here. The file can be exported only with the pre-given name. Is this a new behaviour or bug in iOS 27?
Topic: UI Frameworks SubTopic: UIKit
2
0
170
1w
Can a complication/widget render a continuously animated custom graphic (watchOS)?
Can a complication/widget render a continuously animated custom graphic (watchOS)? I design abstract, number-free clock faces (see rhei.watch for examples — canvas-based, continuously animated) and I’m exploring whether something similar could work on Apple Watch. Since watchOS doesn’t allow fully custom third-party watch faces, I’m trying to understand what’s actually possible within the current constraints: Can a complication or widget render a continuously animated, custom canvas-style graphic — not just static icons/text/SF Symbols — similar to what’s possible with iOS lock screen widgets? Is there any path today for a third-party app to offer a watch-face-like experience, even without literally replacing the system face (e.g. via Smart Stack, a full-screen complication, Live Activities on watchOS, or something else I’m not aware of)? Any pointers to the right documentation, sample code, or past discussions would be really helpful before I invest time in building this. Thanks! Thomas
0
0
68
1w
Adapting a large UIKit/Objective-C document viewer controller for iPhone Duo on the iOS 27.1 SDK
We ship a mature document viewer (PDF) written mostly in Objective-C with UIKit. It runs on iPhone and iPad and supports multiple scenes. We're planning support for iPhone Duo and would like advice on the right architectural approach before we start. Current structure (simplified) One root viewer view controller (a UIViewController subclass, large and long-lived) owns the document view, search, bookmarks, text-to-speech, presentation mode and similar features. Most of these live in categories and helper modules. Chrome is swapped by size class. A factory picks one of two "toolbars controller" classes based on the trait collection: one for compact, one for regular. The regular one also hosts a tab strip and a sidebar built on the system sidebar UI. When the class it would pick changes, traitCollectionDidChange: tears down the current chrome controller, builds the other one, re-parents the document view into the new container, and then restores tool and presentation state. We skip this while the app isn't active, because UIKit sends trait changes during backgrounding. Geometry changes go through viewWillTransitionToSize:withTransitionCoordinator:, which forwards to the chrome controller, the document view and a zoomed handwriting helper. When the transition completes we recompute content insets and re-render the output for an external display. The document view is a custom scroll-based view (not PDFKit). It has display modes for continuous, single page, two-page spread and two-page spread with a cover page. It calculates its own insets from safe areas and whatever chrome is visible. We still use traitCollectionDidChange: and haven't moved to registerForTraitChanges:. Questions Posture changes and size-class flips. When the device folds or unfolds, should we expect a normal viewWillTransitionToSize: plus a trait change (compact ↔ regular) that our existing swap handles? Or is there a posture/display-configuration signal we should observe instead? Swapping the whole chrome hierarchy in the middle of a fold animation seems costly. Is there a recommended way to defer or coordinate that with the transition coordinator? Hinge or seam area. Is the fold region exposed through safe-area insets, layout guides or a new API? A custom scroll view that lays out two-page spreads needs to keep content out of that region, or line the spread up with it. What's the recommended way to get this geometry from Objective-C? Two-page spread tied to posture. Showing a two-page spread automatically when the device is unfolded (like an open book) seems natural. Does Apple recommend deciding this from traits/posture or from bounds, and is there a trait we can override per view controller? Trait registration. For this form factor, is it effectively required to move from traitCollectionDidChange: to registerForTraitChanges: (for example to get notified about new traits), or will the legacy callback still fire reliably? Scenes and external displays. Does iPhone Duo change anything about scene activation, window geometry or UIScreen handling that a multi-scene app with external-display output should plan for? Incremental adoption. Can we adopt this step by step in Objective-C, or do some of the APIs only exist in Swift and push us toward Swift wrappers? Any pointers to WWDC sessions, sample code or documentation for adapting existing UIKit apps would be very helpful. Thanks!
Topic: UI Frameworks SubTopic: UIKit
4
1
380
1w
How to implement correct horizontal padding for iPhone Duo
The iPhone Duo outer screen displays a vertical bar on the right edge with view contents inset. A SwiftUI Form displays an appropriate amount of leading padding but 0 padding on the trailing edge, since the vertical bar provides some visual margins already that looks nice. I have a view that looks kind of like a form, multiple stacked text fields, that should align the same way. I used scenePadding to achieve which looks correct on iPhone 18 Pro perfectly aligned with Form, but on iPhone Duo there is extra trailing padding. It doesn't align with my Edit button that remains in the horizontal axis navigation bar (and it is not inset enough on the leading edge, off by a few pixels, interestingly). Note when you unfold it and add the app on the left side in Split View, the vertical bar is on the leading edge, in which case there's too much padding on the leading edge. How can I achieve the correct layout padding/margins? iPhone 18 Pro vs iPhone Duo: My actual app: struct ContentView: View { var body: some View { TabView { NavigationStack { SystemFormView() .navigationTitle("System Form") } .tabItem { Label("System Form", systemImage: "list.bullet.rectangle") } NavigationStack { CustomFormView() .navigationTitle("Custom Form") } .tabItem { Label("Custom Form", systemImage: "rectangle.3.group") } } } } private struct SystemFormView: View { var body: some View { Form { Text("Row 1") Text("Row 2") Text("Row 3") } } } private struct CustomFormView: View { var body: some View { ScrollView { VStack(spacing: 0) { customRow("Row 1") Divider() .padding(.leading) customRow("Row 2") Divider() .padding(.leading) customRow("Row 3") } .background(.background) .scenePadding(.horizontal) } .background(Color(uiColor: .systemGroupedBackground)) } private func customRow(_ title: LocalizedStringKey) -> some View { Text(title) .frame(maxWidth: .infinity, minHeight: 44, alignment: .leading) .padding(.horizontal) } } Note in UIKit, UITableViewController with the inset grouped style has the same layout as Form. A custom view hierarchy can achieve the exact same placement/padding/margins by following these steps: create a scroll view and a content view, set preservesSuperviewLayoutMargins = true on both views, constrain the scroll view to the root view on all edges, constrain the content view to the scrollView.contentLayoutGuide on all edges, constrain the content view width anchor to the scrollView.frameLayoutGuide.widthAnchor, then constrain subviews of the content view to the contentView.layoutMarginsGuide. So I know how to do it in UIKit, how do we in SwiftUI? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
7
1
818
1w
UISceneDelegate.sceneWillResignActive and sceneDidEnterBackground not called on iOS 27
In our UIKit app built with Xcode 27.2 / iOS 27 SDK, the foreground-to-background UISceneDelegate methods are not called when the app enters background. The matching UIApplication notifications are still posted. Environment: Device: iPhone 13 OS: iOS 27.2 Xcode: 27.2 (27B52) UIApplicationSupportsMultipleScenes: false SceneDelegate configured in Info.plist Observed: Launch: scene:willConnectToSession:options: sceneWillEnterForeground: sceneDidBecomeActive: Press Home / switch app / lock screen: (sceneWillResignActive: NOT called) (sceneDidEnterBackground: NOT called) Return to app: sceneWillEnterForeground: sceneDidBecomeActive: Evidence from file logging: [2026-11-12 11:28:05.502] sceneWillEnterForeground [2026-11-12 11:28:05.729] sceneDidBecomeActive [2026-11-12 13:25:45.077] sceneWillEnterForeground [2026-11-12 13:25:45.517] sceneDidBecomeActive No sceneWillResignActive or sceneDidEnterBackground entries. However, UIApplicationWillResignActiveNotification and UIApplicationDidEnterBackgroundNotification are delivered correctly. Expected: sceneWillResignActive: and sceneDidEnterBackground: should be called when leaving foreground. Workaround: We currently fall back to UIApplication notifications.
Topic: UI Frameworks SubTopic: UIKit
1
0
73
1w
cannot add handler to 0 from 0 - dropping
import SwiftUI struct ContentView: View { var body: some View { NavigationStack { VStack { Text("Hello, world!") } .padding() } } } This simple program gives the messages: non-launching port is incompatible with service identifier "com.apple.PointerUI.pointeruid.default-service" cannot add handler to 0 from 0 - dropping cannot add handler to 0 from 0 - dropping I'm teston on IPad (A16) ver 27.2.1 and xcode 27.2
Topic: UI Frameworks SubTopic: SwiftUI
0
2
72
1w
iPadOS 27.0.1: iPhone-only apps crash when displaying the Japanese Kana keyboard on iPad
We are seeing a crash when attempting to display the Japanese Kana keyboard (日本語-かな) in our iPhone-only app running on an iPad with iPadOS 27.0.1. The keyboard displays successfully in our app on iPadOS 26 and iPadOS 27.0. We also reproduced a similar crash in other iPhone-only apps downloaded from the App Store on the affected iPad. We have not yet confirmed whether those apps crash with the same exception. Our app logs the following exception: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM insertObject:atIndex:]: index 15 beyond bounds [0 .. 2]' *** First throw call stack: ( 0x19fab7190 0x19f834380 0x19fa45734 0x1aee9f5bc 0x1aee3dc14 0x1aee3cb30 0x1aee3c4d4 0x1aee3ab0c 0x1a433798c 0x1a44a4120 0x1a449bd5c 0x1a42148c8 0x1a42143fc 0x1a4239d7c 0x1a421203c 0x1a3fc1338 0x1a3d12e0c 0x1a3d11ed0 0x1a52784ec 0x1a3d11abc 0x1a4115238 0x1a3d436d4 0x1a3d43a80 0x1a44eea14 0x1aabb8ef8 0x1a517161c 0x1a5152450 0x1a5153388 0x1a41f20c4 0x1a49e3fec 0x1a426598c 0x1a42657fc 0x1a4265580 0x1a3d62b30 0x1a3d62984 0x1a95c4dac 0x1a994fb68 0x1a95c5514 0x1a95c287c 0x1a95d2608 0x1a3d6841c 0x1a3d6a298 0x1a4263874 0x1a3d60bdc 0x1a3ce8d78 0x1a3ce7b88 0x1a3ce7928 0x2d1482bc0 0x19fa78c20 0x19fa78b94 0x19fa5a268 0x19fa59384 0x19fa5a7f4 0x249e6ff24 0x1a3d381cc 0x1a9d27404 0x1a9d20b50 0x1a9d20a10 0x109042dc4 0x109042e04 0x19f8ab5b8 ) libc++abi: terminating due to uncaught exception of type NSException Steps to reproduce: Enable the Japanese – Kana keyboard in the iPad’s keyboard settings. Open an affected iPhone-only app on an iPad running iPadOS 27.0.1. Tap a text input field and attempt to display the Japanese Kana keyboard. The app crashes. We suspect this may be a regression involving iPhone compatibility mode on iPad and the Japanese Kana keyboard, but we have not yet identified the failing component in a symbolicated stack trace. We have submitted a report through Feedback Assistant: FB24985530. Has anyone else encountered this behavior? Are there any known workarounds we can apply in the app while this is being investigated?
Topic: UI Frameworks SubTopic: UIKit Tags:
8
7
2.0k
1w
macOS 27.2: external monitor on a USB-C to HDMI adapter flickers, shows as "12 inch Display" at 1280x720, all resolutions refused (empty EDID)
Since I updated from macOS 27.0.1 to 27.2 (26B123), my second monitor stopped working on a Mac mini M4 Pro. It is a Dell SE2726HG on a USB-C to HDMI adapter. My LG on the built-in HDMI port still works. Symptoms: The Dell flickers. It disconnects and reconnects about once per second. System Settings shows it as "Display", 12 inch, 1280x720 at 50 Hz. Every resolution change is refused, also for the other monitor. A restart, a replug, or a lower refresh rate on the other monitor does not help. What the logs show: macOS cannot read the monitor's EDID through the adapter. IOAVServiceCopyEDID returns 0xe00002c9 (internal error), and the framebuffer has an all-zero EDID. Without an EDID, the kernel gives the display no display pipe: "AED: validate_or_set_ex: fb 2 rejecting request, exceeds full dual-pipe allocation (w 1280 vs 0 ...)" and "skipping display with null info". In 47 minutes, the log had 379 hotplug "out" events. Workaround (no extra hardware, no paid app): I injected a normal 1920x1080 EDID at runtime with the private IOKit call IOAVServiceSetVirtualEDIDMode(service, 1, edid), then IODPDeviceSetUpdated(device, 1). The monitor then comes up with its correct name at 1920x1080, with zero disconnects. The override is lost on reboot, sleep, or replug, so a LaunchAgent re-applies it every 5 seconds when the EDID read fails. This is the same approach as these projects: https://gist.github.com/danii1/99fa5f849a4d42807418259abfbf03d5 https://github.com/owomocha/macos-360hz-unlock BetterDisplay Pro can also apply a custom EDID.
Topic: UI Frameworks SubTopic: General
3
2
445
1w
iPhone Duo: Keep app on inner display while hinge is open (like Clock)?
Hi! I'm building a night-light app for iPhone Duo. When the device is partly open in tent mode, the lamp starts on the inner display. As soon as I set the phone down on a table, the system moves my window to the outer display, even though the hinge stays open. Apple's Clock app stays on the inner display in the same pose, so it seems possible at the system level. Steps Open iPhone Duo to ~80° (tent). Launch the app on the inner display. Set the device down on a table. Observed (logged from the app) UIHinge.status stays .partiallyOpen (~80°), not .closed. UIDevice.orientation goes portraitUpsideDown → faceDown → landscapeRight. UIScreen.didDisconnectNotification fires and UIScreen.screens drops the inner screen. The window moves to the outer screen (466×678). What I've tried Restricting UISupportedInterfaceOrientations to portrait only Turning on Rotation Lock Reading UIHingeInteraction (read-only, no effect on display routing) Looking at UISceneAccessory.cameraCapture, which only applies with an active capture session and a fully open device Question Is there a supported way for a scene to prefer or stay on the inner display while the hinge isn't closed? If not, I'll file a Feedback Assistant request. iPhone Duo · iOS 27.2 · Xcode 27.2
1
0
71
1w
Is NavigationSplitView on macOS 27 broken?
On macOS 27 Beta 2, a simple NavigationSplitView example exhibits bizarre behaviour when the window is resized. The sidebar seemingly expands and collapses at random as the window is resized. The symptoms can be exacerbated with toolbar items. The sidebar appears to behave correctly when an inspector view is not present. Copy paste the code below into a new Xcode 27 project and run on macOS 27 and then resize the window: File -> New -> Project... -> App import SwiftUI @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { var body: some View { NavigationSplitView { Text("Sidebar") } detail: { Text("Content") } .inspector(isPresented: .constant(true)) { Text("Inspector") } } } Adding .frame or .inspectorColumnWidth to any of the Text views does not appear to fix the issues. macOS: 27.0 Beta (26A5368g) Xcode: 27.0 beta 2 (27A5209h)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
6
1
771
1w
Tab grayed out, but not disabled
Bug report: FB25495244 This bug also appeared with Xcode 27; it worked previously. scenario: A TabView with, for example, 4 tabs. Data in ContentView is loaded via @Query. In ContentBindingView, the same thing is done, but using a parameter instead of SwiftData. ContentView: If no data is available, the system automatically switches to tab 4 at the start; while you can click on other tabs, they are disabled, and the system will not switch to them. ContentBindingView: When tabDisabled is set to "true", the system automatically switches to Tab 4 upon startup; while it is possible to click on other tabs, they are disabled, and the system will not switch to them. So far, so good. The first three tabs are only active if at least one data record exists or tabDisabled is "false". Tab 4 is always active and is used for data entry. When data is entered in Tab 4, tab 1 to 3 should become active. However, it appears as though tabs 1 through 3 remain disabled—the icons appear grayed out. That is actually not the case; you can click on the tabs, and as soon as you move away from a tab, its icon is displayed correctly. This issue did not exist in Xcode 26. In Xcode 26, all symbols were displayed correctly from the start, once data had been saved. What I noticed on the iPhone Duo: If you open the program on an iPhone Duo while it is closed, enter some data, then move the app to the background, open the iPhone Duo, and bring the application back to the foreground, tabs 1 through 3 will be active. The entire view is being updated, which is why tabs 1 through 3 are now active—though they should have been active already. A side note: The same issue described in the forum post "A layout bug when using Tab View in SwiftUI (FB25490881)" also occurs in this program. The entire view has shifted upward. The text field is no longer visible—only the Add button remains. In the other views, you can only see half of the text. import SwiftUI struct ContentBindingView: View { @State private var tabDisabled: Bool = true @State private var selection: TabSelection = .tab1 private var isTabDisabled: Bool { print("ContentView.isTabDisabled: \(tabDisabled)") return tabDisabled } var body: some View { TabView(selection: $selection) { Tab("Tab 1", systemImage: "waveform.badge.magnifyingglass", value: .tab1) { Text("tab 1") } .disabled(isTabDisabled) Tab("Tab 2", systemImage: "heart", value: .tab2) { Text("tab 2") } .disabled(tabDisabled) Tab("Tab 3", systemImage: "target", value: .tab3) { Text("tab 3") } .disabled(tabDisabled) Tab("Tab 4", systemImage: "gear", value: .tab4) { AddFriendBindingView(tabDisabled: $tabDisabled) } } .onAppear { print("ContentView onAppear disabled: \(tabDisabled)") if tabDisabled { selection = .tab4 } } .onChange(of: selection) { print("ContentView onChange disabled: \(tabDisabled)") } } }struct AddFriendBindingView: View { @Environment(\.dismiss) private var disdmiss @Binding var tabDisabled: Bool @State private var name: String = "" var body: some View { VStack { TextField("Name", text: $name) Button { addFriend() } label: { Text("Add") } .buttonStyle(.borderedProminent) } .padding() .onAppear { print("AddFriendView onAppear disabled: \(tabDisabled)") } } private func addFriend() { tabDisabled = false name = "" disdmiss() } }Christian
2
0
300
1w
Age Range Functionality in MacOS 27.2 no handle?
I have a running implementation for an iOS Application which is using AgeRange. It was running very well on Mac OS below 27 and was getting the results. It is still working on iOS 27.2 but now in MacOS 27.2 with the same code base I'm getting an } catch AgeRangeService.Error.notAvailable { NSLog("[AgeRangeDeclaration] Handle not available error")Is there a change for MacOS 27 which has to be implemented or do I have to configure something else?
Topic: UI Frameworks SubTopic: General
1
0
126
1w
Request to remove horizontal blank space for keyboard extensions on iPhone Duo.
I have a custom iOS keyboard extension app. On iPhone Duo, the system forces keyboard extensions inside a container that is narrower than the phone's screen, specifically by adding extra 7 points on the leading and trailing edge in portrait. This creates both a visual and functional blank space on both sides of the keyboard. My keyboard relies on side swipes, which are much more annoying to perform when the keyboard does not occupy full width of the screen. All other devices iPhones before the Duo propely stretch the keyboard to full width, so this is a new issue. Please, reconsider this decision. I believe a better way to handle this is by setting the safe area layout, instead of limiting the container's width itself. I don't see any benefit to protecting these 7 points on each side. Keyboards that don't care will still stay within the limit by respecting the horizontal safe area, while others would get the benefit of better customization.
0
0
112
1w
iPadOS 27.2 — Software keyboard fails to appear in Swift Playgrounds apps (regression compared with iPadOS 26.2)
The on-screen software keyboard does not appear when editing SwiftUI TextField controls in applications created and executed using Swift Playgrounds on iPadOS 27.2. The issue is reproducible in a completely new, minimal Swift Playgrounds application, independently of any existing application code. Steps to reproduce 1. Open Swift Playgrounds on an iPad running iPadOS 27.2. 2. Create a new blank SwiftUI application. 3. Add a standard TextField bound to a @State String. 4. Run the application using Play. 5. Tap the TextField with a finger. Actual result The TextField displays the insertion cursor and responds to touch interactions, but the software keyboard never appears. Long-pressing the TextField displays the Paste / AutoFill context menu. Handwriting input using Apple Pencil Pro works, but the software keyboard remains unavailable. Disabling Scribble in iPadOS settings does not resolve the problem. The software keyboard works normally in Apple Notes on the same iPad. This issue prevents normal text entry and testing in an actively developed payroll management application built entirely with Swift Playgrounds. The problem also occurs in a completely new sample application, indicating that it is not specific to the payroll application’s code. Request Please investigate this apparent regression affecting software keyboard presentation in Swift Playgrounds on iPadOS 27.2. A fix or an official workaround would be greatly appreciated.
0
1
181
1w
Battery usage timeline graph shows incorrect time labels in macOS 27
Description: The time scale values on the battery usage curve in macOS 27 are displayed incorrectly. The screenshot timestamp is 14:39:11, October 20. Under the "Last 24 Hours" tab for Battery Level and Screen On Time charts, the timeline shows usage extending past 21:00 on October 20. This timestamp does not match the actual current time. It appears the timeline axis failed to shift correctly as time progresses. For comparison: a reference screenshot captured on macOS 26 at 09:30, August 8. Its battery usage timeline rendered correctly. The bottom time span covered August 7 to August 8, which is the expected and proper display behavior. This bug only exists in macOS 27’s battery usage chart. The older macOS 26 implementation works correctly. Device: MacBook Air M5 macOS version: macOS 27.2 RC
Topic: UI Frameworks SubTopic: SwiftUI
1
0
305
1w
Button or onTapGesture grows its hit region by a fixed amount past the view’s bounds.
SwiftUI Button hit area extends ~16pt beyond its visual frame — expected OS behavior? Hi everyone, I’m working on a custom SwiftUI segmented control and noticed some unexpected hit-testing behavior with Button. I have a button structured roughly like this: Button { selectItem(at: index) } label: { ZStack { if selectedIndex == index { selectedBackground } SegmentCellView( tab: tab, isSelected: selectedIndex == index ) } .frame(maxWidth: .infinity) .contentShape(Rectangle()) } .accessibilityLabel(Text(tab.labelText)) The visual frame of the button has a certain height, but when testing on a real device, I can tap approximately 16pt outside the button's visible frame and the button still receives the tap. This seems to happen even though I explicitly use: .contentShape(Rectangle()) to define the tappable shape. My questions are: Is this ~16pt expansion of the interactive area expected SwiftUI/OS behavior? Is this related to Apple's minimum hit-target/accessibility guidelines being automatically applied to controls such as Button? If so, is there an official API/documentation describing this behavior? Is there a recommended way to make the Button's hit-testing area exactly match the bounds defined by .contentShape(Rectangle()), if that is actually possible? I'm particularly interested in understanding whether this is intentional system behavior or something caused by the ButtonStyle / layout hierarchy. Thanks!
Replies
2
Boosts
1
Views
150
Activity
1w
CPU spike when using RealityView in iOS
CPU spikes to over 100% and stays in that range when realityView (even without content) is added to an iOS view in SwiftUI. On device, it takes approximately 20 seconds before you see this behavior. How are developers getting around this in iOS apps? Is it getting past app review? Xcode 27.2, iOS27.2.1
Replies
0
Boosts
0
Views
81
Activity
1w
UIKIt, iOS 27, UIDocumentPickerViewController(forExporting: [fileURL])
My App saves files using the UIDocumentPickerViewController. This works from iOS 17 to 26. Usually, you have a file with a given name in your sandbox, which you can then export via the pickerVC. In the pickerVC you change the name. In iOS 27 the file name is greyed-out and you can't change it here. The file can be exported only with the pre-given name. Is this a new behaviour or bug in iOS 27?
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
0
Views
170
Activity
1w
Can a complication/widget render a continuously animated custom graphic (watchOS)?
Can a complication/widget render a continuously animated custom graphic (watchOS)? I design abstract, number-free clock faces (see rhei.watch for examples — canvas-based, continuously animated) and I’m exploring whether something similar could work on Apple Watch. Since watchOS doesn’t allow fully custom third-party watch faces, I’m trying to understand what’s actually possible within the current constraints: Can a complication or widget render a continuously animated, custom canvas-style graphic — not just static icons/text/SF Symbols — similar to what’s possible with iOS lock screen widgets? Is there any path today for a third-party app to offer a watch-face-like experience, even without literally replacing the system face (e.g. via Smart Stack, a full-screen complication, Live Activities on watchOS, or something else I’m not aware of)? Any pointers to the right documentation, sample code, or past discussions would be really helpful before I invest time in building this. Thanks! Thomas
Replies
0
Boosts
0
Views
68
Activity
1w
Adapting a large UIKit/Objective-C document viewer controller for iPhone Duo on the iOS 27.1 SDK
We ship a mature document viewer (PDF) written mostly in Objective-C with UIKit. It runs on iPhone and iPad and supports multiple scenes. We're planning support for iPhone Duo and would like advice on the right architectural approach before we start. Current structure (simplified) One root viewer view controller (a UIViewController subclass, large and long-lived) owns the document view, search, bookmarks, text-to-speech, presentation mode and similar features. Most of these live in categories and helper modules. Chrome is swapped by size class. A factory picks one of two "toolbars controller" classes based on the trait collection: one for compact, one for regular. The regular one also hosts a tab strip and a sidebar built on the system sidebar UI. When the class it would pick changes, traitCollectionDidChange: tears down the current chrome controller, builds the other one, re-parents the document view into the new container, and then restores tool and presentation state. We skip this while the app isn't active, because UIKit sends trait changes during backgrounding. Geometry changes go through viewWillTransitionToSize:withTransitionCoordinator:, which forwards to the chrome controller, the document view and a zoomed handwriting helper. When the transition completes we recompute content insets and re-render the output for an external display. The document view is a custom scroll-based view (not PDFKit). It has display modes for continuous, single page, two-page spread and two-page spread with a cover page. It calculates its own insets from safe areas and whatever chrome is visible. We still use traitCollectionDidChange: and haven't moved to registerForTraitChanges:. Questions Posture changes and size-class flips. When the device folds or unfolds, should we expect a normal viewWillTransitionToSize: plus a trait change (compact ↔ regular) that our existing swap handles? Or is there a posture/display-configuration signal we should observe instead? Swapping the whole chrome hierarchy in the middle of a fold animation seems costly. Is there a recommended way to defer or coordinate that with the transition coordinator? Hinge or seam area. Is the fold region exposed through safe-area insets, layout guides or a new API? A custom scroll view that lays out two-page spreads needs to keep content out of that region, or line the spread up with it. What's the recommended way to get this geometry from Objective-C? Two-page spread tied to posture. Showing a two-page spread automatically when the device is unfolded (like an open book) seems natural. Does Apple recommend deciding this from traits/posture or from bounds, and is there a trait we can override per view controller? Trait registration. For this form factor, is it effectively required to move from traitCollectionDidChange: to registerForTraitChanges: (for example to get notified about new traits), or will the legacy callback still fire reliably? Scenes and external displays. Does iPhone Duo change anything about scene activation, window geometry or UIScreen handling that a multi-scene app with external-display output should plan for? Incremental adoption. Can we adopt this step by step in Objective-C, or do some of the APIs only exist in Swift and push us toward Swift wrappers? Any pointers to WWDC sessions, sample code or documentation for adapting existing UIKit apps would be very helpful. Thanks!
Topic: UI Frameworks SubTopic: UIKit
Replies
4
Boosts
1
Views
380
Activity
1w
How to implement correct horizontal padding for iPhone Duo
The iPhone Duo outer screen displays a vertical bar on the right edge with view contents inset. A SwiftUI Form displays an appropriate amount of leading padding but 0 padding on the trailing edge, since the vertical bar provides some visual margins already that looks nice. I have a view that looks kind of like a form, multiple stacked text fields, that should align the same way. I used scenePadding to achieve which looks correct on iPhone 18 Pro perfectly aligned with Form, but on iPhone Duo there is extra trailing padding. It doesn't align with my Edit button that remains in the horizontal axis navigation bar (and it is not inset enough on the leading edge, off by a few pixels, interestingly). Note when you unfold it and add the app on the left side in Split View, the vertical bar is on the leading edge, in which case there's too much padding on the leading edge. How can I achieve the correct layout padding/margins? iPhone 18 Pro vs iPhone Duo: My actual app: struct ContentView: View { var body: some View { TabView { NavigationStack { SystemFormView() .navigationTitle("System Form") } .tabItem { Label("System Form", systemImage: "list.bullet.rectangle") } NavigationStack { CustomFormView() .navigationTitle("Custom Form") } .tabItem { Label("Custom Form", systemImage: "rectangle.3.group") } } } } private struct SystemFormView: View { var body: some View { Form { Text("Row 1") Text("Row 2") Text("Row 3") } } } private struct CustomFormView: View { var body: some View { ScrollView { VStack(spacing: 0) { customRow("Row 1") Divider() .padding(.leading) customRow("Row 2") Divider() .padding(.leading) customRow("Row 3") } .background(.background) .scenePadding(.horizontal) } .background(Color(uiColor: .systemGroupedBackground)) } private func customRow(_ title: LocalizedStringKey) -> some View { Text(title) .frame(maxWidth: .infinity, minHeight: 44, alignment: .leading) .padding(.horizontal) } } Note in UIKit, UITableViewController with the inset grouped style has the same layout as Form. A custom view hierarchy can achieve the exact same placement/padding/margins by following these steps: create a scroll view and a content view, set preservesSuperviewLayoutMargins = true on both views, constrain the scroll view to the root view on all edges, constrain the content view to the scrollView.contentLayoutGuide on all edges, constrain the content view width anchor to the scrollView.frameLayoutGuide.widthAnchor, then constrain subviews of the content view to the contentView.layoutMarginsGuide. So I know how to do it in UIKit, how do we in SwiftUI? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
7
Boosts
1
Views
818
Activity
1w
UISceneDelegate.sceneWillResignActive and sceneDidEnterBackground not called on iOS 27
In our UIKit app built with Xcode 27.2 / iOS 27 SDK, the foreground-to-background UISceneDelegate methods are not called when the app enters background. The matching UIApplication notifications are still posted. Environment: Device: iPhone 13 OS: iOS 27.2 Xcode: 27.2 (27B52) UIApplicationSupportsMultipleScenes: false SceneDelegate configured in Info.plist Observed: Launch: scene:willConnectToSession:options: sceneWillEnterForeground: sceneDidBecomeActive: Press Home / switch app / lock screen: (sceneWillResignActive: NOT called) (sceneDidEnterBackground: NOT called) Return to app: sceneWillEnterForeground: sceneDidBecomeActive: Evidence from file logging: [2026-11-12 11:28:05.502] sceneWillEnterForeground [2026-11-12 11:28:05.729] sceneDidBecomeActive [2026-11-12 13:25:45.077] sceneWillEnterForeground [2026-11-12 13:25:45.517] sceneDidBecomeActive No sceneWillResignActive or sceneDidEnterBackground entries. However, UIApplicationWillResignActiveNotification and UIApplicationDidEnterBackgroundNotification are delivered correctly. Expected: sceneWillResignActive: and sceneDidEnterBackground: should be called when leaving foreground. Workaround: We currently fall back to UIApplication notifications.
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
73
Activity
1w
cannot add handler to 0 from 0 - dropping
import SwiftUI struct ContentView: View { var body: some View { NavigationStack { VStack { Text("Hello, world!") } .padding() } } } This simple program gives the messages: non-launching port is incompatible with service identifier "com.apple.PointerUI.pointeruid.default-service" cannot add handler to 0 from 0 - dropping cannot add handler to 0 from 0 - dropping I'm teston on IPad (A16) ver 27.2.1 and xcode 27.2
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
2
Views
72
Activity
1w
iPadOS 27.0.1: iPhone-only apps crash when displaying the Japanese Kana keyboard on iPad
We are seeing a crash when attempting to display the Japanese Kana keyboard (日本語-かな) in our iPhone-only app running on an iPad with iPadOS 27.0.1. The keyboard displays successfully in our app on iPadOS 26 and iPadOS 27.0. We also reproduced a similar crash in other iPhone-only apps downloaded from the App Store on the affected iPad. We have not yet confirmed whether those apps crash with the same exception. Our app logs the following exception: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM insertObject:atIndex:]: index 15 beyond bounds [0 .. 2]' *** First throw call stack: ( 0x19fab7190 0x19f834380 0x19fa45734 0x1aee9f5bc 0x1aee3dc14 0x1aee3cb30 0x1aee3c4d4 0x1aee3ab0c 0x1a433798c 0x1a44a4120 0x1a449bd5c 0x1a42148c8 0x1a42143fc 0x1a4239d7c 0x1a421203c 0x1a3fc1338 0x1a3d12e0c 0x1a3d11ed0 0x1a52784ec 0x1a3d11abc 0x1a4115238 0x1a3d436d4 0x1a3d43a80 0x1a44eea14 0x1aabb8ef8 0x1a517161c 0x1a5152450 0x1a5153388 0x1a41f20c4 0x1a49e3fec 0x1a426598c 0x1a42657fc 0x1a4265580 0x1a3d62b30 0x1a3d62984 0x1a95c4dac 0x1a994fb68 0x1a95c5514 0x1a95c287c 0x1a95d2608 0x1a3d6841c 0x1a3d6a298 0x1a4263874 0x1a3d60bdc 0x1a3ce8d78 0x1a3ce7b88 0x1a3ce7928 0x2d1482bc0 0x19fa78c20 0x19fa78b94 0x19fa5a268 0x19fa59384 0x19fa5a7f4 0x249e6ff24 0x1a3d381cc 0x1a9d27404 0x1a9d20b50 0x1a9d20a10 0x109042dc4 0x109042e04 0x19f8ab5b8 ) libc++abi: terminating due to uncaught exception of type NSException Steps to reproduce: Enable the Japanese – Kana keyboard in the iPad’s keyboard settings. Open an affected iPhone-only app on an iPad running iPadOS 27.0.1. Tap a text input field and attempt to display the Japanese Kana keyboard. The app crashes. We suspect this may be a regression involving iPhone compatibility mode on iPad and the Japanese Kana keyboard, but we have not yet identified the failing component in a symbolicated stack trace. We have submitted a report through Feedback Assistant: FB24985530. Has anyone else encountered this behavior? Are there any known workarounds we can apply in the app while this is being investigated?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
8
Boosts
7
Views
2.0k
Activity
1w
macOS 27.2: external monitor on a USB-C to HDMI adapter flickers, shows as "12 inch Display" at 1280x720, all resolutions refused (empty EDID)
Since I updated from macOS 27.0.1 to 27.2 (26B123), my second monitor stopped working on a Mac mini M4 Pro. It is a Dell SE2726HG on a USB-C to HDMI adapter. My LG on the built-in HDMI port still works. Symptoms: The Dell flickers. It disconnects and reconnects about once per second. System Settings shows it as "Display", 12 inch, 1280x720 at 50 Hz. Every resolution change is refused, also for the other monitor. A restart, a replug, or a lower refresh rate on the other monitor does not help. What the logs show: macOS cannot read the monitor's EDID through the adapter. IOAVServiceCopyEDID returns 0xe00002c9 (internal error), and the framebuffer has an all-zero EDID. Without an EDID, the kernel gives the display no display pipe: "AED: validate_or_set_ex: fb 2 rejecting request, exceeds full dual-pipe allocation (w 1280 vs 0 ...)" and "skipping display with null info". In 47 minutes, the log had 379 hotplug "out" events. Workaround (no extra hardware, no paid app): I injected a normal 1920x1080 EDID at runtime with the private IOKit call IOAVServiceSetVirtualEDIDMode(service, 1, edid), then IODPDeviceSetUpdated(device, 1). The monitor then comes up with its correct name at 1920x1080, with zero disconnects. The override is lost on reboot, sleep, or replug, so a LaunchAgent re-applies it every 5 seconds when the EDID read fails. This is the same approach as these projects: https://gist.github.com/danii1/99fa5f849a4d42807418259abfbf03d5 https://github.com/owomocha/macos-360hz-unlock BetterDisplay Pro can also apply a custom EDID.
Topic: UI Frameworks SubTopic: General
Replies
3
Boosts
2
Views
445
Activity
1w
iPhone Duo: Keep app on inner display while hinge is open (like Clock)?
Hi! I'm building a night-light app for iPhone Duo. When the device is partly open in tent mode, the lamp starts on the inner display. As soon as I set the phone down on a table, the system moves my window to the outer display, even though the hinge stays open. Apple's Clock app stays on the inner display in the same pose, so it seems possible at the system level. Steps Open iPhone Duo to ~80° (tent). Launch the app on the inner display. Set the device down on a table. Observed (logged from the app) UIHinge.status stays .partiallyOpen (~80°), not .closed. UIDevice.orientation goes portraitUpsideDown → faceDown → landscapeRight. UIScreen.didDisconnectNotification fires and UIScreen.screens drops the inner screen. The window moves to the outer screen (466×678). What I've tried Restricting UISupportedInterfaceOrientations to portrait only Turning on Rotation Lock Reading UIHingeInteraction (read-only, no effect on display routing) Looking at UISceneAccessory.cameraCapture, which only applies with an active capture session and a fully open device Question Is there a supported way for a scene to prefer or stay on the inner display while the hinge isn't closed? If not, I'll file a Feedback Assistant request. iPhone Duo · iOS 27.2 · Xcode 27.2
Replies
1
Boosts
0
Views
71
Activity
1w
Is NavigationSplitView on macOS 27 broken?
On macOS 27 Beta 2, a simple NavigationSplitView example exhibits bizarre behaviour when the window is resized. The sidebar seemingly expands and collapses at random as the window is resized. The symptoms can be exacerbated with toolbar items. The sidebar appears to behave correctly when an inspector view is not present. Copy paste the code below into a new Xcode 27 project and run on macOS 27 and then resize the window: File -> New -> Project... -> App import SwiftUI @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { var body: some View { NavigationSplitView { Text("Sidebar") } detail: { Text("Content") } .inspector(isPresented: .constant(true)) { Text("Inspector") } } } Adding .frame or .inspectorColumnWidth to any of the Text views does not appear to fix the issues. macOS: 27.0 Beta (26A5368g) Xcode: 27.0 beta 2 (27A5209h)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
6
Boosts
1
Views
771
Activity
1w
Tab grayed out, but not disabled
Bug report: FB25495244 This bug also appeared with Xcode 27; it worked previously. scenario: A TabView with, for example, 4 tabs. Data in ContentView is loaded via @Query. In ContentBindingView, the same thing is done, but using a parameter instead of SwiftData. ContentView: If no data is available, the system automatically switches to tab 4 at the start; while you can click on other tabs, they are disabled, and the system will not switch to them. ContentBindingView: When tabDisabled is set to "true", the system automatically switches to Tab 4 upon startup; while it is possible to click on other tabs, they are disabled, and the system will not switch to them. So far, so good. The first three tabs are only active if at least one data record exists or tabDisabled is "false". Tab 4 is always active and is used for data entry. When data is entered in Tab 4, tab 1 to 3 should become active. However, it appears as though tabs 1 through 3 remain disabled—the icons appear grayed out. That is actually not the case; you can click on the tabs, and as soon as you move away from a tab, its icon is displayed correctly. This issue did not exist in Xcode 26. In Xcode 26, all symbols were displayed correctly from the start, once data had been saved. What I noticed on the iPhone Duo: If you open the program on an iPhone Duo while it is closed, enter some data, then move the app to the background, open the iPhone Duo, and bring the application back to the foreground, tabs 1 through 3 will be active. The entire view is being updated, which is why tabs 1 through 3 are now active—though they should have been active already. A side note: The same issue described in the forum post "A layout bug when using Tab View in SwiftUI (FB25490881)" also occurs in this program. The entire view has shifted upward. The text field is no longer visible—only the Add button remains. In the other views, you can only see half of the text. import SwiftUI struct ContentBindingView: View { @State private var tabDisabled: Bool = true @State private var selection: TabSelection = .tab1 private var isTabDisabled: Bool { print("ContentView.isTabDisabled: \(tabDisabled)") return tabDisabled } var body: some View { TabView(selection: $selection) { Tab("Tab 1", systemImage: "waveform.badge.magnifyingglass", value: .tab1) { Text("tab 1") } .disabled(isTabDisabled) Tab("Tab 2", systemImage: "heart", value: .tab2) { Text("tab 2") } .disabled(tabDisabled) Tab("Tab 3", systemImage: "target", value: .tab3) { Text("tab 3") } .disabled(tabDisabled) Tab("Tab 4", systemImage: "gear", value: .tab4) { AddFriendBindingView(tabDisabled: $tabDisabled) } } .onAppear { print("ContentView onAppear disabled: \(tabDisabled)") if tabDisabled { selection = .tab4 } } .onChange(of: selection) { print("ContentView onChange disabled: \(tabDisabled)") } } }struct AddFriendBindingView: View { @Environment(\.dismiss) private var disdmiss @Binding var tabDisabled: Bool @State private var name: String = "" var body: some View { VStack { TextField("Name", text: $name) Button { addFriend() } label: { Text("Add") } .buttonStyle(.borderedProminent) } .padding() .onAppear { print("AddFriendView onAppear disabled: \(tabDisabled)") } } private func addFriend() { tabDisabled = false name = "" disdmiss() } }Christian
Replies
2
Boosts
0
Views
300
Activity
1w
Age Range Functionality in MacOS 27.2 no handle?
I have a running implementation for an iOS Application which is using AgeRange. It was running very well on Mac OS below 27 and was getting the results. It is still working on iOS 27.2 but now in MacOS 27.2 with the same code base I'm getting an } catch AgeRangeService.Error.notAvailable { NSLog("[AgeRangeDeclaration] Handle not available error")Is there a change for MacOS 27 which has to be implemented or do I have to configure something else?
Topic: UI Frameworks SubTopic: General
Replies
1
Boosts
0
Views
126
Activity
1w
Request to remove horizontal blank space for keyboard extensions on iPhone Duo.
I have a custom iOS keyboard extension app. On iPhone Duo, the system forces keyboard extensions inside a container that is narrower than the phone's screen, specifically by adding extra 7 points on the leading and trailing edge in portrait. This creates both a visual and functional blank space on both sides of the keyboard. My keyboard relies on side swipes, which are much more annoying to perform when the keyboard does not occupy full width of the screen. All other devices iPhones before the Duo propely stretch the keyboard to full width, so this is a new issue. Please, reconsider this decision. I believe a better way to handle this is by setting the safe area layout, instead of limiting the container's width itself. I don't see any benefit to protecting these 7 points on each side. Keyboards that don't care will still stay within the limit by respecting the horizontal safe area, while others would get the benefit of better customization.
Replies
0
Boosts
0
Views
112
Activity
1w
iPadOS 27.2 — Software keyboard fails to appear in Swift Playgrounds apps (regression compared with iPadOS 26.2)
The on-screen software keyboard does not appear when editing SwiftUI TextField controls in applications created and executed using Swift Playgrounds on iPadOS 27.2. The issue is reproducible in a completely new, minimal Swift Playgrounds application, independently of any existing application code. Steps to reproduce 1. Open Swift Playgrounds on an iPad running iPadOS 27.2. 2. Create a new blank SwiftUI application. 3. Add a standard TextField bound to a @State String. 4. Run the application using Play. 5. Tap the TextField with a finger. Actual result The TextField displays the insertion cursor and responds to touch interactions, but the software keyboard never appears. Long-pressing the TextField displays the Paste / AutoFill context menu. Handwriting input using Apple Pencil Pro works, but the software keyboard remains unavailable. Disabling Scribble in iPadOS settings does not resolve the problem. The software keyboard works normally in Apple Notes on the same iPad. This issue prevents normal text entry and testing in an actively developed payroll management application built entirely with Swift Playgrounds. The problem also occurs in a completely new sample application, indicating that it is not specific to the payroll application’s code. Request Please investigate this apparent regression affecting software keyboard presentation in Swift Playgrounds on iPadOS 27.2. A fix or an official workaround would be greatly appreciated.
Replies
0
Boosts
1
Views
181
Activity
1w
is NSTextInputClient safe?
is NSTextInputClient safe? I have several apps that has autofill (app name) activity due to NSTextInputClient. I am wondering if my app has this activity will it be submittable to the app store?
Replies
2
Boosts
0
Views
357
Activity
1w
Battery usage timeline graph shows incorrect time labels in macOS 27
Description: The time scale values on the battery usage curve in macOS 27 are displayed incorrectly. The screenshot timestamp is 14:39:11, October 20. Under the "Last 24 Hours" tab for Battery Level and Screen On Time charts, the timeline shows usage extending past 21:00 on October 20. This timestamp does not match the actual current time. It appears the timeline axis failed to shift correctly as time progresses. For comparison: a reference screenshot captured on macOS 26 at 09:30, August 8. Its battery usage timeline rendered correctly. The bottom time span covered August 7 to August 8, which is the expected and proper display behavior. This bug only exists in macOS 27’s battery usage chart. The older macOS 26 implementation works correctly. Device: MacBook Air M5 macOS version: macOS 27.2 RC
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
305
Activity
1w