Search results for

“swiftui”

17,492 results found

Post

Replies

Boosts

Views

Activity

Reply to Glass effect interactive effect issue when used with concentric shapes
@kamilochel Thanks for the post, any chance you can create a new thread with those images, description and provide the full code of your view as I only see the children code .glassEffect only applies the shape mask and edge highlights to the glass material itself. The interactive highlight (the surface hover effect) calculates its own boundary based on the view's hit-testing shape, which often defaults to a capsule or standard rectangle if it encounters highly rounded corners without an explicit content shape. But I would appreciate if in a new thread you can provide the full code for SwiftUI engineers to help you with that effect. Thanks Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’26
iOS 26 rendering gap on scroll surfaces — lower scroll view does not render
On iOS 26 (26.0–26.5), a rectangular region in the lower half of the screen sometimes does not render while the content underneath remains laid out and interactive — scrolling works, hit testing succeeds, and rows visibly emerge from behind the floating tab bar as you scroll. This is a render-server / compositor gap, not a layout or safe-area issue. We see it on both UIKit and SwiftUI scroll surfaces inside the same UITabBarController: UIKit: UICollectionView with UICollectionViewFlowLayout (sectionInsetReference = .fromSafeArea) SwiftUI: List(.plain) nested in TabView(.page) inside a UIHostingController Confirmed on iPhone 16 Pro, iPhone 17 Pro, iPhone 13 Pro Max. Community threads (linked below) report the same symptom in Messages, Notes, Safari, Mail, and the App Store. Questions for Apple Is this acknowledged as an OS-level regression, and is a fix targeted for an upcoming iOS 26.x release? Is there a deterministic repro? We've tried background/foreground cycles, push notifications mid-s
2
0
818
May ’26
xcodebuild test (CLI) does not sync .storekit to storekitd on iOS 26.5 — SKTestSession unusable in CI
On iOS 26.5 simulator runtime, running UI tests via xcodebuild test from the command line does not push the scheme's StoreKitConfigurationFileReference to the destination simulator's storekitd AppGroup Octane container. As a consequence, SKTestSession(configurationFileNamed:) either silently falls through to the production App Store (surfacing a Sign in to Apple Account SpringBoard alert during paywall tests), or throws SKInternalErrorDomain Code=3 Error saving configuration file if you call any SKTestSession instance method. The same project, same scheme, same .storekit file works correctly when launched via Xcode IDE (Cmd+R / Cmd+U) — which uses DVTDevice.handleStoreKitConfigurationSyncForBundleID:configurationFilePath: via an internal IDELaunchSession XPC path that the public xcodebuild CLI does not invoke. This regression makes StoreKit Test unusable in CI for any project using xcodebuild test or xcodebuild test-without-building against an iOS 26.5 simulator. Environment macOS: 26.x Xcode: 26.4.1 (25E253)
7
0
1.3k
May ’26
SwiftUI Liquid Glass Menu briefly turns black after dismissing before returning to transparent glass
Hi, I’m seeing a visual issue with a SwiftUI Menu styled with Liquid Glass on iOS 26. I have a top bar control where a Menu is inside a GlassEffectContainer. The menu label uses .glassEffect(.regular.interactive()), glassEffectID, and glassEffectUnion. The control normally looks translucent, matching the background correctly. But when I open the menu and then dismiss it, the glass control briefly becomes solid black for a moment before returning to the expected transparent/glass appearance. This is visible especially on a colorful/blurred background: Before opening the menu: the control is transparent Liquid Glass. Open the SwiftUI Menu. Dismiss the menu. The menu label/control briefly renders as a black pill. After a short delay, it returns to the correct transparent glass style. Here is the simplified structure: @Namespace private var namespace GlassEffectContainer(spacing: 18) { VStack(spacing: 4) { Menu { Button { selectedMode = .automatic } label: { Label(Automatic, systemImage: wand.an
2
0
568
May ’26
Reply to AVAudioSession gets interrupted when closing a window
I have the same issue in visionOS 26, but in the context of the SwiftUI pushWindow API. Repro steps: App launches with window A visible. Window A users AVAudioPlayer to play continuous background audio. The app calls pushWindow, presenting window B. The audio stops. At this point AVAudioSession.interruptionNotification is received twice. A workaround is to resume the audio when AVAudioSession.interruptionNotification is received. This sounds glitchy.
Topic: Spatial Computing SubTopic: General Tags:
May ’26
Reply to Inexplicable Metal crash ever since iOS 26.5 beta 4
Thanks for posting and for sharing the repo — being able to look at the actual code makes a real difference here. The phone-restart class of crash matters. App-level Metal exceptions normally crash the app, not the device. A full phone reboot from a compute shader means whatever's failing crossed out of user-space into the GPU driver or kernel. That can happen two ways: A driver-side bug provoked by some specific user-space pattern, which would be a Metal/driver issue Apple needs to address. Memory corruption in your app — for example, an over-write of an MTLBuffer's contents past its allocated size, a stale gpuResourceID for a resource that's been freed, a race between threads populating argument-table entries, or wrong format/stride assumptions — that lands the GPU on garbage data and the driver panics. Allocator layouts and hardening change between iOS versions, so a dormant memory issue under beta 3 can become a reliable kernel panic under beta 4. The worked, then stopped working timing fits this case too
Topic: Graphics & Games SubTopic: Metal Tags:
May ’26
Reply to SwiftUI template in Instruments 26.4.1 shows empty channels on iOS 26.4.2 device — even with a minimal TimelineView repro
Hi there, Thanks for reaching out. That is certainly unexpected - you are doing everything correctly. It seems that the presence of SwiftUI recording is making the entire file captured invalid for some reason. To investigate this issue further, could you please file a feedback with iOS sysdiagnose attached? Additionally, please go to Instruments Settings and click 'Attach supporting files', record again, attach .trace file to the feedback report. This should give us enough diagnostics to understand your issue further and fix it. Thanks, Kacper
May ’26
SwiftUI Canvas ring animation briefly rotates backward after app returns from background
Hi, I have a SwiftUI work time screen with a rotating ring (60 tick marks, Canvas-based). While the app stays in foreground, rotation is fine. After the app is in background for a while and comes back to foreground, I consistently see one visual glitch: the ring makes one very short step in the opposite direction once then continues rotating clockwise normally So this is not a crash, only a visual reverse tick on resume. What I expect: no direction change after foreground resume continuous clockwise motion What I already tried: withAnimation(.linear(...).repeatForever(...)) + restart on scenePhase TimelineView (.animation and .periodic) with time-based angle angle with and without modulo wrapping wall-clock and monotonic time sources rotation via rotationEffect and also via Canvas geometry warmup delays after resume restoring original ring visuals (long/short tick marks) The effect is still reproducible. Question: What is the correct SwiftUI approach to implement a continuously rotating ring
0
0
287
May ’26
Update build number automatically
In SwiftUI 6 when developing for MacOS in Xcode 26, there does not seem to be a way to provide an automatic increment of the current build number, i.e. Current Project Version in settings. Does anyone have a solution that works in the latest version of Xcode. i.e. 26? All the solutions that I have tried are based on older versions that involve running scripts to update the build file, (.xcconfig) or the .info.plist file which simply will not work in the current configuration.
0
0
584
May ’26
SwiftData 'simple' migration failing
This is a long post, so let me start with a summary: I am attempting to implement what ought to be a simple SwiftData migration, and am receiving the following fatal error from the ModelContainer initializer: NSCocoaErrorDomain Code=134504 Cannot use staged migration with an unknown model version. The crash occurs both in the Simulator and on a physical device. Both the original schema and the new schema load and run as expected if loaded from scratch — so I conclude the Models are OK; it is the migration from the original schema to the new schema which is the issue. I have reported this as FB22652791 and Technical Incident Case # 19893980. I have two model projects available — one contrived, the other using my actual SwiftData models. Now the Details I am developing a SwiftUI/SwiftData app. I am (currently) using Xcode 26.5-beta-3. I set up an alpha-test build using the following approach: public class DatabaseSchema { public let dbSchema: Schema = Schema([ Model1.self, ... , Model16.self ], version
8
0
1.4k
May ’26
Reply to How to handle all the core AppleEvents
You're right that SwiftUI covers oapp/rapp/odoc/quit natively, plus GURL via the .onOpenURL modifier. For the events you're asking about: Open content — could you clarify which event you mean? If you're thinking of GURL (Open URL / open this URL or content), that's the onOpenURL path. If you mean something else (a custom ocon or app-specific event), let me know and I can answer specifically. Print document (pdoc) — SwiftUI does not route this to NSApplicationDelegate.application(_:printFiles:withSettings:showPrintPanels:). I verified by sending osascript -e 'tell application Test to print POSIX file ...' to test apps using both WindowGroup and DocumentGroup in macOS 26.4 — the delegate method never fired. So the standard delegate path is silent under SwiftUI. The path that does work is registering directly with NSAppleEventManager. Install your handler in applicationWillFinishLaunching: (before any events arrive) and SwiftUI doesn't fight you for ownership: @main struct MyA
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’26
Reply to Glass effect interactive effect issue when used with concentric shapes
@kamilochel Thanks for the post, any chance you can create a new thread with those images, description and provide the full code of your view as I only see the children code .glassEffect only applies the shape mask and edge highlights to the glass material itself. The interactive highlight (the surface hover effect) calculates its own boundary based on the view's hit-testing shape, which often defaults to a capsule or standard rectangle if it encounters highly rounded corners without an explicit content shape. But I would appreciate if in a new thread you can provide the full code for SwiftUI engineers to help you with that effect. Thanks Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’26
iOS 26 rendering gap on scroll surfaces — lower scroll view does not render
On iOS 26 (26.0–26.5), a rectangular region in the lower half of the screen sometimes does not render while the content underneath remains laid out and interactive — scrolling works, hit testing succeeds, and rows visibly emerge from behind the floating tab bar as you scroll. This is a render-server / compositor gap, not a layout or safe-area issue. We see it on both UIKit and SwiftUI scroll surfaces inside the same UITabBarController: UIKit: UICollectionView with UICollectionViewFlowLayout (sectionInsetReference = .fromSafeArea) SwiftUI: List(.plain) nested in TabView(.page) inside a UIHostingController Confirmed on iPhone 16 Pro, iPhone 17 Pro, iPhone 13 Pro Max. Community threads (linked below) report the same symptom in Messages, Notes, Safari, Mail, and the App Store. Questions for Apple Is this acknowledged as an OS-level regression, and is a fix targeted for an upcoming iOS 26.x release? Is there a deterministic repro? We've tried background/foreground cycles, push notifications mid-s
Replies
2
Boosts
0
Views
818
Activity
May ’26
xcodebuild test (CLI) does not sync .storekit to storekitd on iOS 26.5 — SKTestSession unusable in CI
On iOS 26.5 simulator runtime, running UI tests via xcodebuild test from the command line does not push the scheme's StoreKitConfigurationFileReference to the destination simulator's storekitd AppGroup Octane container. As a consequence, SKTestSession(configurationFileNamed:) either silently falls through to the production App Store (surfacing a Sign in to Apple Account SpringBoard alert during paywall tests), or throws SKInternalErrorDomain Code=3 Error saving configuration file if you call any SKTestSession instance method. The same project, same scheme, same .storekit file works correctly when launched via Xcode IDE (Cmd+R / Cmd+U) — which uses DVTDevice.handleStoreKitConfigurationSyncForBundleID:configurationFilePath: via an internal IDELaunchSession XPC path that the public xcodebuild CLI does not invoke. This regression makes StoreKit Test unusable in CI for any project using xcodebuild test or xcodebuild test-without-building against an iOS 26.5 simulator. Environment macOS: 26.x Xcode: 26.4.1 (25E253)
Replies
7
Boosts
0
Views
1.3k
Activity
May ’26
Reply to Drag on a Canvas with XCUICoordinate.press(...)
Glad you got it working — and thanks for posting the resolution. The interaction between XCUICoordinate and SwiftUI's coordinate spaces in the presence of transforms is subtle enough that your write-up will likely help someone else who runs into it.
Replies
Boosts
Views
Activity
May ’26
SwiftUI Liquid Glass Menu briefly turns black after dismissing before returning to transparent glass
Hi, I’m seeing a visual issue with a SwiftUI Menu styled with Liquid Glass on iOS 26. I have a top bar control where a Menu is inside a GlassEffectContainer. The menu label uses .glassEffect(.regular.interactive()), glassEffectID, and glassEffectUnion. The control normally looks translucent, matching the background correctly. But when I open the menu and then dismiss it, the glass control briefly becomes solid black for a moment before returning to the expected transparent/glass appearance. This is visible especially on a colorful/blurred background: Before opening the menu: the control is transparent Liquid Glass. Open the SwiftUI Menu. Dismiss the menu. The menu label/control briefly renders as a black pill. After a short delay, it returns to the correct transparent glass style. Here is the simplified structure: @Namespace private var namespace GlassEffectContainer(spacing: 18) { VStack(spacing: 4) { Menu { Button { selectedMode = .automatic } label: { Label(Automatic, systemImage: wand.an
Replies
2
Boosts
0
Views
568
Activity
May ’26
Reply to AVAudioSession gets interrupted when closing a window
I have the same issue in visionOS 26, but in the context of the SwiftUI pushWindow API. Repro steps: App launches with window A visible. Window A users AVAudioPlayer to play continuous background audio. The app calls pushWindow, presenting window B. The audio stops. At this point AVAudioSession.interruptionNotification is received twice. A workaround is to resume the audio when AVAudioSession.interruptionNotification is received. This sounds glitchy.
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to Inexplicable Metal crash ever since iOS 26.5 beta 4
Thanks for posting and for sharing the repo — being able to look at the actual code makes a real difference here. The phone-restart class of crash matters. App-level Metal exceptions normally crash the app, not the device. A full phone reboot from a compute shader means whatever's failing crossed out of user-space into the GPU driver or kernel. That can happen two ways: A driver-side bug provoked by some specific user-space pattern, which would be a Metal/driver issue Apple needs to address. Memory corruption in your app — for example, an over-write of an MTLBuffer's contents past its allocated size, a stale gpuResourceID for a resource that's been freed, a race between threads populating argument-table entries, or wrong format/stride assumptions — that lands the GPU on garbage data and the driver panics. Allocator layouts and hardening change between iOS versions, so a dormant memory issue under beta 3 can become a reliable kernel panic under beta 4. The worked, then stopped working timing fits this case too
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to SwiftUI template in Instruments 26.4.1 shows empty channels on iOS 26.4.2 device — even with a minimal TimelineView repro
Hi there, Thanks for reaching out. That is certainly unexpected - you are doing everything correctly. It seems that the presence of SwiftUI recording is making the entire file captured invalid for some reason. To investigate this issue further, could you please file a feedback with iOS sysdiagnose attached? Additionally, please go to Instruments Settings and click 'Attach supporting files', record again, attach .trace file to the feedback report. This should give us enough diagnostics to understand your issue further and fix it. Thanks, Kacper
Replies
Boosts
Views
Activity
May ’26
Reply to Textfield with both a formatter and axis
You should be able to use one of the init (e.g., axis) and then set up the format with modifiers. See if this can help: https://mehmetbaykar.com/posts/swiftui-textfield-axis-and-format/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’26
How to disable multiple windows feature of my App on iPadOS?
My app is a SwiftUI lifecycle app. I want to disable its multiple windows feature on iPadOS . I have tried to set the Enable Multiple Scenes option to false in Application Scene Manifest, but it doesn't work.
Replies
0
Boosts
0
Views
237
Activity
May ’26
SwiftUI Canvas ring animation briefly rotates backward after app returns from background
Hi, I have a SwiftUI work time screen with a rotating ring (60 tick marks, Canvas-based). While the app stays in foreground, rotation is fine. After the app is in background for a while and comes back to foreground, I consistently see one visual glitch: the ring makes one very short step in the opposite direction once then continues rotating clockwise normally So this is not a crash, only a visual reverse tick on resume. What I expect: no direction change after foreground resume continuous clockwise motion What I already tried: withAnimation(.linear(...).repeatForever(...)) + restart on scenePhase TimelineView (.animation and .periodic) with time-based angle angle with and without modulo wrapping wall-clock and monotonic time sources rotation via rotationEffect and also via Canvas geometry warmup delays after resume restoring original ring visuals (long/short tick marks) The effect is still reproducible. Question: What is the correct SwiftUI approach to implement a continuously rotating ring
Replies
0
Boosts
0
Views
287
Activity
May ’26
Update build number automatically
In SwiftUI 6 when developing for MacOS in Xcode 26, there does not seem to be a way to provide an automatic increment of the current build number, i.e. Current Project Version in settings. Does anyone have a solution that works in the latest version of Xcode. i.e. 26? All the solutions that I have tried are based on older versions that involve running scripts to update the build file, (.xcconfig) or the .info.plist file which simply will not work in the current configuration.
Replies
0
Boosts
0
Views
584
Activity
May ’26
SwiftData 'simple' migration failing
This is a long post, so let me start with a summary: I am attempting to implement what ought to be a simple SwiftData migration, and am receiving the following fatal error from the ModelContainer initializer: NSCocoaErrorDomain Code=134504 Cannot use staged migration with an unknown model version. The crash occurs both in the Simulator and on a physical device. Both the original schema and the new schema load and run as expected if loaded from scratch — so I conclude the Models are OK; it is the migration from the original schema to the new schema which is the issue. I have reported this as FB22652791 and Technical Incident Case # 19893980. I have two model projects available — one contrived, the other using my actual SwiftData models. Now the Details I am developing a SwiftUI/SwiftData app. I am (currently) using Xcode 26.5-beta-3. I set up an alpha-test build using the following approach: public class DatabaseSchema { public let dbSchema: Schema = Schema([ Model1.self, ... , Model16.self ], version
Replies
8
Boosts
0
Views
1.4k
Activity
May ’26
Reply to ViewBridge to RemoteViewService Terminated (...)
先确认应用是否是前台应用 — 检查 NSApp.isActive、窗口是否在其他应用后面 再确认窗口是否是 key window — 检查 canBecomeKey、isKeyWindow 最后确认控件是否能接收事件 — SwiftUI vs AppKit 的 ViewBridge 冲突
Topic: UI Frameworks SubTopic: AppKit
Replies
Boosts
Views
Activity
May ’26
Reply to How to handle all the core AppleEvents
You're right that SwiftUI covers oapp/rapp/odoc/quit natively, plus GURL via the .onOpenURL modifier. For the events you're asking about: Open content — could you clarify which event you mean? If you're thinking of GURL (Open URL / open this URL or content), that's the onOpenURL path. If you mean something else (a custom ocon or app-specific event), let me know and I can answer specifically. Print document (pdoc) — SwiftUI does not route this to NSApplicationDelegate.application(_:printFiles:withSettings:showPrintPanels:). I verified by sending osascript -e 'tell application Test to print POSIX file ...' to test apps using both WindowGroup and DocumentGroup in macOS 26.4 — the delegate method never fired. So the standard delegate path is silent under SwiftUI. The path that does work is registering directly with NSAppleEventManager. Install your handler in applicationWillFinishLaunching: (before any events arrive) and SwiftUI doesn't fight you for ownership: @main struct MyA
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’26