Search results for

“swiftui”

17,491 results found

Post

Replies

Boosts

Views

Activity

Reply to Code sharing between iOS and watchOS
For the hosting view, use SpriteKit's SwiftUI SpriteView, which renders an SKScene and works on both iOS and watchOS — so you avoid the platform-specific SKView (iOS) vs. WKInterfaceSKScene (watchOS) split. For input, SwiftUI supports the same basic tap/drag gestures on watchOS as on iOS, though you'll often wire them to different in-game actions per platform. There are also inputs unique to watchOS — most notably the Digital Crown via. digitalCrownRotation. To support both cleanly, keep the game logic platform-agnostic and feed it semantic intents rather than raw input. The shared engine never references a touch or the crown — each platform translates its own input into the same intents. e.g. /// The platform-agnostic input vocabulary. Every platform maps its own /// hardware (touches, drags, Digital Crown) onto these cases. public enum GameIntent { case aim(at: CGPoint) // a scene-space point (e.g. iOS drag/tap location) case moveHorizontal(Double) // a relative nudge (e.g. watchOS Digital
Topic: General SubTopic:
Games Technologies Q&A
Jun ’26
Reply to Code sharing between iOS and watchOS
Hi CatastropheZero, For the hosting view, use SpriteKit's SwiftUI SpriteView, which renders an SKScene and works on both iOS and watchOS — so you avoid the platform-specific SKView (iOS) vs. WKInterfaceSKScene (watchOS) split. For input, SwiftUI supports the same basic tap/drag gestures on watchOS as on iOS, though you'll often wire them to different in-game actions per platform. There are also inputs unique to watchOS — most notably the Digital Crown via. digitalCrownRotation. To support both cleanly, keep the game logic platform-agnostic and feed it semantic intents rather than raw input. The shared engine never references a touch or the crown — each platform translates its own input into the same intents. /// hardware (touches, drags, Digital Crown) onto these cases. public enum GameIntent { case aim(at: CGPoint) // a scene-space point (e.g. iOS drag/tap location) case moveHorizontal(Double) // a relative nudge (e.g. watchOS Digital Crown delta) case primaryAction // fire / jump / select
Topic: General SubTopic:
Games Technologies Q&A
Jun ’26
Reply to How do I control a SwiftUI TextField with a game controller?
Hi dfabulich The Game Controller framework enables your application to receive inputs from connected physical game controllers, as well as from touch controllers built with the Touch Controller framework. The inputs the Game Controller framework delivers to your application reflect the button presses, thumbstick movements, etc of the physical game controller (or touch controller). They are not 'events' (in the AppKit or UIKit sense), and do not flow through the responder chain where views or gesture recognizers can act on them. Now to your specific questions: I would like to add support for game controllers on iPhone. I can't figure out how to do it. I'm afraid there is no out-of-the-box functionality for this today on macOS, iOS, or visionOS. Your application can use the Game Controller framework to receive inputs from connected game controllers. But you will need to implement the logic that interprets those inputs into updates to your user interface - sometimes called a focus engine. A minimal focus engine
Topic: General SubTopic:
Games Technologies Q&A
Jun ’26
How do I control a SwiftUI TextField with a game controller?
I've coded a text-adventure game in SwiftUI. (My game has no graphics or sound effects.) My app already supports keyboard navigation; I would like to add support for game controllers on iPhone. I can't figure out how to do it. I especially can't see any way to allow controller users to enter text in a TextField. I've read https://developer.apple.com/documentation/gamecontroller/supporting-game-controllers and it's all about button events. There's no reference to SwiftUI at all in that documentation, or any input-method editing at all. The only mention of keyboard is about treating the keyboard itself as if it were a game controller providing button events. How do I implement this?
1
0
567
Jun ’26
Reply to Display state of iCloud files
First, I'd like to note this excerpt from the CKAsset documentation: When you fetch a record that contains an asset, CloudKit stores the asset’s data in a staging area accessible to your app. Use the asset’s fileURL property to access its staged location. The system regularly deletes files in the staging area to reclaim disk space. To avoid this behavior, move the data into your app’s container as soon as you fetch it. As you read (sync/query/fetch) CKRecords, you'll be updating your on-device database noting the presence of that data as it's downloaded, and you'll need to move the CKAsset files (e.g. thumbnail and any other image derivatives) into your app container. Your on-device database can then be used to feed your user interface, including whether a record has a thumbnail, etc. Since I'm not an expert in it, I won't speak to the best ways to efficiently render large sets of data that potentially have file-backed content, but presumably SwiftUI has solutions for this.
Topic: iCloud SubTopic:
iCloud & CloudKit Q&A
Jun ’26
SwiftUI - How to beggin as an Android Developer
As someone coming from Android development, I’m trying to learn how to think the SwiftUI way. For beginners building real-world apps, what mental models matter most around state management, navigation, and structuring screens so the app can scale as it grows?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
56
Jun ’26
Question on PCS Zone corruption recovery
Hi all - figured I would kick off with a CloudKit question. Recently in development of a multi-device app I got into a state where all iOS devices could not write to the (production) CloudKit container - however macOS could still write (multi-device SwiftUI code). After ruling out a lot of other things it seemed like there had been some corruption in the production zone's PCS key chain. The only fix was deleting the zone from the CloudKit Console (safe for my pre-release beta data, but destructive). Is there a safer or developer-accessible recovery path for PCS chain corruption? Is this situation detectable earlier, or is there guidance on avoiding it during pre-release testing? The error in the logs in this scenario had overallStatus:USER_ERROR, error:BAD_REQUEST, returnedRecordTypes:_pcs_data.
1
0
509
Jun ’26
Reply to How to present a View above everything in SwiftUI?
Hello @DTS Engineer, Thank you for answering. I'll try to explain a little bit more the end result I want. Basically, something like what Apple uses for the Silent Mode floating pill/indicator at the top of the screen. Something I could use in my app to indicate success/errors/confirmations when some actions are performed by the user. Let say an action is performed in the SheetContentView, I want to immediately present the indicator while also dismissing the sheet. I dismiss the sheet I want the PillNotificationView to stay visible, on top of everything. So it can't be an overlay/ZStack to the SheetContentView, and it can't be an overlay/ZStack to the MyView. Regarding the code (this does not work as explained above because the PillNotificationView is overlaid to the MyView due to the ZStack) ZStack { MyView() if isPillPresented { PillNotificationView() } } .sheet(isPresented: $isPresentingSheet) { SheetContentView() } I want the view to be presented only once either above everything (no matter if the top vie
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’26
New document reader app deciding WebKit versus SwiftUI with a11y as tiebreaker
I'm working on a document reader for long form articles and I love what WebKit gives me for quickly delivering good looking content. But I'm hearing that accessibility support is stronger if I go with UIKit or SwiftUI. Accessibility support is meant to be a headline feature in my app so it's the deciding factor on which technology I should use (webview versus UIKit/SwiftUI). Given Accessibility Reader now provides system-wide reflow and spoken reading, is there now a durable reason a document reader developer should still invest in native UIKit/SwiftUI rendering rather than well-structured HTML in a webview? Where specifically does the system stop helping webview content? What I've heard is that webviews are disadvantaged on custom rotors, focus, and Dynamic Type fidelity. Is this accurate or has it changed this year? Bottom line, I'm wondering if WebKit is a compromise for a11y if I want not baseline accessibility, but truly leading unsurpassed accessibility.
Topic: Safari & Web SubTopic: General Tags:
0
0
376
Jun ’26
Reply to Curved windows in visionOS 27
visionOS 27 - enabling curved windows Short answer: there is a private Info.plist key that Safari uses for this, but as far as I can tell it is not honored for third-party apps (especially SwiftUI-lifecycle ones). It looks first-party gated. Here is what I found reverse-engineering the visionOS 27 SDK and the simulator runtime. 1. The key Safari sets MobileSafari.app/Info.plist on visionOS 27 contains a PreferredWindowCurvature entry, nested inside UILaunchPlacementParameters (the same dict that holds PreferredLaunchSize). This key is new in 27 - it does not exist in the 26.5 Safari Info.plist. UILaunchPlacementParameters PreferredLaunchSize Width940 Height916 PreferredWindowCurvature Enabled The accepted string values (from the MRUIWindowCurvature enum in MRUIKit) are: Default | Automatic | Enabled | Disabled Practical note: UILaunchPlacementParameters is a nested dictionary, so you cannot express it via INFOPLIST_KEY_* build settings. With GENERATE_INFOPLIST_FILE = YES you have to point INFOPLI
Topic: Spatial Computing SubTopic: General Tags:
Jun ’26
How to present a View above everything in SwiftUI?
Hello, I'm trying to present an app overlay (like an HUD) that should appear on top of everything (the app UI could be the root content view or a modal presented from the content view or a modal over a modal presented from the content view, etc.). If I use a ZStack for example, the issue is that the view is not visible if the ZStack is presenting a modal for example. In UIKit, I think we can use instantiate another UIWindow to show content above the top window of the app (what a native alert does if I'm not wrong). What would be the equivalent in SwiftUI? How could I create this? Thanks, Axel
2
0
221
Jun ’26
Live Activity sleep timer without push
My app has a sleep timer (up to 12 hours). Can I drive a Live Activity countdown in the Dynamic Island purely from the foreground/background app process using Activity.update(), without requiring a push notification server? And does Text(timerInterval:) in SwiftUI continue counting down accurately when the app process is suspended by the OS?
0
0
230
Jun ’26
Reply to AUv3 UI issues on Desktop / Logic Pro for Mac
Hi. That sounds unexpected! Was this a SwiftUI front-end ? Could you please try to put together a minimal sample-AU that reproduces this problem ? That would help us diagnose and fix this issue. Please be sure to file a feedback request on https://feedbackassistant.apple.com Thank you!
Topic: Audio SubTopic:
Audio Q&A
Jun ’26
microphone level monitoring
My macOS app provides real-time microphone level monitoring, and I also have a macOS widget that shows recent audio level status. Since WidgetKit widgets are snapshot/timeline based rather than continuously live SwiftUI views, is there any new capability in macOS 27 that allows a widget to show more responsive or animated audio-level changes? If true real-time animation is still not supported in widgets, what is Apple’s recommended approach for displaying frequently changing signal levels, such as audio meters, in a macOS widget?
2
0
369
Jun ’26
Reply to Building AUv3's?
Can you please clarify what you mean by more modern? The AUv3 template that comes bundled with Xcode gets modernized regularly embracing the latest changes, such as SwiftUI and C++-Swift-interoperability. That would be the recommended way to build an AUv3.
Topic: Audio SubTopic:
Audio Q&A
Jun ’26
Reply to Code sharing between iOS and watchOS
For the hosting view, use SpriteKit's SwiftUI SpriteView, which renders an SKScene and works on both iOS and watchOS — so you avoid the platform-specific SKView (iOS) vs. WKInterfaceSKScene (watchOS) split. For input, SwiftUI supports the same basic tap/drag gestures on watchOS as on iOS, though you'll often wire them to different in-game actions per platform. There are also inputs unique to watchOS — most notably the Digital Crown via. digitalCrownRotation. To support both cleanly, keep the game logic platform-agnostic and feed it semantic intents rather than raw input. The shared engine never references a touch or the crown — each platform translates its own input into the same intents. e.g. /// The platform-agnostic input vocabulary. Every platform maps its own /// hardware (touches, drags, Digital Crown) onto these cases. public enum GameIntent { case aim(at: CGPoint) // a scene-space point (e.g. iOS drag/tap location) case moveHorizontal(Double) // a relative nudge (e.g. watchOS Digital
Topic: General SubTopic:
Games Technologies Q&A
Replies
Boosts
Views
Activity
Jun ’26
Reply to Code sharing between iOS and watchOS
Hi CatastropheZero, For the hosting view, use SpriteKit's SwiftUI SpriteView, which renders an SKScene and works on both iOS and watchOS — so you avoid the platform-specific SKView (iOS) vs. WKInterfaceSKScene (watchOS) split. For input, SwiftUI supports the same basic tap/drag gestures on watchOS as on iOS, though you'll often wire them to different in-game actions per platform. There are also inputs unique to watchOS — most notably the Digital Crown via. digitalCrownRotation. To support both cleanly, keep the game logic platform-agnostic and feed it semantic intents rather than raw input. The shared engine never references a touch or the crown — each platform translates its own input into the same intents. /// hardware (touches, drags, Digital Crown) onto these cases. public enum GameIntent { case aim(at: CGPoint) // a scene-space point (e.g. iOS drag/tap location) case moveHorizontal(Double) // a relative nudge (e.g. watchOS Digital Crown delta) case primaryAction // fire / jump / select
Topic: General SubTopic:
Games Technologies Q&A
Replies
Boosts
Views
Activity
Jun ’26
Reply to How do I control a SwiftUI TextField with a game controller?
Hi dfabulich The Game Controller framework enables your application to receive inputs from connected physical game controllers, as well as from touch controllers built with the Touch Controller framework. The inputs the Game Controller framework delivers to your application reflect the button presses, thumbstick movements, etc of the physical game controller (or touch controller). They are not 'events' (in the AppKit or UIKit sense), and do not flow through the responder chain where views or gesture recognizers can act on them. Now to your specific questions: I would like to add support for game controllers on iPhone. I can't figure out how to do it. I'm afraid there is no out-of-the-box functionality for this today on macOS, iOS, or visionOS. Your application can use the Game Controller framework to receive inputs from connected game controllers. But you will need to implement the logic that interprets those inputs into updates to your user interface - sometimes called a focus engine. A minimal focus engine
Topic: General SubTopic:
Games Technologies Q&A
Replies
Boosts
Views
Activity
Jun ’26
How do I control a SwiftUI TextField with a game controller?
I've coded a text-adventure game in SwiftUI. (My game has no graphics or sound effects.) My app already supports keyboard navigation; I would like to add support for game controllers on iPhone. I can't figure out how to do it. I especially can't see any way to allow controller users to enter text in a TextField. I've read https://developer.apple.com/documentation/gamecontroller/supporting-game-controllers and it's all about button events. There's no reference to SwiftUI at all in that documentation, or any input-method editing at all. The only mention of keyboard is about treating the keyboard itself as if it were a game controller providing button events. How do I implement this?
Replies
1
Boosts
0
Views
567
Activity
Jun ’26
Reply to Display state of iCloud files
First, I'd like to note this excerpt from the CKAsset documentation: When you fetch a record that contains an asset, CloudKit stores the asset’s data in a staging area accessible to your app. Use the asset’s fileURL property to access its staged location. The system regularly deletes files in the staging area to reclaim disk space. To avoid this behavior, move the data into your app’s container as soon as you fetch it. As you read (sync/query/fetch) CKRecords, you'll be updating your on-device database noting the presence of that data as it's downloaded, and you'll need to move the CKAsset files (e.g. thumbnail and any other image derivatives) into your app container. Your on-device database can then be used to feed your user interface, including whether a record has a thumbnail, etc. Since I'm not an expert in it, I won't speak to the best ways to efficiently render large sets of data that potentially have file-backed content, but presumably SwiftUI has solutions for this.
Topic: iCloud SubTopic:
iCloud & CloudKit Q&A
Replies
Boosts
Views
Activity
Jun ’26
SwiftUI - How to beggin as an Android Developer
As someone coming from Android development, I’m trying to learn how to think the SwiftUI way. For beginners building real-world apps, what mental models matter most around state management, navigation, and structuring screens so the app can scale as it grows?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
56
Activity
Jun ’26
Question on PCS Zone corruption recovery
Hi all - figured I would kick off with a CloudKit question. Recently in development of a multi-device app I got into a state where all iOS devices could not write to the (production) CloudKit container - however macOS could still write (multi-device SwiftUI code). After ruling out a lot of other things it seemed like there had been some corruption in the production zone's PCS key chain. The only fix was deleting the zone from the CloudKit Console (safe for my pre-release beta data, but destructive). Is there a safer or developer-accessible recovery path for PCS chain corruption? Is this situation detectable earlier, or is there guidance on avoiding it during pre-release testing? The error in the logs in this scenario had overallStatus:USER_ERROR, error:BAD_REQUEST, returnedRecordTypes:_pcs_data.
Replies
1
Boosts
0
Views
509
Activity
Jun ’26
Reply to How to present a View above everything in SwiftUI?
Hello @DTS Engineer, Thank you for answering. I'll try to explain a little bit more the end result I want. Basically, something like what Apple uses for the Silent Mode floating pill/indicator at the top of the screen. Something I could use in my app to indicate success/errors/confirmations when some actions are performed by the user. Let say an action is performed in the SheetContentView, I want to immediately present the indicator while also dismissing the sheet. I dismiss the sheet I want the PillNotificationView to stay visible, on top of everything. So it can't be an overlay/ZStack to the SheetContentView, and it can't be an overlay/ZStack to the MyView. Regarding the code (this does not work as explained above because the PillNotificationView is overlaid to the MyView due to the ZStack) ZStack { MyView() if isPillPresented { PillNotificationView() } } .sheet(isPresented: $isPresentingSheet) { SheetContentView() } I want the view to be presented only once either above everything (no matter if the top vie
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’26
New document reader app deciding WebKit versus SwiftUI with a11y as tiebreaker
I'm working on a document reader for long form articles and I love what WebKit gives me for quickly delivering good looking content. But I'm hearing that accessibility support is stronger if I go with UIKit or SwiftUI. Accessibility support is meant to be a headline feature in my app so it's the deciding factor on which technology I should use (webview versus UIKit/SwiftUI). Given Accessibility Reader now provides system-wide reflow and spoken reading, is there now a durable reason a document reader developer should still invest in native UIKit/SwiftUI rendering rather than well-structured HTML in a webview? Where specifically does the system stop helping webview content? What I've heard is that webviews are disadvantaged on custom rotors, focus, and Dynamic Type fidelity. Is this accurate or has it changed this year? Bottom line, I'm wondering if WebKit is a compromise for a11y if I want not baseline accessibility, but truly leading unsurpassed accessibility.
Topic: Safari & Web SubTopic: General Tags:
Replies
0
Boosts
0
Views
376
Activity
Jun ’26
Reply to Curved windows in visionOS 27
visionOS 27 - enabling curved windows Short answer: there is a private Info.plist key that Safari uses for this, but as far as I can tell it is not honored for third-party apps (especially SwiftUI-lifecycle ones). It looks first-party gated. Here is what I found reverse-engineering the visionOS 27 SDK and the simulator runtime. 1. The key Safari sets MobileSafari.app/Info.plist on visionOS 27 contains a PreferredWindowCurvature entry, nested inside UILaunchPlacementParameters (the same dict that holds PreferredLaunchSize). This key is new in 27 - it does not exist in the 26.5 Safari Info.plist. UILaunchPlacementParameters PreferredLaunchSize Width940 Height916 PreferredWindowCurvature Enabled The accepted string values (from the MRUIWindowCurvature enum in MRUIKit) are: Default | Automatic | Enabled | Disabled Practical note: UILaunchPlacementParameters is a nested dictionary, so you cannot express it via INFOPLIST_KEY_* build settings. With GENERATE_INFOPLIST_FILE = YES you have to point INFOPLI
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’26
How to present a View above everything in SwiftUI?
Hello, I'm trying to present an app overlay (like an HUD) that should appear on top of everything (the app UI could be the root content view or a modal presented from the content view or a modal over a modal presented from the content view, etc.). If I use a ZStack for example, the issue is that the view is not visible if the ZStack is presenting a modal for example. In UIKit, I think we can use instantiate another UIWindow to show content above the top window of the app (what a native alert does if I'm not wrong). What would be the equivalent in SwiftUI? How could I create this? Thanks, Axel
Replies
2
Boosts
0
Views
221
Activity
Jun ’26
Live Activity sleep timer without push
My app has a sleep timer (up to 12 hours). Can I drive a Live Activity countdown in the Dynamic Island purely from the foreground/background app process using Activity.update(), without requiring a push notification server? And does Text(timerInterval:) in SwiftUI continue counting down accurately when the app process is suspended by the OS?
Replies
0
Boosts
0
Views
230
Activity
Jun ’26
Reply to AUv3 UI issues on Desktop / Logic Pro for Mac
Hi. That sounds unexpected! Was this a SwiftUI front-end ? Could you please try to put together a minimal sample-AU that reproduces this problem ? That would help us diagnose and fix this issue. Please be sure to file a feedback request on https://feedbackassistant.apple.com Thank you!
Topic: Audio SubTopic:
Audio Q&A
Replies
Boosts
Views
Activity
Jun ’26
microphone level monitoring
My macOS app provides real-time microphone level monitoring, and I also have a macOS widget that shows recent audio level status. Since WidgetKit widgets are snapshot/timeline based rather than continuously live SwiftUI views, is there any new capability in macOS 27 that allows a widget to show more responsive or animated audio-level changes? If true real-time animation is still not supported in widgets, what is Apple’s recommended approach for displaying frequently changing signal levels, such as audio meters, in a macOS widget?
Replies
2
Boosts
0
Views
369
Activity
Jun ’26
Reply to Building AUv3's?
Can you please clarify what you mean by more modern? The AUv3 template that comes bundled with Xcode gets modernized regularly embracing the latest changes, such as SwiftUI and C++-Swift-interoperability. That would be the recommended way to build an AUv3.
Topic: Audio SubTopic:
Audio Q&A
Replies
Boosts
Views
Activity
Jun ’26