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

'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
Hi, Overview: I get the following error when trying to save / read from SwiftData It happens when I try to save color to SwiftData (code below) Error 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release Questions How can I resolve the error? I am not directly using data, I am using just Float values, swift types. Why am I getting this error? Is there a way to add a breakpoint to stop at the exact type causing the error? (Symbolic breakpoint doesn't seem to help) Or is the below code ok and not responsible for the error? Code import SwiftUI nonisolated struct ColorRepresentation: Codable { let red: Float let green: Float let blue: Float let opacity: Float init(colorResolved: Color.Resolved) { red = colorResolved.red green = colorResolved.green blue = colorResolved.blue opacity = colorResolved.opacity } func color() throws -> Color { Color( red: Double(red), green: Double(green), blue: Double(blue), opacity: Double(opacity) ) } } extension ColorRepresentation: Equatable {}
4
0
60
36m
SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
FB: FB22577211 The following trivial SwiftUI Text rendering causes wrong text layout and truncated text. The text should take the required height to render the text without truncation. Adding fixedSize does also not solve this. This bug only happens on devices and not on the simulator. Confirmed with iPhone 15 and iOS 26.4.1 but my colleague used another iPhone so it’s multiple iPhone devices. import SwiftUI let txt = """ Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition. """ struct ContentView: View { var body: some View { VStack { Text(txt) } .padding(.leading, 20) .padding(.trailing, 20) .frame(maxWidth: .infinity) } } This is also enough: Text(txt) .padding(.horizontal, 20) .fixedSize(horizontal: false, vertical: true) Expected: Text is rendered without truncation / ellipsis. Actual: Text is rendered with too small height / missing one line so it’s truncated / with ellipsis.
4
0
204
5h
Under what conditions can a LocalizedStringResource be serialised?
I had a need to store a localised string in a shared file used by other applications, and noticed that LocalizedStringResource conforms to Codable -- and indeed, if I encode a string from App A, then switch to App B, B is able to read the value and load different localisations of that string out of App A's bundle. Very cool. This isn't clearly documented (the documentation for LocalizedStringResource just mentions cross-process use, not generally longer-term storage), so I wondered if there are any caveats to be aware of when using this approach? I am aware that LocalizedStringResource is just a reference, so obviously if App A is deleted, it becomes a kind of dangling reference and will presumably fall back to its default value (which is included in the encoded representation). But I also noticed that the encoded LSR includes a sandbox extension token. Is there anything in particular to be aware of with that? Is it time-limited? One thing I did notice, that is quite annoying (potentially a bug) is that if I serialise and deserialise a record containing a LSR, it no longer compares as == to its previous self. That is because the original LSR did not contain a sandbox extension token, but as part of encoding it, that field seems to get populated. I'm not sure if there is a good workaround there; perhaps the extension token could be ignored from ==? That would result in extension tokens being dropped (e.g. if you had two LSRs in a Dictionary, differing only by the sandbox token, they would still be considered substitutable and already "in" the dictionary), but perhaps that's fine.
1
0
45
5h
NSTextView.shouldDrawInsertionPoint doesn't work with TextKit 2
The following code only ever causes shouldDrawInsertionPoint to be printed (no drawInsertionPoint), but even if that method returns false, the blinking insertion point is still drawn. On the other hand, with TextKit 1 it works as expected. Is there a way to hide the default insertion point in TextKit 2? My app draws its own. I've filed FB13684251. class TextView: NSTextView { override var shouldDrawInsertionPoint: Bool { print("shouldDrawInsertionPoint") return false } override func drawInsertionPoint(in rect: NSRect, color: NSColor, turnedOn flag: Bool) { print("drawInsertionPoint", flag) } } ``
Topic: UI Frameworks SubTopic: AppKit Tags:
10
0
261
10h
Keyboard focus lost after instantiating an AUv3 in a host on iOS
Dear Apple Support team, I'm reaching out about an issue we're facing in our iOS audio host app on iPad. Keyboard shortcuts from an external hardware keyboard (Bluetooth) work perfectly until we load an AUv3 plugin, then the host suddenly loses all keyboard focus, and key commands stop responding completely. To give you more context: this affects every DAW that supports AUv3. I've tested it in Logic Pro for iOS, Camelot Pro, and AUM. The problem starts right after instantiating any AUv3, causing the keyboard to lose focus and preventing key commands from working. Before that, keyboard events reach our UIView without issues. Notably, this doesn't happen on iOS versions before iOS 26. I've verified it works perfectly on iOS 17 and iOS 18. You can see the full discussion and steps to reproduce in this JUCE forum thread: https://forum.juce.com/t/keyboard-focus-lost-and-keycommands-stop-working-after-instantiating-an-auv3-in-a-juce-based-host-on-ios/68497/5. It seems potentially related to AUv3 sandboxing or iOS UIView focus management. I would really appreciate your help with any insights, known issues, or workarounds. Thanks, Samuele
Topic: UI Frameworks SubTopic: UIKit
2
0
288
10h
TimePicker numeric pad popover renders as a narrow bar on iPadOS 26.4.1
When tapping the currently selected time in a TimePicker (wheel style) component to invoke the inline numeric pad popover, the popover renders incorrectly on iPadOS 26.4.1 — it appears as a very narrow single-line/bar rather than the full numeric keypad layout. Steps to Reproduce: Run Reminder, create a new reminder and add a custom time Tap the currently selected time value to trigger the numeric pad popover Observe the popover layout Expected Result: A properly sized popover appears containing a full numeric keypad, allowing direct numeric input of the time value — consistent with behavior on iPadOS 18.x Actual Result: The popover appears as an extremely narrow horizontal bar (single line height), making the numeric pad unusable Regression: Works correctly on iPadOS 18.x through iPadOS 26.3. Broken on iPadOS 26.4.1 (Xcode 26.x simulator and/or physical device). https://www.youtube.com/shorts/bd3pYA3B-iI https://www.youtube.com/shorts/wSHzepHBwEY Feedback: FB22517457
Topic: UI Frameworks SubTopic: UIKit
2
1
283
1d
Can contextMenu respect onLongPressGesture of a child element?
Hi, I have a list cell with a play button and a text label. When tapping the play button, it plays an audio, and when long-pressed, it plays the audio slowly. The long press works as per the example code below, but once a contextMenu is added, the long-press gesture of the play button is ignored (even though it's a small element in the cell), and the context menu is presented instead. Is there a way to allow for the context menu long-press to respect the long-press gesture of a child element in the cell on which it's defined? I also tried with highPriorityGesture but to no effect. Example code: HStack { Button { print("Play") } label: { Image(systemName: "play.circle") .onLongPressGesture(minimumDuration: 0.5) { print("Play slowly") } } Text("Audio cell") .frame(maxWidth: .infinity, alignment: .leading) } .contextMenu { Button("Hello") { print("hello") } Button("Goodbye") { print("goodbye") } }
0
0
68
1d
[iOS 26] iOS App Does Not Receive Deep Link from Widget When Using widgetAccentedRenderingMode on Image
Summary When a SwiftUI widget uses a Link containing an Image modified with .widgetAccentedRenderingMode (using any mode except .fullColor), tapping the image on the widget launches the app but does not pass the expected deep link URL to the SceneDelegate. Steps to Reproduce Create a SwiftUI Widget View with a Link: struct ImageView: View { var image: UIImage var body: some View { Link(URL(string: "myapp://image")!) { Image(uiImage: image) .resizable() .widgetAccentedRenderingMode(.accentedDesaturated) // or any mode other than .fullColor .scaledToFill() .clipped() } } } Add Custom URL Scheme in Info.plist: <dict> <key>CFBundleURLName</key> <string>com.company.myapp</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> Implement Deep Link Handling in SceneDelegate: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if let url = connectionOptions.urlContexts.first?.url { handle(url) } } func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) { if let url = urlContexts.first?.url { handle(url) } } private func handle(_ url: URL) { // Process URL here } Run the application on a device or simulator. Add the widget to the Home Screen. Tap the image inside the widget. Expected Result The application launches and receives the URL in SceneDelegate, as expected. Actual Result The application launches, but the URL is not passed to SceneDelegate. Both connectionOptions.urlContexts and openURLContexts are empty.
3
1
505
2d
.buttonStyle(.glass) background changes abruptly between 50pt and 51pt in dark mode
[Submitted as FB22612121] A SwiftUI Button using .buttonStyle(.glass) with .buttonBorderShape(.capsule) changes its background abruptly when its size goes from 50×50 to 51×51 points in dark mode. This appears to be a threshold in opacity/material rather than a smooth size-based change. The sample shows identical buttons at 40, 50, 51, and 60 points, with a clear jump between 50 and 51. Measured RGB values shift from 19,19,19 to 30,30,30. The effect also varies with the background, which points to a material/opacity change rather than a fixed fill. ENVIRONMENT iOS 26.4.1 (23E254a) iOS 26.5 (23F5059e) REPRO STEPS Create a new iOS SwiftUI project. Replace ContentView with the sample code below. Run the app or open ContentView in SwiftUI Preview (dark mode). Observe the buttons at 40×40, 50×50, 51×51, and 60×60. Compare the 50pt and 51pt buttons. ACTUAL The background changes abruptly between 50pt and 51pt. The 51pt button uses a noticeably different opacity/material, producing a visible jump in dark mode. EXPECTED The glass background should remain visually consistent or change smoothly as size changes by 1 point. 50pt and 51pt buttons should not have a discontinuous difference. SCREENSHOT SAMPLE CODE struct ContentView: View { private let sizes: [CGFloat] = [40, 50, 51, 60] var body: some View { ScrollView { VStack(alignment: .leading, spacing: 16) { Text("Glass button dark-mode size jump") .font(.headline) Text("All buttons use .buttonStyle(.glass). Only the label frame changes.") .font(.footnote) .foregroundStyle(.secondary) ForEach(Array(sizes.enumerated()), id: \.offset) { index, size in HStack(spacing: 14) { Button { } label: { Text("\(index + 1)") .font(.system(size: size * 0.42, weight: .medium)) .frame(width: size, height: size) } .buttonStyle(.glass) .buttonBorderShape(.capsule) Text("label frame: \(Int(size)) x \(Int(size))") .font(.callout.monospacedDigit()) .foregroundStyle(.secondary) } } } .padding(24) } .preferredColorScheme(.dark) } }
Topic: UI Frameworks SubTopic: SwiftUI
0
0
129
2d
PSA: UISceneDelegate.openURLContexts called twice sometimes in iOS 26
If you use UISceneDelegate's scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) to handle deep links (such as tapping a widget) you might run into an issue where this callback is called twice in the majority of cases. If you push a view controller in response to this, you might end up with two pushed view controllers, if you do not mitigate this. This is exclusively an issue in iOS 26.0 and works as expected on iOS 18. func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { /// Add any widget to the home screen that uses the widgetURL modifier and tap them. Most of the time, openURLContexts() will get called twice. /// If you run this project on iOS 18, it's *always* called once as expected. print("openURLContexts \(URLContexts)") } Filed as FB20301454
4
2
476
2d
How to add Paste button in UIMenu such that the system "allow app to paste" prompt does not appear
Apps that try to access the contents of the pasteboard cause a system prompt to appear asking the user "AppName" would like to paste from "OtherAppName" Do you want to allow this? Don't Allow Paste Allow Paste This prompt does not appear if you implement a UIPasteControl and the user taps it to signal intent to paste, but this control cannot be placed into a UIMenu. I read this could be achieved with UIAction.Identifiers like .paste or .newFromPasteboard but the prompt still appears with the following code. What's the trick? override func viewDidLoad() { super.viewDidLoad() title = "TestPaste" view.backgroundColor = .systemBackground let imageView = UIImageView() imageView.translatesAutoresizingMaskIntoConstraints = false imageView.contentMode = .scaleAspectFit imageView.clipsToBounds = true view.addSubview(imageView) NSLayoutConstraint.activate([ imageView.topAnchor.constraint(equalTo: view.topAnchor), imageView.leadingAnchor.constraint(equalTo: view.leadingAnchor), imageView.trailingAnchor.constraint(equalTo: view.trailingAnchor), imageView.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Add", image: UIImage(systemName: "plus"), menu: UIMenu(children: [ UIAction(identifier: .paste) { _ in imageView.image = UIPasteboard.general.image } ])) }
2
0
196
3d
iPadOS 26 - Status bar overlaps with navigation bar
Hello, I'm experiencing a navigation bar positioning issue with my UIKit iPad app on iPadOS 26 (23A340) using Xcode 26 (17A321). The navigation bar positions under the status bar initially, and after orientation changes to landscape, it positions incorrectly below its expected location. This occurs on both real device (iPad mini A17 Pro) and simulator. My app uses UIKit + Storyboard with a Root Navigation Controller. A stack overflow post has reproduce the bug event if it's not in the same configuration: https://stackoverflow.com/questions/79752945/xcode-26-beta-6-ipados-26-statusbar-overlaps-with-navigationbar-after-presen I have checked all safe areas and tried changing some constraints, but nothing works. Have you encountered this bug before, or do you need additional information to investigate this issue?
9
1
1.3k
3d
Invalid parameter not satisfying: parentEnvironment != nil
Since the beta releases of iPadOS 26 we have been having some crashes about Invalid parameter not satisfying: parentEnvironment != nil We got to contact a couple of users and we found out that the crash appears when entering a screen in a UINavigationController with the iPad device connected to a Magic Keyboard. If the device is not connected to the keyboard then nothing happens and everything works ok. From our end we haven't managed to reproduce the crash so I am pasting part of the stacktrace if it can be of any help. 3 UIKitCore 0x19dfd2e14 -[_UIFocusContainerGuideFallbackItemsContainer initWithParentEnvironment:childItems:] + 224 (_UIFocusContainerGuideFallbackItemsContainer.m:23) 4 UIKitCore 0x19dae3108 -[_UIFocusContainerGuideImpl _searchForFocusRegionsInContext:] + 368 (_UIFocusGuideImpl.m:246) 5 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 6 UIKitCore 0x19db28900 -[_UIFocusMapSnapshot addRegionsInContainers:] + 160 (_UIFocusMapSnapshot.m:545) 7 UIKitCore 0x19d1313dc _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 632 (_UIFocusRegion.m:143) 8 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 9 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 10 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 11 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 12 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 13 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 14 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 15 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 16 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 17 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 18 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 19 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 20 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 21 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 22 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 23 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 24 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 25 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 26 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 27 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 28 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 29 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 30 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 31 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 32 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 33 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 34 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 35 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 36 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 37 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 38 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 39 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 40 UIKitCore 0x19d132e08 -[_UIFocusMapSnapshot _capture] + 424 (_UIFocusMapSnapshot.m:403) 41 UIKitCore 0x19db2675c -[_UIFocusMapSnapshot _initWithSnapshotter:mapArea:searchArea:] + 476 (_UIFocusMapSnapshot.m:171) 42 UIKitCore 0x19d130dcc -[_UIFocusMapSnapshotter captureSnapshot] + 192 (_UIFocusMapSnapshotter.m:137) 43 UIKitCore 0x19db2045c -[_UIFocusMap _inferredDefaultFocusItemInEnvironment:] + 136 (_UIFocusMap.m:168) 44 UIKitCore 0x19daffd2c -[_UIFocusEnvironmentPreferenceEnumerationContext _inferPreferencesForEnvironment:] + 140 (_UIFocusEnvironmentPreferenceEnumerator.m:313) 45 UIKitCore 0x19d127ab4 -[_UIFocusEnvironmentPreferenceEnumerationContext _resolvePreferredFocusEnvironments] + 104 (_UIFocusEnvironmentPreferenceEnumerator.m:250) 46 UIKitCore 0x19d127394 -[_UIFocusEnvironmentPreferenceEnumerationContext preferredEnvironments] + 36 (_UIFocusEnvironmentPreferenceEnumerator.m:184) 47 UIKitCore 0x19d126e94 _enumeratePreferredFocusEnvironments + 400 (_UIFocusEnvironmentPreferenceEnumerator.m:503)
13
3
1k
3d
UIKit.ButtonBarButtonVisualProvider not key value coding-compliant for the key _titleButton
After updating to Xcode 26 my XCUITests are now failing as during execution exceptions are being raised and caught by my catch all breakpoint These exceptions are only raised during testing, and seem to be referencing some private internal property. It happens when trying to tap a button based off an accessibilityIdentifier e.g. accessibilityIdentifier = "tertiary-button" ... ... app.buttons["tertiary-button"].tap() The full error is: Thread 1: "[<UIKit.ButtonBarButtonVisualProvider 0x600003b4aa00> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _titleButton." Anyone found any workarounds or solutions? I need to get my tests running on the liquid glass UI
3
4
579
4d
The floating keyboard on iPad OS 26 is not displaying
On iPad OS 26, the custom keyboard works correctly with a full keyboard, but with a floating keyboard, there is only one line and the console displays a constraint error. Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x600002172c10 V:|-(10)-[TUIKeyboardContentView:0x1039c5410] (active, names: '|':TUIKeyplaneView:0x1039c3e20 )>", "<NSLayoutConstraint:0x600002172c60 V:[TUIKeyboardContentView:0x1039c5410]-(-11)-| (active, names: '|':TUIKeyplaneView:0x1039c3e20 )>", "<NSLayoutConstraint:0x6000021721c0 V:|-(0)-[TUIKeyplaneView:0x1039c3e20] (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardLayoutStar Prev...:0x105160e00 )>", "<NSLayoutConstraint:0x600002172210 V:[TUIKeyplaneView:0x1039c3e20]-(0)-| (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardLayoutStar Prev...:0x105160e00 )>", "<NSLayoutConstraint:0x6000021728a0 V:|-(0)-[UIKeyboardLayoutStar Prev...] (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardImpl:0x109905fa0 )>", "<NSLayoutConstraint:0x6000021728f0 V:[UIKeyboardLayoutStar Prev...]-(0)-| (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardImpl:0x109905fa0 )>", "<NSLayoutConstraint:0x600002177980 '_UITemporaryLayoutHeight' UIKeyboardImpl:0x109905fa0.height == 0 (active)>", "<NSLayoutConstraint:0x600002172df0 'TUIKeyplane.height' TUIKeyboardContentView:0x1039c5410.height == 217 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x600002172df0 'TUIKeyplane.height' TUIKeyboardContentView:0x1039c5410.height == 217 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. iPad OS 26 custom keyboard, full keyboard mode is working normally.
Topic: UI Frameworks SubTopic: UIKit
2
0
256
4d
How to Indicate Selected State for a Menu Toolbar Item (Filter) in SwiftUI?
hi, On my page’s toolbar, I have a toolbar item that is implemented as a menu. Its purpose is to filter the content displayed on the page, similar to the filtering feature in the Photos app. When a user selects a filter option, I want the toolbar item to appear highlighted to indicate the active state. I came across the following guidance in the Human Interface Guidelines: Provide a selected-state version of an interface icon only if necessary. You don’t need to provide selected and unselected appearances for an icon that’s used in standard system components such as toolbars, tab bars, and buttons. The system updates the visual appearance of the selected state automatically. An image of two toolbar buttons that share a background. The left button shows the Filter icon in a selected state, using a blue tint color for its background. The right button shows the More icon in an unselected state, using the default appearance for toolbar buttons. In a toolbar, a selected icon receives the app’s accent color. However, I’m not sure how to actually implement or control the selected state for my toolbar item. Here is a snippet of my code: ToolbarItem(placement: .topBarTrailing) { Menu { Section { LayoutPickerView(layoutOption: $layoutOption) } Section { SortPickerView(sortOption: $viewModel.sortOption) } Section { Menu { Toggle( isOn: Binding( get: { viewModel.filterPlatforms.isEmpty }, set: { if $0 { viewModel.filterPlatforms.removeAll() } } ) ) { HStack { Image(systemName: "square.grid.3x3") .resizable() .scaledToFit() .frame(width: 30, height: 30) Text(Localized.Content.filterAllPlatforms) } } .menuActionDismissBehavior(.disabled) Divider() ForEach(viewModel.availablePlatforms(from: contents)) { platform in Toggle(isOn: viewModel.platformBinding(for: platform)) { HStack { CachedPlatformIconView(urlString: platform.iconUrl, size: 30) Text(platform.name) } } .menuActionDismissBehavior(.disabled) } } label: { Text(Localized.Content.filterMenu) Text(viewModel.filterPlatforms.map(\.name).joined(separator: String(localized: Localized.Content.separator))) } if !viewModel.filterPlatforms.isEmpty { Button { viewModel.filterPlatforms.removeAll() } label: { Text(Localized.Content.filterClear) } } } } label: { Image(systemName: "line.3.horizontal.decrease") } }
Topic: UI Frameworks SubTopic: SwiftUI
0
0
60
4d
How to detect if a binding is from a state or a constant?
Hi, I'm trying to create a custom TextField component where we can have our own custom FormatStyle as a param and then it will change the value binding according to the FormatStyle. It worked with State<Any?> like for example $textValue. But when I use .constant(2000) for instance, the Formatting doesn't work. So is there any way to detect whether the value param is constant or not? Thank you.
0
0
46
4d
popoverTips don't display for toolbar menu buttons in iOS 26.1
[Also submitted as FB20756013] A popoverTip does not display for toolbar menu buttons in iOS 26.1 (23B5073a). The same code displays tips correctly in iOS 18.6. The issue occurs both in the simulator and on a physical device. Repro Steps Build and run the Sample Code below on iOS 26.1. Observe that the popoverTip does not display. Repeat on iOS 18.6 to confirm expected behavior. Expected popoverTips should appear when attached to a toolbar menu button, as they do in iOS 18.6. Actual No tip is displayed on iOS 26.1. System Info macOS 15.7.1 (24G231) Xcode 26.1 beta 3 (17B5045g) iOS 26.1 (23B5073a) Screenshot Screenshot showing two simulators side by side—iOS 18.6 on the left (tip displayed) and iOS 26.1 on the right (no tip displayed). Sample code import SwiftUI import TipKit struct PopoverTip: Tip { var title: Text { Text("Menu Tip") } var message: Text? { Text("This tip displays on iOS 18.6, but NOT on iOS 26.1.") } } struct ContentView: View { var tip = PopoverTip() var body: some View { NavigationStack { Text("`popoverTip` doesn't display on iOS 26.1 but does in iOS 18.6") .padding() .toolbar { ToolbarItem(placement: .topBarTrailing) { Menu { Button("Dismiss", role: .cancel) { } Button("Do Nothing") { } } label: { Label("More", systemImage: "ellipsis") } .popoverTip(tip) } } .navigationTitle("Popover Tip Issue") .navigationBarTitleDisplayMode(.inline) } } }
4
3
496
4d
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta)
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta) Summary In iOS 26 beta, using .navigationTitle() inside a NavigationStack fails to render the title when combined with a .toolbar and a List. The title initially appears as expected after launch, but disappears after a second state transition triggered by a button press. This regression does not occur in iOS 18. Steps to Reproduce Use the SwiftUI code sample below (see viewmodel and Reload button for state transitions). Run the app on an iOS 26 simulator (e.g., iPhone 16). On launch, the view starts in .loading state (shows a ProgressView). After 1 second, it transitions to .loaded and displays the title correctly. Tap the Reload button — this sets the state back to .loading, then switches it to .loaded again after 1 second. ❌ After this second transition to .loaded, the navigation title disappears and does not return. Actual Behavior The navigation title displays correctly after the initial launch transition from .loading → .loaded. However, after tapping the “Reload” button and transitioning .loading → .loaded a second time, the title no longer appears. This suggests a SwiftUI rendering/layout invalidation issue during state-driven view diffing involving .toolbar and List. Expected Behavior The navigation title “Loaded Data” should appear and remain visible every time the view is in .loaded state. ✅ GitHub Gist including Screen Recording 👉 View Gist with full details Sample Code import SwiftUI struct ContentView: View { private let vm = viewmodel() var body: some View { NavigationStack { VStack { switch vm.state { case .loading: ProgressView("Loading...") case .loaded: List { ItemList() } Button("Reload") { vm.state = .loading DispatchQueue.main.asyncAfter(deadline: .now() + 1) { vm.state = .loaded } } .navigationTitle("Loaded Data") } } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Menu { Text("hello") } label: { Image(systemName: "gearshape.fill") } } } } } } struct ItemList: View { var body: some View { Text("Item 1") Text("Item 2") Text("Item 3") } } @MainActor @Observable class viewmodel { enum State { case loading case loaded } var state: State = .loading init() { DispatchQueue.main.asyncAfter(deadline: .now() + 1) { self.state = .loaded } } }
3
1
380
5d
'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
Hi, Overview: I get the following error when trying to save / read from SwiftData It happens when I try to save color to SwiftData (code below) Error 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release Questions How can I resolve the error? I am not directly using data, I am using just Float values, swift types. Why am I getting this error? Is there a way to add a breakpoint to stop at the exact type causing the error? (Symbolic breakpoint doesn't seem to help) Or is the below code ok and not responsible for the error? Code import SwiftUI nonisolated struct ColorRepresentation: Codable { let red: Float let green: Float let blue: Float let opacity: Float init(colorResolved: Color.Resolved) { red = colorResolved.red green = colorResolved.green blue = colorResolved.blue opacity = colorResolved.opacity } func color() throws -> Color { Color( red: Double(red), green: Double(green), blue: Double(blue), opacity: Double(opacity) ) } } extension ColorRepresentation: Equatable {}
Replies
4
Boosts
0
Views
60
Activity
36m
SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
FB: FB22577211 The following trivial SwiftUI Text rendering causes wrong text layout and truncated text. The text should take the required height to render the text without truncation. Adding fixedSize does also not solve this. This bug only happens on devices and not on the simulator. Confirmed with iPhone 15 and iOS 26.4.1 but my colleague used another iPhone so it’s multiple iPhone devices. import SwiftUI let txt = """ Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition. """ struct ContentView: View { var body: some View { VStack { Text(txt) } .padding(.leading, 20) .padding(.trailing, 20) .frame(maxWidth: .infinity) } } This is also enough: Text(txt) .padding(.horizontal, 20) .fixedSize(horizontal: false, vertical: true) Expected: Text is rendered without truncation / ellipsis. Actual: Text is rendered with too small height / missing one line so it’s truncated / with ellipsis.
Replies
4
Boosts
0
Views
204
Activity
5h
Under what conditions can a LocalizedStringResource be serialised?
I had a need to store a localised string in a shared file used by other applications, and noticed that LocalizedStringResource conforms to Codable -- and indeed, if I encode a string from App A, then switch to App B, B is able to read the value and load different localisations of that string out of App A's bundle. Very cool. This isn't clearly documented (the documentation for LocalizedStringResource just mentions cross-process use, not generally longer-term storage), so I wondered if there are any caveats to be aware of when using this approach? I am aware that LocalizedStringResource is just a reference, so obviously if App A is deleted, it becomes a kind of dangling reference and will presumably fall back to its default value (which is included in the encoded representation). But I also noticed that the encoded LSR includes a sandbox extension token. Is there anything in particular to be aware of with that? Is it time-limited? One thing I did notice, that is quite annoying (potentially a bug) is that if I serialise and deserialise a record containing a LSR, it no longer compares as == to its previous self. That is because the original LSR did not contain a sandbox extension token, but as part of encoding it, that field seems to get populated. I'm not sure if there is a good workaround there; perhaps the extension token could be ignored from ==? That would result in extension tokens being dropped (e.g. if you had two LSRs in a Dictionary, differing only by the sandbox token, they would still be considered substitutable and already "in" the dictionary), but perhaps that's fine.
Replies
1
Boosts
0
Views
45
Activity
5h
NSTextView.shouldDrawInsertionPoint doesn't work with TextKit 2
The following code only ever causes shouldDrawInsertionPoint to be printed (no drawInsertionPoint), but even if that method returns false, the blinking insertion point is still drawn. On the other hand, with TextKit 1 it works as expected. Is there a way to hide the default insertion point in TextKit 2? My app draws its own. I've filed FB13684251. class TextView: NSTextView { override var shouldDrawInsertionPoint: Bool { print("shouldDrawInsertionPoint") return false } override func drawInsertionPoint(in rect: NSRect, color: NSColor, turnedOn flag: Bool) { print("drawInsertionPoint", flag) } } ``
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
10
Boosts
0
Views
261
Activity
10h
Keyboard focus lost after instantiating an AUv3 in a host on iOS
Dear Apple Support team, I'm reaching out about an issue we're facing in our iOS audio host app on iPad. Keyboard shortcuts from an external hardware keyboard (Bluetooth) work perfectly until we load an AUv3 plugin, then the host suddenly loses all keyboard focus, and key commands stop responding completely. To give you more context: this affects every DAW that supports AUv3. I've tested it in Logic Pro for iOS, Camelot Pro, and AUM. The problem starts right after instantiating any AUv3, causing the keyboard to lose focus and preventing key commands from working. Before that, keyboard events reach our UIView without issues. Notably, this doesn't happen on iOS versions before iOS 26. I've verified it works perfectly on iOS 17 and iOS 18. You can see the full discussion and steps to reproduce in this JUCE forum thread: https://forum.juce.com/t/keyboard-focus-lost-and-keycommands-stop-working-after-instantiating-an-auv3-in-a-juce-based-host-on-ios/68497/5. It seems potentially related to AUv3 sandboxing or iOS UIView focus management. I would really appreciate your help with any insights, known issues, or workarounds. Thanks, Samuele
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
0
Views
288
Activity
10h
TimePicker numeric pad popover renders as a narrow bar on iPadOS 26.4.1
When tapping the currently selected time in a TimePicker (wheel style) component to invoke the inline numeric pad popover, the popover renders incorrectly on iPadOS 26.4.1 — it appears as a very narrow single-line/bar rather than the full numeric keypad layout. Steps to Reproduce: Run Reminder, create a new reminder and add a custom time Tap the currently selected time value to trigger the numeric pad popover Observe the popover layout Expected Result: A properly sized popover appears containing a full numeric keypad, allowing direct numeric input of the time value — consistent with behavior on iPadOS 18.x Actual Result: The popover appears as an extremely narrow horizontal bar (single line height), making the numeric pad unusable Regression: Works correctly on iPadOS 18.x through iPadOS 26.3. Broken on iPadOS 26.4.1 (Xcode 26.x simulator and/or physical device). https://www.youtube.com/shorts/bd3pYA3B-iI https://www.youtube.com/shorts/wSHzepHBwEY Feedback: FB22517457
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
1
Views
283
Activity
1d
Can contextMenu respect onLongPressGesture of a child element?
Hi, I have a list cell with a play button and a text label. When tapping the play button, it plays an audio, and when long-pressed, it plays the audio slowly. The long press works as per the example code below, but once a contextMenu is added, the long-press gesture of the play button is ignored (even though it's a small element in the cell), and the context menu is presented instead. Is there a way to allow for the context menu long-press to respect the long-press gesture of a child element in the cell on which it's defined? I also tried with highPriorityGesture but to no effect. Example code: HStack { Button { print("Play") } label: { Image(systemName: "play.circle") .onLongPressGesture(minimumDuration: 0.5) { print("Play slowly") } } Text("Audio cell") .frame(maxWidth: .infinity, alignment: .leading) } .contextMenu { Button("Hello") { print("hello") } Button("Goodbye") { print("goodbye") } }
Replies
0
Boosts
0
Views
68
Activity
1d
[iOS 26] iOS App Does Not Receive Deep Link from Widget When Using widgetAccentedRenderingMode on Image
Summary When a SwiftUI widget uses a Link containing an Image modified with .widgetAccentedRenderingMode (using any mode except .fullColor), tapping the image on the widget launches the app but does not pass the expected deep link URL to the SceneDelegate. Steps to Reproduce Create a SwiftUI Widget View with a Link: struct ImageView: View { var image: UIImage var body: some View { Link(URL(string: "myapp://image")!) { Image(uiImage: image) .resizable() .widgetAccentedRenderingMode(.accentedDesaturated) // or any mode other than .fullColor .scaledToFill() .clipped() } } } Add Custom URL Scheme in Info.plist: <dict> <key>CFBundleURLName</key> <string>com.company.myapp</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> Implement Deep Link Handling in SceneDelegate: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if let url = connectionOptions.urlContexts.first?.url { handle(url) } } func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) { if let url = urlContexts.first?.url { handle(url) } } private func handle(_ url: URL) { // Process URL here } Run the application on a device or simulator. Add the widget to the Home Screen. Tap the image inside the widget. Expected Result The application launches and receives the URL in SceneDelegate, as expected. Actual Result The application launches, but the URL is not passed to SceneDelegate. Both connectionOptions.urlContexts and openURLContexts are empty.
Replies
3
Boosts
1
Views
505
Activity
2d
.buttonStyle(.glass) background changes abruptly between 50pt and 51pt in dark mode
[Submitted as FB22612121] A SwiftUI Button using .buttonStyle(.glass) with .buttonBorderShape(.capsule) changes its background abruptly when its size goes from 50×50 to 51×51 points in dark mode. This appears to be a threshold in opacity/material rather than a smooth size-based change. The sample shows identical buttons at 40, 50, 51, and 60 points, with a clear jump between 50 and 51. Measured RGB values shift from 19,19,19 to 30,30,30. The effect also varies with the background, which points to a material/opacity change rather than a fixed fill. ENVIRONMENT iOS 26.4.1 (23E254a) iOS 26.5 (23F5059e) REPRO STEPS Create a new iOS SwiftUI project. Replace ContentView with the sample code below. Run the app or open ContentView in SwiftUI Preview (dark mode). Observe the buttons at 40×40, 50×50, 51×51, and 60×60. Compare the 50pt and 51pt buttons. ACTUAL The background changes abruptly between 50pt and 51pt. The 51pt button uses a noticeably different opacity/material, producing a visible jump in dark mode. EXPECTED The glass background should remain visually consistent or change smoothly as size changes by 1 point. 50pt and 51pt buttons should not have a discontinuous difference. SCREENSHOT SAMPLE CODE struct ContentView: View { private let sizes: [CGFloat] = [40, 50, 51, 60] var body: some View { ScrollView { VStack(alignment: .leading, spacing: 16) { Text("Glass button dark-mode size jump") .font(.headline) Text("All buttons use .buttonStyle(.glass). Only the label frame changes.") .font(.footnote) .foregroundStyle(.secondary) ForEach(Array(sizes.enumerated()), id: \.offset) { index, size in HStack(spacing: 14) { Button { } label: { Text("\(index + 1)") .font(.system(size: size * 0.42, weight: .medium)) .frame(width: size, height: size) } .buttonStyle(.glass) .buttonBorderShape(.capsule) Text("label frame: \(Int(size)) x \(Int(size))") .font(.callout.monospacedDigit()) .foregroundStyle(.secondary) } } } .padding(24) } .preferredColorScheme(.dark) } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
129
Activity
2d
PSA: UISceneDelegate.openURLContexts called twice sometimes in iOS 26
If you use UISceneDelegate's scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) to handle deep links (such as tapping a widget) you might run into an issue where this callback is called twice in the majority of cases. If you push a view controller in response to this, you might end up with two pushed view controllers, if you do not mitigate this. This is exclusively an issue in iOS 26.0 and works as expected on iOS 18. func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { /// Add any widget to the home screen that uses the widgetURL modifier and tap them. Most of the time, openURLContexts() will get called twice. /// If you run this project on iOS 18, it's *always* called once as expected. print("openURLContexts \(URLContexts)") } Filed as FB20301454
Replies
4
Boosts
2
Views
476
Activity
2d
How to add Paste button in UIMenu such that the system "allow app to paste" prompt does not appear
Apps that try to access the contents of the pasteboard cause a system prompt to appear asking the user "AppName" would like to paste from "OtherAppName" Do you want to allow this? Don't Allow Paste Allow Paste This prompt does not appear if you implement a UIPasteControl and the user taps it to signal intent to paste, but this control cannot be placed into a UIMenu. I read this could be achieved with UIAction.Identifiers like .paste or .newFromPasteboard but the prompt still appears with the following code. What's the trick? override func viewDidLoad() { super.viewDidLoad() title = "TestPaste" view.backgroundColor = .systemBackground let imageView = UIImageView() imageView.translatesAutoresizingMaskIntoConstraints = false imageView.contentMode = .scaleAspectFit imageView.clipsToBounds = true view.addSubview(imageView) NSLayoutConstraint.activate([ imageView.topAnchor.constraint(equalTo: view.topAnchor), imageView.leadingAnchor.constraint(equalTo: view.leadingAnchor), imageView.trailingAnchor.constraint(equalTo: view.trailingAnchor), imageView.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Add", image: UIImage(systemName: "plus"), menu: UIMenu(children: [ UIAction(identifier: .paste) { _ in imageView.image = UIPasteboard.general.image } ])) }
Replies
2
Boosts
0
Views
196
Activity
3d
iPadOS 26 - Status bar overlaps with navigation bar
Hello, I'm experiencing a navigation bar positioning issue with my UIKit iPad app on iPadOS 26 (23A340) using Xcode 26 (17A321). The navigation bar positions under the status bar initially, and after orientation changes to landscape, it positions incorrectly below its expected location. This occurs on both real device (iPad mini A17 Pro) and simulator. My app uses UIKit + Storyboard with a Root Navigation Controller. A stack overflow post has reproduce the bug event if it's not in the same configuration: https://stackoverflow.com/questions/79752945/xcode-26-beta-6-ipados-26-statusbar-overlaps-with-navigationbar-after-presen I have checked all safe areas and tried changing some constraints, but nothing works. Have you encountered this bug before, or do you need additional information to investigate this issue?
Replies
9
Boosts
1
Views
1.3k
Activity
3d
Invalid parameter not satisfying: parentEnvironment != nil
Since the beta releases of iPadOS 26 we have been having some crashes about Invalid parameter not satisfying: parentEnvironment != nil We got to contact a couple of users and we found out that the crash appears when entering a screen in a UINavigationController with the iPad device connected to a Magic Keyboard. If the device is not connected to the keyboard then nothing happens and everything works ok. From our end we haven't managed to reproduce the crash so I am pasting part of the stacktrace if it can be of any help. 3 UIKitCore 0x19dfd2e14 -[_UIFocusContainerGuideFallbackItemsContainer initWithParentEnvironment:childItems:] + 224 (_UIFocusContainerGuideFallbackItemsContainer.m:23) 4 UIKitCore 0x19dae3108 -[_UIFocusContainerGuideImpl _searchForFocusRegionsInContext:] + 368 (_UIFocusGuideImpl.m:246) 5 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 6 UIKitCore 0x19db28900 -[_UIFocusMapSnapshot addRegionsInContainers:] + 160 (_UIFocusMapSnapshot.m:545) 7 UIKitCore 0x19d1313dc _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 632 (_UIFocusRegion.m:143) 8 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 9 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 10 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 11 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 12 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 13 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 14 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 15 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 16 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 17 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 18 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 19 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 20 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 21 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 22 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 23 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 24 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 25 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 26 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 27 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 28 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 29 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 30 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 31 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 32 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 33 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 34 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 35 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 36 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 37 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 38 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 39 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 40 UIKitCore 0x19d132e08 -[_UIFocusMapSnapshot _capture] + 424 (_UIFocusMapSnapshot.m:403) 41 UIKitCore 0x19db2675c -[_UIFocusMapSnapshot _initWithSnapshotter:mapArea:searchArea:] + 476 (_UIFocusMapSnapshot.m:171) 42 UIKitCore 0x19d130dcc -[_UIFocusMapSnapshotter captureSnapshot] + 192 (_UIFocusMapSnapshotter.m:137) 43 UIKitCore 0x19db2045c -[_UIFocusMap _inferredDefaultFocusItemInEnvironment:] + 136 (_UIFocusMap.m:168) 44 UIKitCore 0x19daffd2c -[_UIFocusEnvironmentPreferenceEnumerationContext _inferPreferencesForEnvironment:] + 140 (_UIFocusEnvironmentPreferenceEnumerator.m:313) 45 UIKitCore 0x19d127ab4 -[_UIFocusEnvironmentPreferenceEnumerationContext _resolvePreferredFocusEnvironments] + 104 (_UIFocusEnvironmentPreferenceEnumerator.m:250) 46 UIKitCore 0x19d127394 -[_UIFocusEnvironmentPreferenceEnumerationContext preferredEnvironments] + 36 (_UIFocusEnvironmentPreferenceEnumerator.m:184) 47 UIKitCore 0x19d126e94 _enumeratePreferredFocusEnvironments + 400 (_UIFocusEnvironmentPreferenceEnumerator.m:503)
Replies
13
Boosts
3
Views
1k
Activity
3d
UIKit.ButtonBarButtonVisualProvider not key value coding-compliant for the key _titleButton
After updating to Xcode 26 my XCUITests are now failing as during execution exceptions are being raised and caught by my catch all breakpoint These exceptions are only raised during testing, and seem to be referencing some private internal property. It happens when trying to tap a button based off an accessibilityIdentifier e.g. accessibilityIdentifier = "tertiary-button" ... ... app.buttons["tertiary-button"].tap() The full error is: Thread 1: "[<UIKit.ButtonBarButtonVisualProvider 0x600003b4aa00> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _titleButton." Anyone found any workarounds or solutions? I need to get my tests running on the liquid glass UI
Replies
3
Boosts
4
Views
579
Activity
4d
The floating keyboard on iPad OS 26 is not displaying
On iPad OS 26, the custom keyboard works correctly with a full keyboard, but with a floating keyboard, there is only one line and the console displays a constraint error. Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x600002172c10 V:|-(10)-[TUIKeyboardContentView:0x1039c5410] (active, names: '|':TUIKeyplaneView:0x1039c3e20 )>", "<NSLayoutConstraint:0x600002172c60 V:[TUIKeyboardContentView:0x1039c5410]-(-11)-| (active, names: '|':TUIKeyplaneView:0x1039c3e20 )>", "<NSLayoutConstraint:0x6000021721c0 V:|-(0)-[TUIKeyplaneView:0x1039c3e20] (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardLayoutStar Prev...:0x105160e00 )>", "<NSLayoutConstraint:0x600002172210 V:[TUIKeyplaneView:0x1039c3e20]-(0)-| (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardLayoutStar Prev...:0x105160e00 )>", "<NSLayoutConstraint:0x6000021728a0 V:|-(0)-[UIKeyboardLayoutStar Prev...] (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardImpl:0x109905fa0 )>", "<NSLayoutConstraint:0x6000021728f0 V:[UIKeyboardLayoutStar Prev...]-(0)-| (active, names: UIKeyboardLayoutStar Prev...:0x105160e00, '|':UIKeyboardImpl:0x109905fa0 )>", "<NSLayoutConstraint:0x600002177980 '_UITemporaryLayoutHeight' UIKeyboardImpl:0x109905fa0.height == 0 (active)>", "<NSLayoutConstraint:0x600002172df0 'TUIKeyplane.height' TUIKeyboardContentView:0x1039c5410.height == 217 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x600002172df0 'TUIKeyplane.height' TUIKeyboardContentView:0x1039c5410.height == 217 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. iPad OS 26 custom keyboard, full keyboard mode is working normally.
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
0
Views
256
Activity
4d
How to Indicate Selected State for a Menu Toolbar Item (Filter) in SwiftUI?
hi, On my page’s toolbar, I have a toolbar item that is implemented as a menu. Its purpose is to filter the content displayed on the page, similar to the filtering feature in the Photos app. When a user selects a filter option, I want the toolbar item to appear highlighted to indicate the active state. I came across the following guidance in the Human Interface Guidelines: Provide a selected-state version of an interface icon only if necessary. You don’t need to provide selected and unselected appearances for an icon that’s used in standard system components such as toolbars, tab bars, and buttons. The system updates the visual appearance of the selected state automatically. An image of two toolbar buttons that share a background. The left button shows the Filter icon in a selected state, using a blue tint color for its background. The right button shows the More icon in an unselected state, using the default appearance for toolbar buttons. In a toolbar, a selected icon receives the app’s accent color. However, I’m not sure how to actually implement or control the selected state for my toolbar item. Here is a snippet of my code: ToolbarItem(placement: .topBarTrailing) { Menu { Section { LayoutPickerView(layoutOption: $layoutOption) } Section { SortPickerView(sortOption: $viewModel.sortOption) } Section { Menu { Toggle( isOn: Binding( get: { viewModel.filterPlatforms.isEmpty }, set: { if $0 { viewModel.filterPlatforms.removeAll() } } ) ) { HStack { Image(systemName: "square.grid.3x3") .resizable() .scaledToFit() .frame(width: 30, height: 30) Text(Localized.Content.filterAllPlatforms) } } .menuActionDismissBehavior(.disabled) Divider() ForEach(viewModel.availablePlatforms(from: contents)) { platform in Toggle(isOn: viewModel.platformBinding(for: platform)) { HStack { CachedPlatformIconView(urlString: platform.iconUrl, size: 30) Text(platform.name) } } .menuActionDismissBehavior(.disabled) } } label: { Text(Localized.Content.filterMenu) Text(viewModel.filterPlatforms.map(\.name).joined(separator: String(localized: Localized.Content.separator))) } if !viewModel.filterPlatforms.isEmpty { Button { viewModel.filterPlatforms.removeAll() } label: { Text(Localized.Content.filterClear) } } } } label: { Image(systemName: "line.3.horizontal.decrease") } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
60
Activity
4d
How to detect if a binding is from a state or a constant?
Hi, I'm trying to create a custom TextField component where we can have our own custom FormatStyle as a param and then it will change the value binding according to the FormatStyle. It worked with State<Any?> like for example $textValue. But when I use .constant(2000) for instance, the Formatting doesn't work. So is there any way to detect whether the value param is constant or not? Thank you.
Replies
0
Boosts
0
Views
46
Activity
4d
popoverTips don't display for toolbar menu buttons in iOS 26.1
[Also submitted as FB20756013] A popoverTip does not display for toolbar menu buttons in iOS 26.1 (23B5073a). The same code displays tips correctly in iOS 18.6. The issue occurs both in the simulator and on a physical device. Repro Steps Build and run the Sample Code below on iOS 26.1. Observe that the popoverTip does not display. Repeat on iOS 18.6 to confirm expected behavior. Expected popoverTips should appear when attached to a toolbar menu button, as they do in iOS 18.6. Actual No tip is displayed on iOS 26.1. System Info macOS 15.7.1 (24G231) Xcode 26.1 beta 3 (17B5045g) iOS 26.1 (23B5073a) Screenshot Screenshot showing two simulators side by side—iOS 18.6 on the left (tip displayed) and iOS 26.1 on the right (no tip displayed). Sample code import SwiftUI import TipKit struct PopoverTip: Tip { var title: Text { Text("Menu Tip") } var message: Text? { Text("This tip displays on iOS 18.6, but NOT on iOS 26.1.") } } struct ContentView: View { var tip = PopoverTip() var body: some View { NavigationStack { Text("`popoverTip` doesn't display on iOS 26.1 but does in iOS 18.6") .padding() .toolbar { ToolbarItem(placement: .topBarTrailing) { Menu { Button("Dismiss", role: .cancel) { } Button("Do Nothing") { } } label: { Label("More", systemImage: "ellipsis") } .popoverTip(tip) } } .navigationTitle("Popover Tip Issue") .navigationBarTitleDisplayMode(.inline) } } }
Replies
4
Boosts
3
Views
496
Activity
4d
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta)
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta) Summary In iOS 26 beta, using .navigationTitle() inside a NavigationStack fails to render the title when combined with a .toolbar and a List. The title initially appears as expected after launch, but disappears after a second state transition triggered by a button press. This regression does not occur in iOS 18. Steps to Reproduce Use the SwiftUI code sample below (see viewmodel and Reload button for state transitions). Run the app on an iOS 26 simulator (e.g., iPhone 16). On launch, the view starts in .loading state (shows a ProgressView). After 1 second, it transitions to .loaded and displays the title correctly. Tap the Reload button — this sets the state back to .loading, then switches it to .loaded again after 1 second. ❌ After this second transition to .loaded, the navigation title disappears and does not return. Actual Behavior The navigation title displays correctly after the initial launch transition from .loading → .loaded. However, after tapping the “Reload” button and transitioning .loading → .loaded a second time, the title no longer appears. This suggests a SwiftUI rendering/layout invalidation issue during state-driven view diffing involving .toolbar and List. Expected Behavior The navigation title “Loaded Data” should appear and remain visible every time the view is in .loaded state. ✅ GitHub Gist including Screen Recording 👉 View Gist with full details Sample Code import SwiftUI struct ContentView: View { private let vm = viewmodel() var body: some View { NavigationStack { VStack { switch vm.state { case .loading: ProgressView("Loading...") case .loaded: List { ItemList() } Button("Reload") { vm.state = .loading DispatchQueue.main.asyncAfter(deadline: .now() + 1) { vm.state = .loaded } } .navigationTitle("Loaded Data") } } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Menu { Text("hello") } label: { Image(systemName: "gearshape.fill") } } } } } } struct ItemList: View { var body: some View { Text("Item 1") Text("Item 2") Text("Item 3") } } @MainActor @Observable class viewmodel { enum State { case loading case loaded } var state: State = .loading init() { DispatchQueue.main.asyncAfter(deadline: .now() + 1) { self.state = .loaded } } }
Replies
3
Boosts
1
Views
380
Activity
5d
Is there an event if the user pops a template with the backbutton
I want to clear certain state when closing a template when the user clicks the backbutton
Replies
0
Boosts
0
Views
27
Activity
5d