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

Should UISceneSizeRestriction be available on iPhone in iOS 27?
I'm trying to require a minimum size in my UIKit-based iOS app. I added code to set that using the UIWindowScene.sizeRestrictions property to my app's scene delegate as recommended in Apple's documentation: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let currentScene = (scene as? UIWindowScene) else { return } currentScene.sizeRestrictions?.minimumSize.height = 400 currentScene.sizeRestrictions?.minimumSize.width = 320 print("*** Size restrictions: \(String(describing: currentScene.sizeRestrictions))") ... } When I run that in the simulator for an iOS 27 iPhone, the size restrictions property prints out as being nil. That's surprising to me, since the documentation states that "The system provides this object only when it supports variable-sized windows.", and iPhone windows are resizable in iOS 27. If this is working as expected, is there another way to restrict the size of an iPhone window in iOS 27?
Topic: UI Frameworks SubTopic: UIKit
4
0
298
3d
iPhone 15 touchscreen intermittently becomes unresponsive while charging on iOS 26.6
Device: iPhone 15 Affected Versions: • iOS 26.5 • iOS 26.6 Summary While using my iPhone 15 during charging, the touchscreen occasionally becomes less responsive. Some touches are delayed or not recognized, making the device difficult to use. This issue was present on iOS 26.5 and still occurs after updating to iOS 26.6. Steps to Reproduce Connect the iPhone 15 to a charger. Unlock the device. Use the touchscreen while the phone is charging. Continue interacting with the screen for several minutes. Expected Result The touchscreen should remain fully responsive while charging. Actual Result The touchscreen occasionally becomes less responsive. Some taps or gestures are delayed or not recognized. The issue is intermittent but noticeable during charging. Frequency Intermittent. It does not happen every time, but it has occurred multiple times on both iOS 26.5 and iOS 26.6. Additional Information • Device: iPhone 15 • The issue has persisted across two stable iOS versions. • I have restarted the device and updated to the latest iOS version, but the issue still occurs. Has anyone else experienced this issue on iPhone 15 or other iPhone models? If so, does it occur with the Apple charger, a third-party charger, or both?
Topic: UI Frameworks SubTopic: UIKit
0
0
37
3d
Unexpected behavior in the interaction between LazyVStack and GeometryReader
Hello! I'd like to share a problem and its potential solution. Steps to reproduce: The issue can be reproduced with the following minimal example: struct TestConditionalScrollView: View { var body: some View { ConditionalScrollView { LazyVStack(spacing: 16) { Text("Text 1") .frame(height: 20) Text("Text 2") .frame(height: 30) Text("Text 3") .frame(height: 40) Text("Text 4") .frame(height: 500) Text("Text 5") .frame(height: 400) } .padding() } } } struct ConditionalScrollView<Content: View>: View { let content: Content init(@ViewBuilder content: () -> Content) { self.content = content() } @State private var contentHeight: CGFloat = 0 var body: some View { GeometryReader { geo in _ = print("Height: \(contentHeight)") return Group { if contentHeight > geo.size.height { ScrollView { measuredContent } } else { measuredContent } } } } private var measuredContent: some View { content .background( GeometryReader { geo in Color.clear .preference( key: ContentHeightKey.self, value: geo.size.height ) } ) .onPreferenceChange(ContentHeightKey.self) { contentHeight = $0 } } } struct ContentHeightKey: PreferenceKey { static var defaultValue: CGFloat = 0 static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { value = max(value, nextValue()) } } If we hit the breakpoint on the following line: _ = print("Height: (contentHeight)") the output looks like this: Problems observed Different values are reported, and it is unclear where those values originate from. The selected execution branch appears to change multiple times during the layout process. Possible reason As Rens Breur mentioned in the WWDC26 session "Dive into lazy stacks and scrolling with SwiftUI", LazyVStack relies on estimated layout information during certain phases of the layout process. I do not want to rely on or investigate SwiftUI's non-public implementation details, but I would like to explain what I believe is happening internally. To do that, let me show how the value reaches the GeometryReader closure: Step 1 In AttributeGraph, the GeometryReader<...> node and the LazyVStack node appear to be connected as shown below: Step 2 When the LazyVStack node is updated, the layout process appears to follow roughly this logic: `SwiftUICore 'SwiftUI.ForEachState.forEachItem:` n = number of cells to evaluate (initially n == 2) For first n cells: SwiftUICore`SwiftUI.ViewLayoutEngine.sizeThatFits(...) SwiftUI.EstimationCache.add(...) The total size of the lazy stack is then estimated: SwiftUI.LazyStack<...>.sizeThatFits(...): averageCellInfo = EstimationCache.average averageCellInfo.height = (firstCellHeight + secondCellHeight) / 2 totalHeight = firstCellHeight + secondCellHeight + averageCellInfo.height * remainingCells For the sample project, this produces an estimated height of 189. This value then appears to be cached inside a LazyLayoutComputer node. Step 3 When GeometryReader is updated and its closure executes, geo.size.height appears to be resolved from the cached value stored by LazyLayoutComputer. As a result, the reported height is: 189 + 32 (padding) = 221 Step 4 My assumption is that LazyVStack subsequently validates the estimated layout against the actual layout results. It seems to compare: The maximum Y position of the last list's cell The cached sizeThatFits value If those values differ sufficiently, the transaction is not committed and another layout pass is triggered. During a later pass, the real sizes become available and GeometryReader eventually reports the final correct value. If this interpretation is correct, the behavior shown in the logs would be expected: followed later by: Possible solution I could not find a public SwiftUI API that provides an accurate content size during the initial layout pass. I tried the following options: LazyVStack + GeometryReader LazyVStack + ViewThatFits LazyVStack + .scrollBounceBehavior(...) At the same time, SwiftUI itself appears to have information about layout validity. For example, the layout logs contain entries such as: placed(...) -> ... invalid: true This suggests that SwiftUI can determine when an estimated layout result is no longer valid and requires additional layout passes. If SwiftUI knows that the current layout is invalid, is there a way to access this information from within a GeometryReader closure or by some other means? Otherwise, clients may perform layout calculations based on invalid geometry, which can result in a broken dependent layout. Have a good day!
0
2
46
3d
Public generated asset symbols
Is there currently an option to make generated asset symbols public? If not, would it be possible to set the generated asset symbol so they are public. It's quite common to have an apps design system implemented in a separate framework. Currently the generate assets symbols is useless for this as they can't be access in the framework consumer. It would be great to add it to this new dropdown in Xcode 16 or along side it. (113704993 in the release notes) So the options would be Internal, Public and Off. This should affect the symbols, the extensions and the framework support. (There's a post on the swift forums about this as well here: https://forums.swift.org/t/generate-images-and-colors-inside-a-swift-package/65674)
7
35
2.8k
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)
17
3
2.3k
3d
iOS27: Bar Marks in Swift Charts exhibit multiple severe issues
Bar Marks in Swift Charts exhibit multiple severe issues on iOS27. Tested on: iPad Pro M2, 13", iOS27 Beta 2. Feedback submitted: FB23354502 Charts form a visual backbone of our app, and these issues render the chart unusable. Without a fix, we will not be able to support iOS27. The issues we identified: (1) We arrange mutually exclusive BarMarks on a time-based x-axis, inside a vertically scrolling Chart. We use init(xStart:, xEnd:, yStart: yEnd:), creating a visual timeline. Everything renders correctly on iOS26. On iOS27, many BarMarks are missing. (2) When we tap on a BarMark, we increase its height so make it appear selected. This works nicely in iOS26. The BarMark does not animate or change size at all on iOS27. (3) We have an outline around a BarMark, as part of styling. This uses .annotation(position: .overlay). The outline renders nicely in iOS26. On iOS27, the outline is rendered as a small circle inside the BarMark.
3
1
285
3d
iOS 26 Beta bug - keyboard toolbar with bottom safe area inset
Hello! I have experienced a weird bug in iOS 26 Beta (8) and previous beta versions. The safe area inset is not correctly aligned with the keyboard toolbar on real devices and simulators. When you focus a new textfield the bottom safe area is correctly placed aligned the keyboard toolbar. On real devices the safe area inset view is covered slightly by the keyboard toolbar, which is even worse than on the simulator. Here's a clip from a simulator: Here's the code that reproduced the bug I experienced in our app. #Preview { NavigationStack { ScrollView { TextField("", text: .constant("")) .padding() .background(Color.secondary) TextField("", text: .constant("")) .padding() .background(Color.green) } .padding() .safeAreaInset(edge: .bottom, content: { Color.red .frame(maxWidth: .infinity) .frame(height: 40) }) .toolbar { ToolbarItem(placement: .keyboard) { Button {} label: { Text("test") } } } } }
4
12
1.3k
3d
LazyVStack layout issue and potential fix
Hello! Over the last several months I've spent a lot of time investigating various LazyVStack issues. I’d like to share a one problem. Blank Screen + Cell trimming For reference, I've also submitted a Feedback Assistant report for this issue. Let's use the minimal example Copy the following code into a new project and run it: struct ScrollableLazyVStack: View { @StateObject private var viewModel: ScrollableLazyVStackViewModel init(count: Int) { self._viewModel = StateObject( wrappedValue: ScrollableLazyVStackViewModel(count: count) ) } var body: some View { ScrollView { LazyVStack(spacing: 8) { ForEach(viewModel.items, id: \.index) { CellView(by: $0) } } } .padding(.horizontal, 8) } } final class ScrollableLazyVStackViewModel: ObservableObject { @Published var items: [CellModel] = [] init(count: Int) { self.items = (0..<count).map { CellModel(index: $0) } } } private struct CellView: View { let item: CellModel init(by item: CellModel) { self.item = item } var body: some View { VStack(alignment: .leading, spacing: 2) { HStack(spacing: 4) { Image(systemName: item.icon) VStack(alignment: .leading, spacing: 4) { Text(item.title) .font(.body) Text(item.subtitle) .font(.caption) .foregroundColor(.secondary) if item.index < 100 { Text("Extra Text") .frame(height: 500) } } Spacer(minLength: .zero) } } .padding(16) .background( RoundedRectangle(cornerRadius: 14, style: .continuous) .fill(Color(.systemGray5)) ) } } struct CellModel: Hashable { private static let icons = [ "star.fill", "heart.fill", "bolt.fill", "flame.fill", "leaf.fill", "moon.fill", "cloud.fill", "paperplane.fill" ] private static let titles = [ "Random Item", "Sample Entry", "List Element", "Demo Cell", "Example Row", "Test Object" ] private static let subtitles = [ "Additional information", "Secondary description", "Some extra details", "Short explanation", "Supporting text" ] let index: Int let title: String let subtitle: String let icon: String init(index: Int) { self.index = index self.title = "\(index). \(Self.titles.randomElement()!)" self.subtitle = Self.subtitles.randomElement()! self.icon = Self.icons.randomElement()! } } Steps to Reproduce Fast-scroll to the bottom of the list using the scroll indicator. Then fast-scroll back to the top by dragging and holding the scroll indicator. Actual Results Blank Screen During fast scrolling, the visible content may temporarily disappear, resulting in a white screen. In most cases, the content eventually reappears. Truncated Cells After scrolling back toward the top, some of the topmost cells may become partially truncated. Possible Cause Blank Screen I do not want to rely on or investigate SwiftUI's non-public implementation details, but I would like to explain what I believe is happening internally. I'd like to assume what appears to be the underlying algorithm. When fast scrolling is active, the following sequence seems to occur: Step 1 SwiftUICore::resolveIndexAndPosition calculates an anchorIndex. For example: anchorIndex ≈ (scrollOffset / contentSize) * totalRows Step 2 SwiftUICore::resolveIndexAndPosition calculates an anchorPosition. For example: anchorPosition ≈ anchorIndex * (estimatedCellSize + spacing) Step 3 SwiftUI searches for the first visible cell and updates the position of the last laid-out cell (y_max_last_cell). Step 4 (the most important) The layout's correctness validation: Conceptually: d1 = abs(y_last_max - cachedSizeThatFits) d2 = 0.1 * min(y_last_max, cachedSizeThatFits) If: d1 < d2 -> the current CA::Transaction is committed. Otherwise: cachedSizeThatFits = sizeThatFits(...) and the process restarts from Step 1. If logging is enabled via: com.apple.SwiftUI.LazyStackLogging the behavior can be observed in the attached screenshot. Why this may fail The algorithm appears to assume that the estimated cell size does not change dramatically while fast scrolling. However, if the beginning of the list contains very tall cells and the remainder contains much smaller cells, the estimate may become significantly inaccurate. In that situation, comparing cachedSizeThatFits against the position of the last visible cell does not seem sufficient to guarantee a stable result, which may explain the temporary blank screen. Cell Truncation While scrolling upward, the following state can occur (see attached screenshot): SwiftUICore::resolveIndexAndPosition produces: anchorIndex = 2 anchorPosition = -562 The content is translated by 486.47, which corresponds approximately to: estimatedCellSize * 2 As a result, the effective anchor position becomes: -76.32 and the first 0...1 cells are truncated. Possible Solution Blank screen's problem My assumption is that the current layout validation criteria may not be sufficient in all cases. An alternative approach could be to always fill the visible region sequentially: top → bottom while scrolling downward bottom → top while scrolling upward With such a strategy, the layout result could potentially be committed immediately once the visible area is fully covered by realized cells. Cell's Truncation For the truncation issue, it seems that the current translation-based approach may be the source of the problem. One possible alternative would be to use a contentInset-based adjustment combined with clipping against the first visible cell's minY. In that model, negative inset values would not necessarily be problematic, and the visible content could remain correctly aligned. What do you think about this?
Topic: UI Frameworks SubTopic: SwiftUI
0
2
435
4d
Siri “Found in Apps” Messenger contact suggestion change into raw metadata
Hey guys, just after some possible answers. Why might’ve a Siri “Found in Apps” Messenger contact suggestion change into raw metadata and then create a second clean suggestion? Device: iPhone 14 iOS 17 Occurred sometime around 2023–2024 The issue involved one unsaved Siri Suggested Contact under “Found in Apps” from Facebook Messenger. The sequence was: A normal Siri suggestion appeared: Messenger: name redacted Months later, that same suggested contact no longer displayed normally. Instead, it showed what looked like raw metadata while still being labelled as Messenger: Messenger: HQ_UPhdmaAMnPegcbDmgaAMfH_PPf-PtSVXehqahXZOUgA;x-userid=PR:HQ_UPhdmaAMnPegcbDmgaAMfH_PPfPtSVXehqahXZOUgA;x-displayname=name redacted;x-teamidentifier=V9WTTPBFK9;x-bundleidentifiers=com.facebook.Messenger;x-apple:PR%3AHQ_UPhdmaAMnPegcbDmgaAMfH_PPfPtSVXehqahXZOUgA After this occurred, another Siri “Found in Apps” suggestion appeared underneath: Messenger: name redacted The new entry appeared normal, while the older entry continued to show the raw metadata string. I have only seen this happen with this one contact. Other Messenger Siri suggestions display normally. My questions: What would cause a Siri “Found in Apps” suggestion to display the underlying metadata/social profile fields instead of the normal app name and contact name? Why would iOS create another clean “Messenger: Name” suggestion afterwards instead of replacing the malformed entry? Is this likely related to Siri Suggestions indexing, Contacts framework social profile data, Core Spotlight, or Messenger’s app integration? Could this happen from stale cached data or a re-indexing event after an app/iOS update? I am mainly trying to understand the technical reason for the duplicate entries and the raw metadata display, and why it may have only affected this one Siri suggested contact, not the dozen others I had as well.
Topic: UI Frameworks SubTopic: AppKit
0
0
231
4d
EKEventEditViewController broken in iOS 27 Beta
UIKit app can not edit an event using EKEventEditViewController in iOS 27 Betas. The Done tick button at the top does not work after editing an event. Also does not work if EKEventViewController is first used to display the event. Then the "Edit" tapped to display the EKEventEditViewController. Anyone else seeing this?
3
0
288
4d
SwiftUI Button with Image view label has smaller hit target
[Also submitted as FB20213961] SwiftUI Button with a label: closure containing only an Image view has a smaller tap target than buttons created with a Label or the convenience initializer. The hit area shrinks to the image bounds instead of preserving the standard minimum tappable size. SCREEN RECORDING On a physical device, the difference is obvious—it’s easy to miss the button. Sometimes it even shows the button-tapped bounce animation but doesn’t trigger the action. SYSTEM INFO Xcode Version 26.0 (17A321) macOS 15.6.1 (24G90) iOS 26.0 (23A340) SAMPLE CODE The following snippet shows the difference in hit targets between the convenience initializer, a Label, and an Image (the latter two in a label: closure). // ✅ Hit target is entire button Button("Button 1", systemImage: "1.square.fill") { print("Button 1 tapped") } // ✅ Hit target is entire button Button { print("Button 2 tapped") } label: { Label("Button 2", systemImage: "2.square.fill") } // ❌ Hit target is smaller than button Button { print("Button 3 tapped") } label: { Image(systemName: "3.square.fill") }
7
4
781
5d
SwiftUI animation is laggy in NSStatusItem since macOS 26 Tahoe
My app is a bit of a special case and relies on a custom view in a NSStatusItem. I use a NSHostingView and add it as a subview to my NSStatusItem's .button property. Since macOS 26 Tahoe, even simple animations like a .frame change of a Circle won't animate smoothly even though the same SwiftUI animates normally in a WindowGroup. class AppDelegate: NSObject, NSApplicationDelegate { private let statusItem: NSStatusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) func applicationDidFinishLaunching(_ aNotification: Notification) { let subview = NSHostingView(rootView: AnimationView()) let view = self.statusItem.button view?.addSubview(subview) subview.translatesAutoresizingMaskIntoConstraints = false guard let view = view else { return } NSLayoutConstraint.activate([ subview.centerXAnchor.constraint(equalTo: view.centerXAnchor), subview.centerYAnchor.constraint(equalTo: view.centerYAnchor), subview.widthAnchor.constraint(equalToConstant: 22), subview.heightAnchor.constraint(equalToConstant: 22) ]) } } struct AnimationView: View { @State private var isTapped = false @State private var size: CGSize = .init(width: 4, height: 4) var body: some View { Circle() .fill(.pink) .frame(width: size.width, height: size.height) .frame(width: 20, height: 20) // .frame(maxHeight: .infinity) // .padding(.horizontal, 9) // .frame(height: 22) .contentShape(Rectangle()) // .background(Color.blue.opacity(0.5)) .onTapGesture { withAnimation(.interactiveSpring(response: 0.85, dampingFraction: 0.26, blendDuration: 0.45)) { // withAnimation(.spring()) { if isTapped { size = .init(width: 4, height: 4) } else { size = .init(width: 16, height: 16) } } isTapped.toggle() }} } Example project: https://app.box.com/s/q28upunrgkxyyd97ovslgud9yitqaxfk
1
0
218
5d
Tab bar animates from first tab to restored selection at launch with .tabBarMinimizeBehavior(.onScrollDown)
[Submitted as FB23998635] On iPhone, applying .tabBarMinimizeBehavior(.onScrollDown) to a SwiftUI TabView causes the native tab bar to briefly show the first declared tab before animating to the already-restored selection during app launch. The selected tab is persisted with @AppStorage and is already restored before the TabView is presented. The sample contains no explicit animations, transactions, navigation containers, loading states, asynchronous work, or post-launch selection changes. Removing .tabBarMinimizeBehavior(.onScrollDown) eliminates the launch animation entirely. Likewise, starting with .tabBarMinimizeBehavior(.never) and changing it to .onScrollDown after a one-second delay also eliminates the issue. The behavior reproduces with three simple tabs and a direct @AppStorage selection binding. ENVIRONMENT • iOS 26 & 27 REPRO STEPS Build and run the attached sample. Select the "Two" tab. Force-quit the app. Relaunch the app. Observe the tab bar during launch. ACTUAL The tab indicator initially appears on "One", the first declared tab, then animates to the correctly restored "Two" selection. EXPECTED The restored tab should be selected and stationary from the first visible frame, with no launch animation. SAMPLE CODE struct ContentView: View { private enum AppTab: String, Hashable { case one case two case three } @AppStorage("selectedGenericTab") private var selectedTab: AppTab = .three var body: some View { TabView(selection: $selectedTab) { Tab("One", systemImage: "1.circle", value: AppTab.one) { ReproTabContent(title: "One", color: .orange) } Tab("Two", systemImage: "2.circle", value: AppTab.two) { ReproTabContent(title: "Two", color: .blue) } Tab("Three", systemImage: "3.circle", value: AppTab.three) { ReproTabContent(title: "Three", color: .green) } } .tabBarMinimizeBehavior(.onScrollDown) } } private struct ReproTabContent: View { let title: String let color: Color var body: some View { ZStack { color.opacity(0.2) .ignoresSafeArea() Text(title) .font(.largeTitle) } } }
2
0
382
5d
UISearchController text field not receiving touches when another UISearchController is attached to navigationItem.searchController on iOS 26
On iOS 26, UISearchController becomes non-interactive when presenting a second UISearchController from another tab of a UITabBarController. let tabBar = UITabBarController() let first = FirstViewController() first.title = "First" let second = SecondViewController() second.title = "Second" let nav1 = UINavigationController(rootViewController: first) let nav2 = UINavigationController(rootViewController: second) nav1.tabBarItem = UITabBarItem( title: "First", image: nil, tag: 0 ) nav2.tabBarItem = UITabBarItem( title: "Second", image: nil, tag: 1 ) tabBar.viewControllers = [ nav1, nav2 ] The app has two tabs. Each tab has its own UINavigationController. Tab 1: A UISearchController is assigned to navigationItem.searchController. class FirstViewController: UIViewController { private let searchController = UISearchController( searchResultsController: nil ) override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground searchController.obscuresBackgroundDuringPresentation = false searchController.searchResultsUpdater = self navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false definesPresentationContext = true } } Tab 2: A button presents another UISearchController using present(_:animated:). class SecondViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground let button = UIButton( type: .system ) button.setTitle( "Open Search", for: .normal ) button.addTarget( self, action: #selector(openSearch), for: .touchUpInside ) button.translatesAutoresizingMaskIntoConstraints = false view.addSubview(button) NSLayoutConstraint.activate([ button.centerXAnchor.constraint( equalTo: view.centerXAnchor ), button.centerYAnchor.constraint( equalTo: view.centerYAnchor ) ]) definesPresentationContext = true } @objc private func openSearch() { let searchController = UISearchController( searchResultsController: nil ) navigationController?.present( searchController, animated: true ) } } On iOS 17 and iOS 18 this works correctly. On iOS 26: The search controller appears. The Cancel button works. The search text field cannot receive touches and does not become first responder. If I remove: navigationItem.searchController = searchController from Tab 1, the search controller in Tab 2 works correctly. This looks like a UIKit regression introduced in iOS 26.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
82
5d
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) } } }
6
3
889
5d
Unable to use AppIntents
Hi, I'm trying to add Shortcuts using AppIntents but unable to get past this error: 'AppShortcutsProvider' property 'appShortcuts' requires builder syntax This is the AppShortcutsProvider struct: import AppIntents struct MyAppShortcuts: AppShortcutsProvider { @AppShortcutsBuilder static var appShortcuts: [AppShortcut] { AppShortcut( intent: OpenDashboardIntent(), phrases: [ "Open dashboard in \(.applicationName)", "Show my \(.applicationName) dashboard" ], shortTitle: "Open Dashboard", systemImageName: "square.grid.2x2" ) } } And I have only one intent: import AppIntents struct OpenDashboardIntent: AppIntent { static var title: LocalizedStringResource = "Open Dashboard" static var openAppWhenRun: Bool = true @MainActor func perform() async throws -> some IntentResult & ProvidesDialog { return .result(dialog: "Opening dashboard") } } I searched the error online but the fixes were to use @AppShortcutsBuilder and skipping commas in case of registering multiple app intents - I'm already following all that. What am I missing? Thanks.
0
0
270
6d
Inspector Panel Visual UI
How can I get the inspector panel on the Mac to be respected by the toolbar? In Xcode and Pages, the inspector panel runs the entire length of the app so that everything slides over when it's invoked. But in my testing, the toolbar always overlaps the inspector. import SwiftUI @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var selectedItem: String? = "Page 1" @State private var inspectorVisible = true let items = ["Page 1", "Page 2", "Page 3"] var body: some View { NavigationSplitView { List(items, id: \.self, selection: $selectedItem) { item in Label(item, systemImage: "doc") } } detail: { Text(selectedItem ?? "Nothing selected") .font(.title2) .foregroundStyle(.secondary) .inspector(isPresented: $inspectorVisible) { List { Section("Properties") { LabeledContent("Width", value: "100") LabeledContent("Height", value: "200") } Section("Style") { LabeledContent("Color", value: "Blue") LabeledContent("Opacity", value: "100%") } } .scrollContentBackground(.hidden) } } .toolbar { ToolbarItemGroup(placement: .principal) { Button("Draw", systemImage: "pencil") {} Button("Shape", systemImage: "circle") {} Button("Text", systemImage: "textformat") {} } ToolbarItem () { Button("Share", systemImage: "square.and.arrow.up") {} } ToolbarItem() { Button("Inspector", systemImage: "sidebar.right") { inspectorVisible.toggle() } } } .navigationTitle("My Project") } } #Preview { ContentView() .frame(width: 1100, height: 600) }
Topic: UI Frameworks SubTopic: SwiftUI
0
0
241
1w
Distinguishing background from user app launches
When adopting the Scene Delegate, the applicationState changes from indicating app state to indicating scene state. I previously used this as a signal to determine whether my iOS app was launched in the background or launched by the user. Given the change, it seems like applicationState should no longer be used in that manner in the App Delegate. Would you recommend using UIApplication.shared.backgroundTimeRemaining to distinguish a background launch from a user launch? assuming this is a very large value for user launches. Are there corner cases that I may not expect?
1
0
391
1w
Can't Drag and Drop a file promise into /tmp
This happens with my own code as well as with the Apple example code here: Supporting Drag and Drop Through File Promises When dragging a file promise, the above example code will fail if the destination is in /tmp. It will print out the following message to the console: An error occurred while attempting to get a unique promise file URL. Error: Did not receive a valid URL. It doesn't seem to fail if you create a directory inside /tmp and drop into that. But dropping in /tmp fails 100% of the time. And it fails for MacOS Versions from Sequoia all the way up to the most recent Golden Gate beta. Using /tmp as a destination should most certainly be allowed, but if for some reason it isn't, is there any way in my own code to detect the drop destination and perhaps warn the user that they need to drop somewhere else? To reproduce this error, use the following steps: Download the Apple example code from the link above Open the project in Xcode, build it, and run it Drag any image into the example app's main window Open a Finder window and navigate to /tmp Drag the image from the example app into the /tmp directory in the Finder window. You will see the above error in the Xcode console and the drop will fail.
Topic: UI Frameworks SubTopic: AppKit
0
0
312
1w
Should UISceneSizeRestriction be available on iPhone in iOS 27?
I'm trying to require a minimum size in my UIKit-based iOS app. I added code to set that using the UIWindowScene.sizeRestrictions property to my app's scene delegate as recommended in Apple's documentation: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let currentScene = (scene as? UIWindowScene) else { return } currentScene.sizeRestrictions?.minimumSize.height = 400 currentScene.sizeRestrictions?.minimumSize.width = 320 print("*** Size restrictions: \(String(describing: currentScene.sizeRestrictions))") ... } When I run that in the simulator for an iOS 27 iPhone, the size restrictions property prints out as being nil. That's surprising to me, since the documentation states that "The system provides this object only when it supports variable-sized windows.", and iPhone windows are resizable in iOS 27. If this is working as expected, is there another way to restrict the size of an iPhone window in iOS 27?
Topic: UI Frameworks SubTopic: UIKit
Replies
4
Boosts
0
Views
298
Activity
3d
iPhone 15 touchscreen intermittently becomes unresponsive while charging on iOS 26.6
Device: iPhone 15 Affected Versions: • iOS 26.5 • iOS 26.6 Summary While using my iPhone 15 during charging, the touchscreen occasionally becomes less responsive. Some touches are delayed or not recognized, making the device difficult to use. This issue was present on iOS 26.5 and still occurs after updating to iOS 26.6. Steps to Reproduce Connect the iPhone 15 to a charger. Unlock the device. Use the touchscreen while the phone is charging. Continue interacting with the screen for several minutes. Expected Result The touchscreen should remain fully responsive while charging. Actual Result The touchscreen occasionally becomes less responsive. Some taps or gestures are delayed or not recognized. The issue is intermittent but noticeable during charging. Frequency Intermittent. It does not happen every time, but it has occurred multiple times on both iOS 26.5 and iOS 26.6. Additional Information • Device: iPhone 15 • The issue has persisted across two stable iOS versions. • I have restarted the device and updated to the latest iOS version, but the issue still occurs. Has anyone else experienced this issue on iPhone 15 or other iPhone models? If so, does it occur with the Apple charger, a third-party charger, or both?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
37
Activity
3d
Unexpected behavior in the interaction between LazyVStack and GeometryReader
Hello! I'd like to share a problem and its potential solution. Steps to reproduce: The issue can be reproduced with the following minimal example: struct TestConditionalScrollView: View { var body: some View { ConditionalScrollView { LazyVStack(spacing: 16) { Text("Text 1") .frame(height: 20) Text("Text 2") .frame(height: 30) Text("Text 3") .frame(height: 40) Text("Text 4") .frame(height: 500) Text("Text 5") .frame(height: 400) } .padding() } } } struct ConditionalScrollView<Content: View>: View { let content: Content init(@ViewBuilder content: () -> Content) { self.content = content() } @State private var contentHeight: CGFloat = 0 var body: some View { GeometryReader { geo in _ = print("Height: \(contentHeight)") return Group { if contentHeight > geo.size.height { ScrollView { measuredContent } } else { measuredContent } } } } private var measuredContent: some View { content .background( GeometryReader { geo in Color.clear .preference( key: ContentHeightKey.self, value: geo.size.height ) } ) .onPreferenceChange(ContentHeightKey.self) { contentHeight = $0 } } } struct ContentHeightKey: PreferenceKey { static var defaultValue: CGFloat = 0 static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { value = max(value, nextValue()) } } If we hit the breakpoint on the following line: _ = print("Height: (contentHeight)") the output looks like this: Problems observed Different values are reported, and it is unclear where those values originate from. The selected execution branch appears to change multiple times during the layout process. Possible reason As Rens Breur mentioned in the WWDC26 session "Dive into lazy stacks and scrolling with SwiftUI", LazyVStack relies on estimated layout information during certain phases of the layout process. I do not want to rely on or investigate SwiftUI's non-public implementation details, but I would like to explain what I believe is happening internally. To do that, let me show how the value reaches the GeometryReader closure: Step 1 In AttributeGraph, the GeometryReader<...> node and the LazyVStack node appear to be connected as shown below: Step 2 When the LazyVStack node is updated, the layout process appears to follow roughly this logic: `SwiftUICore 'SwiftUI.ForEachState.forEachItem:` n = number of cells to evaluate (initially n == 2) For first n cells: SwiftUICore`SwiftUI.ViewLayoutEngine.sizeThatFits(...) SwiftUI.EstimationCache.add(...) The total size of the lazy stack is then estimated: SwiftUI.LazyStack<...>.sizeThatFits(...): averageCellInfo = EstimationCache.average averageCellInfo.height = (firstCellHeight + secondCellHeight) / 2 totalHeight = firstCellHeight + secondCellHeight + averageCellInfo.height * remainingCells For the sample project, this produces an estimated height of 189. This value then appears to be cached inside a LazyLayoutComputer node. Step 3 When GeometryReader is updated and its closure executes, geo.size.height appears to be resolved from the cached value stored by LazyLayoutComputer. As a result, the reported height is: 189 + 32 (padding) = 221 Step 4 My assumption is that LazyVStack subsequently validates the estimated layout against the actual layout results. It seems to compare: The maximum Y position of the last list's cell The cached sizeThatFits value If those values differ sufficiently, the transaction is not committed and another layout pass is triggered. During a later pass, the real sizes become available and GeometryReader eventually reports the final correct value. If this interpretation is correct, the behavior shown in the logs would be expected: followed later by: Possible solution I could not find a public SwiftUI API that provides an accurate content size during the initial layout pass. I tried the following options: LazyVStack + GeometryReader LazyVStack + ViewThatFits LazyVStack + .scrollBounceBehavior(...) At the same time, SwiftUI itself appears to have information about layout validity. For example, the layout logs contain entries such as: placed(...) -> ... invalid: true This suggests that SwiftUI can determine when an estimated layout result is no longer valid and requires additional layout passes. If SwiftUI knows that the current layout is invalid, is there a way to access this information from within a GeometryReader closure or by some other means? Otherwise, clients may perform layout calculations based on invalid geometry, which can result in a broken dependent layout. Have a good day!
Replies
0
Boosts
2
Views
46
Activity
3d
Public generated asset symbols
Is there currently an option to make generated asset symbols public? If not, would it be possible to set the generated asset symbol so they are public. It's quite common to have an apps design system implemented in a separate framework. Currently the generate assets symbols is useless for this as they can't be access in the framework consumer. It would be great to add it to this new dropdown in Xcode 16 or along side it. (113704993 in the release notes) So the options would be Internal, Public and Off. This should affect the symbols, the extensions and the framework support. (There's a post on the swift forums about this as well here: https://forums.swift.org/t/generate-images-and-colors-inside-a-swift-package/65674)
Replies
7
Boosts
35
Views
2.8k
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
17
Boosts
3
Views
2.3k
Activity
3d
iOS27: Bar Marks in Swift Charts exhibit multiple severe issues
Bar Marks in Swift Charts exhibit multiple severe issues on iOS27. Tested on: iPad Pro M2, 13", iOS27 Beta 2. Feedback submitted: FB23354502 Charts form a visual backbone of our app, and these issues render the chart unusable. Without a fix, we will not be able to support iOS27. The issues we identified: (1) We arrange mutually exclusive BarMarks on a time-based x-axis, inside a vertically scrolling Chart. We use init(xStart:, xEnd:, yStart: yEnd:), creating a visual timeline. Everything renders correctly on iOS26. On iOS27, many BarMarks are missing. (2) When we tap on a BarMark, we increase its height so make it appear selected. This works nicely in iOS26. The BarMark does not animate or change size at all on iOS27. (3) We have an outline around a BarMark, as part of styling. This uses .annotation(position: .overlay). The outline renders nicely in iOS26. On iOS27, the outline is rendered as a small circle inside the BarMark.
Replies
3
Boosts
1
Views
285
Activity
3d
iOS 26 Beta bug - keyboard toolbar with bottom safe area inset
Hello! I have experienced a weird bug in iOS 26 Beta (8) and previous beta versions. The safe area inset is not correctly aligned with the keyboard toolbar on real devices and simulators. When you focus a new textfield the bottom safe area is correctly placed aligned the keyboard toolbar. On real devices the safe area inset view is covered slightly by the keyboard toolbar, which is even worse than on the simulator. Here's a clip from a simulator: Here's the code that reproduced the bug I experienced in our app. #Preview { NavigationStack { ScrollView { TextField("", text: .constant("")) .padding() .background(Color.secondary) TextField("", text: .constant("")) .padding() .background(Color.green) } .padding() .safeAreaInset(edge: .bottom, content: { Color.red .frame(maxWidth: .infinity) .frame(height: 40) }) .toolbar { ToolbarItem(placement: .keyboard) { Button {} label: { Text("test") } } } } }
Replies
4
Boosts
12
Views
1.3k
Activity
3d
Accessing SwiftData document package?
I would very much like to store some additional data in my SwiftData document package, outside of SwiftData. Metadata about the document that doesn't lend itself well to the underlying RDBMS nature of SwiftData. Is that possible?
Replies
1
Boosts
1
Views
953
Activity
4d
LazyVStack layout issue and potential fix
Hello! Over the last several months I've spent a lot of time investigating various LazyVStack issues. I’d like to share a one problem. Blank Screen + Cell trimming For reference, I've also submitted a Feedback Assistant report for this issue. Let's use the minimal example Copy the following code into a new project and run it: struct ScrollableLazyVStack: View { @StateObject private var viewModel: ScrollableLazyVStackViewModel init(count: Int) { self._viewModel = StateObject( wrappedValue: ScrollableLazyVStackViewModel(count: count) ) } var body: some View { ScrollView { LazyVStack(spacing: 8) { ForEach(viewModel.items, id: \.index) { CellView(by: $0) } } } .padding(.horizontal, 8) } } final class ScrollableLazyVStackViewModel: ObservableObject { @Published var items: [CellModel] = [] init(count: Int) { self.items = (0..<count).map { CellModel(index: $0) } } } private struct CellView: View { let item: CellModel init(by item: CellModel) { self.item = item } var body: some View { VStack(alignment: .leading, spacing: 2) { HStack(spacing: 4) { Image(systemName: item.icon) VStack(alignment: .leading, spacing: 4) { Text(item.title) .font(.body) Text(item.subtitle) .font(.caption) .foregroundColor(.secondary) if item.index < 100 { Text("Extra Text") .frame(height: 500) } } Spacer(minLength: .zero) } } .padding(16) .background( RoundedRectangle(cornerRadius: 14, style: .continuous) .fill(Color(.systemGray5)) ) } } struct CellModel: Hashable { private static let icons = [ "star.fill", "heart.fill", "bolt.fill", "flame.fill", "leaf.fill", "moon.fill", "cloud.fill", "paperplane.fill" ] private static let titles = [ "Random Item", "Sample Entry", "List Element", "Demo Cell", "Example Row", "Test Object" ] private static let subtitles = [ "Additional information", "Secondary description", "Some extra details", "Short explanation", "Supporting text" ] let index: Int let title: String let subtitle: String let icon: String init(index: Int) { self.index = index self.title = "\(index). \(Self.titles.randomElement()!)" self.subtitle = Self.subtitles.randomElement()! self.icon = Self.icons.randomElement()! } } Steps to Reproduce Fast-scroll to the bottom of the list using the scroll indicator. Then fast-scroll back to the top by dragging and holding the scroll indicator. Actual Results Blank Screen During fast scrolling, the visible content may temporarily disappear, resulting in a white screen. In most cases, the content eventually reappears. Truncated Cells After scrolling back toward the top, some of the topmost cells may become partially truncated. Possible Cause Blank Screen I do not want to rely on or investigate SwiftUI's non-public implementation details, but I would like to explain what I believe is happening internally. I'd like to assume what appears to be the underlying algorithm. When fast scrolling is active, the following sequence seems to occur: Step 1 SwiftUICore::resolveIndexAndPosition calculates an anchorIndex. For example: anchorIndex ≈ (scrollOffset / contentSize) * totalRows Step 2 SwiftUICore::resolveIndexAndPosition calculates an anchorPosition. For example: anchorPosition ≈ anchorIndex * (estimatedCellSize + spacing) Step 3 SwiftUI searches for the first visible cell and updates the position of the last laid-out cell (y_max_last_cell). Step 4 (the most important) The layout's correctness validation: Conceptually: d1 = abs(y_last_max - cachedSizeThatFits) d2 = 0.1 * min(y_last_max, cachedSizeThatFits) If: d1 < d2 -> the current CA::Transaction is committed. Otherwise: cachedSizeThatFits = sizeThatFits(...) and the process restarts from Step 1. If logging is enabled via: com.apple.SwiftUI.LazyStackLogging the behavior can be observed in the attached screenshot. Why this may fail The algorithm appears to assume that the estimated cell size does not change dramatically while fast scrolling. However, if the beginning of the list contains very tall cells and the remainder contains much smaller cells, the estimate may become significantly inaccurate. In that situation, comparing cachedSizeThatFits against the position of the last visible cell does not seem sufficient to guarantee a stable result, which may explain the temporary blank screen. Cell Truncation While scrolling upward, the following state can occur (see attached screenshot): SwiftUICore::resolveIndexAndPosition produces: anchorIndex = 2 anchorPosition = -562 The content is translated by 486.47, which corresponds approximately to: estimatedCellSize * 2 As a result, the effective anchor position becomes: -76.32 and the first 0...1 cells are truncated. Possible Solution Blank screen's problem My assumption is that the current layout validation criteria may not be sufficient in all cases. An alternative approach could be to always fill the visible region sequentially: top → bottom while scrolling downward bottom → top while scrolling upward With such a strategy, the layout result could potentially be committed immediately once the visible area is fully covered by realized cells. Cell's Truncation For the truncation issue, it seems that the current translation-based approach may be the source of the problem. One possible alternative would be to use a contentInset-based adjustment combined with clipping against the first visible cell's minY. In that model, negative inset values would not necessarily be problematic, and the visible content could remain correctly aligned. What do you think about this?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
2
Views
435
Activity
4d
Siri “Found in Apps” Messenger contact suggestion change into raw metadata
Hey guys, just after some possible answers. Why might’ve a Siri “Found in Apps” Messenger contact suggestion change into raw metadata and then create a second clean suggestion? Device: iPhone 14 iOS 17 Occurred sometime around 2023–2024 The issue involved one unsaved Siri Suggested Contact under “Found in Apps” from Facebook Messenger. The sequence was: A normal Siri suggestion appeared: Messenger: name redacted Months later, that same suggested contact no longer displayed normally. Instead, it showed what looked like raw metadata while still being labelled as Messenger: Messenger: HQ_UPhdmaAMnPegcbDmgaAMfH_PPf-PtSVXehqahXZOUgA;x-userid=PR:HQ_UPhdmaAMnPegcbDmgaAMfH_PPfPtSVXehqahXZOUgA;x-displayname=name redacted;x-teamidentifier=V9WTTPBFK9;x-bundleidentifiers=com.facebook.Messenger;x-apple:PR%3AHQ_UPhdmaAMnPegcbDmgaAMfH_PPfPtSVXehqahXZOUgA After this occurred, another Siri “Found in Apps” suggestion appeared underneath: Messenger: name redacted The new entry appeared normal, while the older entry continued to show the raw metadata string. I have only seen this happen with this one contact. Other Messenger Siri suggestions display normally. My questions: What would cause a Siri “Found in Apps” suggestion to display the underlying metadata/social profile fields instead of the normal app name and contact name? Why would iOS create another clean “Messenger: Name” suggestion afterwards instead of replacing the malformed entry? Is this likely related to Siri Suggestions indexing, Contacts framework social profile data, Core Spotlight, or Messenger’s app integration? Could this happen from stale cached data or a re-indexing event after an app/iOS update? I am mainly trying to understand the technical reason for the duplicate entries and the raw metadata display, and why it may have only affected this one Siri suggested contact, not the dozen others I had as well.
Topic: UI Frameworks SubTopic: AppKit
Replies
0
Boosts
0
Views
231
Activity
4d
EKEventEditViewController broken in iOS 27 Beta
UIKit app can not edit an event using EKEventEditViewController in iOS 27 Betas. The Done tick button at the top does not work after editing an event. Also does not work if EKEventViewController is first used to display the event. Then the "Edit" tapped to display the EKEventEditViewController. Anyone else seeing this?
Replies
3
Boosts
0
Views
288
Activity
4d
SwiftUI Button with Image view label has smaller hit target
[Also submitted as FB20213961] SwiftUI Button with a label: closure containing only an Image view has a smaller tap target than buttons created with a Label or the convenience initializer. The hit area shrinks to the image bounds instead of preserving the standard minimum tappable size. SCREEN RECORDING On a physical device, the difference is obvious—it’s easy to miss the button. Sometimes it even shows the button-tapped bounce animation but doesn’t trigger the action. SYSTEM INFO Xcode Version 26.0 (17A321) macOS 15.6.1 (24G90) iOS 26.0 (23A340) SAMPLE CODE The following snippet shows the difference in hit targets between the convenience initializer, a Label, and an Image (the latter two in a label: closure). // ✅ Hit target is entire button Button("Button 1", systemImage: "1.square.fill") { print("Button 1 tapped") } // ✅ Hit target is entire button Button { print("Button 2 tapped") } label: { Label("Button 2", systemImage: "2.square.fill") } // ❌ Hit target is smaller than button Button { print("Button 3 tapped") } label: { Image(systemName: "3.square.fill") }
Replies
7
Boosts
4
Views
781
Activity
5d
SwiftUI animation is laggy in NSStatusItem since macOS 26 Tahoe
My app is a bit of a special case and relies on a custom view in a NSStatusItem. I use a NSHostingView and add it as a subview to my NSStatusItem's .button property. Since macOS 26 Tahoe, even simple animations like a .frame change of a Circle won't animate smoothly even though the same SwiftUI animates normally in a WindowGroup. class AppDelegate: NSObject, NSApplicationDelegate { private let statusItem: NSStatusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) func applicationDidFinishLaunching(_ aNotification: Notification) { let subview = NSHostingView(rootView: AnimationView()) let view = self.statusItem.button view?.addSubview(subview) subview.translatesAutoresizingMaskIntoConstraints = false guard let view = view else { return } NSLayoutConstraint.activate([ subview.centerXAnchor.constraint(equalTo: view.centerXAnchor), subview.centerYAnchor.constraint(equalTo: view.centerYAnchor), subview.widthAnchor.constraint(equalToConstant: 22), subview.heightAnchor.constraint(equalToConstant: 22) ]) } } struct AnimationView: View { @State private var isTapped = false @State private var size: CGSize = .init(width: 4, height: 4) var body: some View { Circle() .fill(.pink) .frame(width: size.width, height: size.height) .frame(width: 20, height: 20) // .frame(maxHeight: .infinity) // .padding(.horizontal, 9) // .frame(height: 22) .contentShape(Rectangle()) // .background(Color.blue.opacity(0.5)) .onTapGesture { withAnimation(.interactiveSpring(response: 0.85, dampingFraction: 0.26, blendDuration: 0.45)) { // withAnimation(.spring()) { if isTapped { size = .init(width: 4, height: 4) } else { size = .init(width: 16, height: 16) } } isTapped.toggle() }} } Example project: https://app.box.com/s/q28upunrgkxyyd97ovslgud9yitqaxfk
Replies
1
Boosts
0
Views
218
Activity
5d
Tab bar animates from first tab to restored selection at launch with .tabBarMinimizeBehavior(.onScrollDown)
[Submitted as FB23998635] On iPhone, applying .tabBarMinimizeBehavior(.onScrollDown) to a SwiftUI TabView causes the native tab bar to briefly show the first declared tab before animating to the already-restored selection during app launch. The selected tab is persisted with @AppStorage and is already restored before the TabView is presented. The sample contains no explicit animations, transactions, navigation containers, loading states, asynchronous work, or post-launch selection changes. Removing .tabBarMinimizeBehavior(.onScrollDown) eliminates the launch animation entirely. Likewise, starting with .tabBarMinimizeBehavior(.never) and changing it to .onScrollDown after a one-second delay also eliminates the issue. The behavior reproduces with three simple tabs and a direct @AppStorage selection binding. ENVIRONMENT • iOS 26 & 27 REPRO STEPS Build and run the attached sample. Select the "Two" tab. Force-quit the app. Relaunch the app. Observe the tab bar during launch. ACTUAL The tab indicator initially appears on "One", the first declared tab, then animates to the correctly restored "Two" selection. EXPECTED The restored tab should be selected and stationary from the first visible frame, with no launch animation. SAMPLE CODE struct ContentView: View { private enum AppTab: String, Hashable { case one case two case three } @AppStorage("selectedGenericTab") private var selectedTab: AppTab = .three var body: some View { TabView(selection: $selectedTab) { Tab("One", systemImage: "1.circle", value: AppTab.one) { ReproTabContent(title: "One", color: .orange) } Tab("Two", systemImage: "2.circle", value: AppTab.two) { ReproTabContent(title: "Two", color: .blue) } Tab("Three", systemImage: "3.circle", value: AppTab.three) { ReproTabContent(title: "Three", color: .green) } } .tabBarMinimizeBehavior(.onScrollDown) } } private struct ReproTabContent: View { let title: String let color: Color var body: some View { ZStack { color.opacity(0.2) .ignoresSafeArea() Text(title) .font(.largeTitle) } } }
Replies
2
Boosts
0
Views
382
Activity
5d
UISearchController text field not receiving touches when another UISearchController is attached to navigationItem.searchController on iOS 26
On iOS 26, UISearchController becomes non-interactive when presenting a second UISearchController from another tab of a UITabBarController. let tabBar = UITabBarController() let first = FirstViewController() first.title = "First" let second = SecondViewController() second.title = "Second" let nav1 = UINavigationController(rootViewController: first) let nav2 = UINavigationController(rootViewController: second) nav1.tabBarItem = UITabBarItem( title: "First", image: nil, tag: 0 ) nav2.tabBarItem = UITabBarItem( title: "Second", image: nil, tag: 1 ) tabBar.viewControllers = [ nav1, nav2 ] The app has two tabs. Each tab has its own UINavigationController. Tab 1: A UISearchController is assigned to navigationItem.searchController. class FirstViewController: UIViewController { private let searchController = UISearchController( searchResultsController: nil ) override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground searchController.obscuresBackgroundDuringPresentation = false searchController.searchResultsUpdater = self navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false definesPresentationContext = true } } Tab 2: A button presents another UISearchController using present(_:animated:). class SecondViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground let button = UIButton( type: .system ) button.setTitle( "Open Search", for: .normal ) button.addTarget( self, action: #selector(openSearch), for: .touchUpInside ) button.translatesAutoresizingMaskIntoConstraints = false view.addSubview(button) NSLayoutConstraint.activate([ button.centerXAnchor.constraint( equalTo: view.centerXAnchor ), button.centerYAnchor.constraint( equalTo: view.centerYAnchor ) ]) definesPresentationContext = true } @objc private func openSearch() { let searchController = UISearchController( searchResultsController: nil ) navigationController?.present( searchController, animated: true ) } } On iOS 17 and iOS 18 this works correctly. On iOS 26: The search controller appears. The Cancel button works. The search text field cannot receive touches and does not become first responder. If I remove: navigationItem.searchController = searchController from Tab 1, the search controller in Tab 2 works correctly. This looks like a UIKit regression introduced in iOS 26.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
1
Boosts
0
Views
82
Activity
5d
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
6
Boosts
3
Views
889
Activity
5d
Unable to use AppIntents
Hi, I'm trying to add Shortcuts using AppIntents but unable to get past this error: 'AppShortcutsProvider' property 'appShortcuts' requires builder syntax This is the AppShortcutsProvider struct: import AppIntents struct MyAppShortcuts: AppShortcutsProvider { @AppShortcutsBuilder static var appShortcuts: [AppShortcut] { AppShortcut( intent: OpenDashboardIntent(), phrases: [ "Open dashboard in \(.applicationName)", "Show my \(.applicationName) dashboard" ], shortTitle: "Open Dashboard", systemImageName: "square.grid.2x2" ) } } And I have only one intent: import AppIntents struct OpenDashboardIntent: AppIntent { static var title: LocalizedStringResource = "Open Dashboard" static var openAppWhenRun: Bool = true @MainActor func perform() async throws -> some IntentResult & ProvidesDialog { return .result(dialog: "Opening dashboard") } } I searched the error online but the fixes were to use @AppShortcutsBuilder and skipping commas in case of registering multiple app intents - I'm already following all that. What am I missing? Thanks.
Replies
0
Boosts
0
Views
270
Activity
6d
Inspector Panel Visual UI
How can I get the inspector panel on the Mac to be respected by the toolbar? In Xcode and Pages, the inspector panel runs the entire length of the app so that everything slides over when it's invoked. But in my testing, the toolbar always overlaps the inspector. import SwiftUI @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var selectedItem: String? = "Page 1" @State private var inspectorVisible = true let items = ["Page 1", "Page 2", "Page 3"] var body: some View { NavigationSplitView { List(items, id: \.self, selection: $selectedItem) { item in Label(item, systemImage: "doc") } } detail: { Text(selectedItem ?? "Nothing selected") .font(.title2) .foregroundStyle(.secondary) .inspector(isPresented: $inspectorVisible) { List { Section("Properties") { LabeledContent("Width", value: "100") LabeledContent("Height", value: "200") } Section("Style") { LabeledContent("Color", value: "Blue") LabeledContent("Opacity", value: "100%") } } .scrollContentBackground(.hidden) } } .toolbar { ToolbarItemGroup(placement: .principal) { Button("Draw", systemImage: "pencil") {} Button("Shape", systemImage: "circle") {} Button("Text", systemImage: "textformat") {} } ToolbarItem () { Button("Share", systemImage: "square.and.arrow.up") {} } ToolbarItem() { Button("Inspector", systemImage: "sidebar.right") { inspectorVisible.toggle() } } } .navigationTitle("My Project") } } #Preview { ContentView() .frame(width: 1100, height: 600) }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
241
Activity
1w
Distinguishing background from user app launches
When adopting the Scene Delegate, the applicationState changes from indicating app state to indicating scene state. I previously used this as a signal to determine whether my iOS app was launched in the background or launched by the user. Given the change, it seems like applicationState should no longer be used in that manner in the App Delegate. Would you recommend using UIApplication.shared.backgroundTimeRemaining to distinguish a background launch from a user launch? assuming this is a very large value for user launches. Are there corner cases that I may not expect?
Replies
1
Boosts
0
Views
391
Activity
1w
Can't Drag and Drop a file promise into /tmp
This happens with my own code as well as with the Apple example code here: Supporting Drag and Drop Through File Promises When dragging a file promise, the above example code will fail if the destination is in /tmp. It will print out the following message to the console: An error occurred while attempting to get a unique promise file URL. Error: Did not receive a valid URL. It doesn't seem to fail if you create a directory inside /tmp and drop into that. But dropping in /tmp fails 100% of the time. And it fails for MacOS Versions from Sequoia all the way up to the most recent Golden Gate beta. Using /tmp as a destination should most certainly be allowed, but if for some reason it isn't, is there any way in my own code to detect the drop destination and perhaps warn the user that they need to drop somewhere else? To reproduce this error, use the following steps: Download the Apple example code from the link above Open the project in Xcode, build it, and run it Drag any image into the example app's main window Open a Finder window and navigate to /tmp Drag the image from the example app into the /tmp directory in the Finder window. You will see the above error in the Xcode console and the drop will fail.
Topic: UI Frameworks SubTopic: AppKit
Replies
0
Boosts
0
Views
312
Activity
1w