Search results for

“swiftui”

17,109 results found

Post

Replies

Boosts

Views

Activity

Drag on a Canvas with XCUICoordinate.press(...)
I am trying to create a test case in XCTest using the UI Test target. I have a use case where I use a SwiftUI Canvas to draw a network graph; and the user can drag the graph on the Canvas. After the drag, the user may click on a node. The application presents a popup with the information about the network node clicked. SwiftUI provides the information required for the application to translate the location of the tap into the original location prior to the drag; and so the logic behind the popup can determine which node the network graph was tapped by the user. It appears that the distance of the drag operation performed does not match distance that the image actually moved. The drag distance is always larger than the actual distance dragged. I can observe this during the test execution. The arrow starts at the correct spot but then goes further than the object being dragged. I also observe this when I am driving the application. Is there some standard and supported way to determine the dista
3
0
168
Apr ’26
Reply to SwiftUI View Not Initialized on Background Relaunch (CoreBluetooth / Cold Start?)
Argun and I have been talking about this issue privately, and he asked me to comment on this: [quote='884915022, Engineer, /thread/823017?answerId=884915022#884915022'] I will leave the discussion of why UI elements are sometimes not initialized for non-UI (background) launches to others [/quote] Yeah, that’s been confusing folks since we first introduced multitasking to iOS |-: When the system launches your app in the background, it may or may not instantiates your views. Whether it does is based on a wide range of criteria, stuff that’s changed in the past and may well change again in the future. For example, the system might want to refresh its snapshop of your app’s UI, in which case it has to instantiate your views in order to do that. Or it might be happy with its current snapshot, and thus not. Which brings us to this: [quote='884915022, Engineer, /thread/823017?answerId=884915022#884915022'] In general it is not a correct pattern to make app-wide non-UI functionality dependent on UI elements [/quote]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’26
Reply to Increase Contrast reduces List selection contrast in dark appearance in SwiftUI NavigationSplitView
I think there are two confounding issues here. The first is that the default accentColor is not intended to be used as a background color, and its high contrast versions reduce rather than increase contrast with .primary color text (in both light and dark themes). NavigationSplitView & Passwords are both using the default accentColor while Contacts and Messages are both probably using a custom color as a background, which have high contrast versions that are intended to be used as a background for .primary color text. The other issue is much more difficult to work around, which is that certain views aren't actually using the high contrast version of the color, but are further amplifying these colors programmatically, even if you do specify a high contrast color. I think this is based on whether they are contained inside other UIKit-based views, but I am very not sure. import SwiftUI @main struct HighContrastBlueDemoApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct Content
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’26
SwiftUI Catalyst Resizable Sheet
I am porting a macOS app to SwiftUI Catalyst and have run into a usability issue. On macOS, presented sheets are user resizable. On SwiftUI macOS, they are also resizable, but on Catalyst, they are not. Does anyone have a good reference on how to make a sheet resizable under SwiftUI Catalyst?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
181
Apr ’26
Reply to SystemLanguageModel.Adapter leaks ~100MB of irrecoverable APFS disk space per call
To clarify, this isn't a memory leak, it's an issue with not de-duplicating or evicting copied model weights from a SIP-protected disk space. I'm also not sure the bug is CLI-specific. I definitely observed it with my CLI tool, Junco,, but I have another SwiftUI application where I'm observing the issue as well. Simply running the app from XCode copies the weights & metadata to the location above, and I've only been able to delete the accumulated ~104GB (645 model clones) through Recovery Mode.
Apr ’26
Reply to SwiftUI View Not Initialized on Background Relaunch (CoreBluetooth / Cold Start?)
I will leave the discussion of why UI elements are sometimes not initialized for non-UI (background) launches to others who have more expertise on these things. Here, I will address the CoreBluetooth problem you are obviously having due to this behavior. In general it is not a correct pattern to make app-wide non-UI functionality dependent on UI elements like Views. Indeed, CoreBluetooth works at the app level, and needs to be initialized and used at the app level, not hidden behind a view. When the system relaunches your app due to the sensor coming back in range, it is doing so because the expectation is your app needs to take some action and respond to the BLE event that occurred (whether it is the sensor coming in or out of range, new data arriving, connection dropping, etc.) as soon as possible, and it should not be waiting for the app views to be rebuilt after launch, even in the 9 out of 10 case this seems to work for you. The correct use is to bring all CoreBluetooth functionality to the app level. Pr
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’26
View Navigation Title Disappears on watchOS Target When Built With Xcode 26+
I have a SwiftUI view in a watch companion app, and when I build my app with Xcode 26.2 or 26.3, the navigation title on a presented screen disappears after the watch screen goes dark. So, the navigation title is only visible when the screen is first presented and not again after the watch screen goes dark, for example when the user lowers their arm. Please see the screenshots for a better understanding. Notice that the Bench Press text is not visible in the third image. Also, I’ve confirmed that this does not happen when the app is built with Xcode 16.4. First Image (initial presentation of the screen): Second Image (watch screen goes dark): Third Image (watch screen goes back on, title missing): Although I've confirmed that this is related to Xcode versioning, and it happens on multiple screens, here is the redacted version of this SwiftUI view that is shown in the screenshots, in case it helps: var body: some View { NavigationStack(path: $viewModel.pushedViews) { TabView(selection: $selec
0
0
70
Apr ’26
Trying to load image & identifier from photo library with PhotosPicker
I'm updating an older Mac app written in Objective C and OpenGL to be a mutliplatform app in SwiftUI and Metal. The app loads images and creates kaleidoscope animations from them. It is a document-based application, and saves info about the kaleidoscope into the document. On macOS, it creates a security-scoped bookmark to remember the user's chosen image. On iOS, I use a PhotosPicker to have the user choose an image from their photo library to use. I would like to get the itemIdentifier from the image they choose and save that into my document so I can use it to fetch the image when the user reloads the kaleidoscope document in the future. However, the call to loadTransferable is returning nil for the itemIdentifier. Here is my iOS/iPadOS code: #if os(macOS) // Mac code #else PhotosPicker(Choose image, selection: $selectedItem, matching: .images) .onChange(of: selectedItem) { Task { if let newValue = selectedItem { scopeState.isHEIC = newValue.supportedContentTypes.contains(UTType.heic) let data = tr
1
0
661
Apr ’26
MapKit SwiftUI Map with .standard(elevation: .realistic) falls back to 2D in globe mode, while .hybrid(elevation: .realistic) remains 3D
Overview When using SwiftUI Map with .standard(elevation: .realistic) and a globe-style presentation, the map unexpectedly renders as a flat 2D map instead of a 3D globe / realistic terrain view. In the same view, switching to .hybrid(elevation: .realistic) preserves the expected 3D globe behavior. This appears to be a rendering bug or regression specific to the .standard style under globe mode, not an app-level issue. The issue is reproducible in my app’s competition map screen and has also been reported by other developers online. Steps to Reproduce Create a SwiftUI Map. Bind it to a MapCameraPosition. Apply a standard map style with realistic elevation: .mapStyle(.standard(elevation: .realistic)) Configure the UI so the user can switch between: standard + globe hybrid + globe Zoom out / interact with the map in globe mode. Expected Results Map with .standard(elevation: .realistic) should continue to render with globe / 3D realistic terrain behavior, consistent with realistic elevation sup
1
0
257
Apr ’26
SwiftUI View Not Initialized on Background Relaunch (CoreBluetooth / Cold Start?)
I have a question regarding cold start and pre-warming behavior on iOS. I’m developing a SwiftUI app that continuously receives data from a BLE device in the background. We’ve observed that after the BLE stream stops, the OS often terminates our app. Later, when the sensor comes back into range, iOS appears to relaunch (or reinitialize) the app. In our app, we use a WindowGroup like this: WindowGroup { AppView(store: store) } We’ve placed our BLE reconnection logic inside a .task modifier in AppView. What’s confusing is this: Most of the time, when the app is relaunched, AppView is created and the .task runs as expected. However, in about 1 out of 10 cases, AppView is not created at all, so the .task does not execute. I’m trying to understand: Under what conditions does iOS relaunch an app without fully initializing the SwiftUI view hierarchy? Is this related to pre-warming or background relaunch mechanisms (e.g., CoreBluetooth state restoration)? What determines whether the WindowGroup and
2
0
224
Apr ’26
Reply to Can’t paste into Simulator after updating to Xcode 26.4
@dser I don't see that issue on 26.5 beta 2. I went ahead and created a new project in SwiftUI struct ContentView: View { @State private var inputText: String = var body: some View { VStack { TextField(Test, text: $inputText) } } } I was able to copy and paste into the TextField. Can you provide me the steps you doing where you are still seeing the issue? Can you copy and paste the version of your Xcode including the build number? Thanks Albert
  Worldwide Developer Relations.
Apr ’26
Embedded Collection View in SwiftUI offset issue
I have a collection view that covers all the screen and it is scrolling behavior is paging. This collection view is embedded in a UIViewRepresentable and used in a SwiftUI app. The issue is that when users rotate the devices, sometimes the CollectionView.contentOffset get miscalculated and shows 2 pages. This is the code that I'm using for the collectionView and collectionViewLayout: class PageFlowLayout: UICollectionViewFlowLayout { override class var layoutAttributesClass: AnyClass { UICollectionViewLayoutAttributes.self } private var calculatedAttributes: [UICollectionViewLayoutAttributes] = [] private var calculatedContentWidth: CGFloat = 0 private var calculatedContentHeight: CGFloat = 0 public weak var delegate: PageFlowLayoutDelegate? override var collectionViewContentSize: CGSize { return CGSize(width: self.calculatedContentWidth, height: self.calculatedContentHeight) } override init() { super.init() self.estimatedItemSize = .zero self.scrollDirection = .horizontal self.minimumLineSpacing = 0
6
0
249
Apr ’26
CKRecordZone deleted when second user accepts zone-wide CKShare
I'm seeing a critical issue where a custom CKRecordZone is consistently deleted server-side when a second iCloud account interacts with a zone-wide CKShare. I've reproduced this 20+ times across two days and have exhausted every client-side fix I can think of. Looking for guidance on what might be going wrong. Setup Container: iCloud.com.cohencooks (production app on App Store) Custom CKRecordZone in owner's private database Zone-wide CKShare(recordZoneID:) (iOS 15+ zone sharing) SwiftData with ModelConfiguration(cloudKitDatabase: .none) — no automatic CloudKit mirroring Acceptance via CKFetchShareMetadataOperation → CKContainer.accept(metadata) (no UICloudSharingController) Minimal reproduction // 1. Owner creates zone + share let zone = CKRecordZone(zoneName: MyZone) try await privateDB.save(zone) let share = CKShare(recordZoneID: zone.zoneID) share[CKShare.SystemFieldKey.title] = My Share as CKRecordValue share.publicPermission = .readWrite let (results, _) = try await privateDB.modifyRecords(saving: [shar
1
0
268
Apr ’26
CKRecordZone deleted when second user accepts zone-wide CKShare
I'm seeing a critical issue where a custom CKRecordZone is consistently deleted server-side when a second iCloud account interacts with a zone-wide CKShare. I've reproduced this 20+ times across two days and have exhausted every client-side fix I can think of. Looking for guidance on what might be going wrong. Setup Container: iCloud.com.cohencooks (production app on App Store) Custom CKRecordZone in owner's private database Zone-wide CKShare(recordZoneID:) (iOS 15+ zone sharing) SwiftData with ModelConfiguration(cloudKitDatabase: .none) — no automatic CloudKit mirroring Acceptance via CKFetchShareMetadataOperation → CKContainer.accept(metadata) (no UICloudSharingController) Minimal reproduction // 1. Owner creates zone + share let zone = CKRecordZone(zoneName: MyZone) try await privateDB.save(zone) let share = CKShare(recordZoneID: zone.zoneID) share[CKShare.SystemFieldKey.title] = My Share as CKRecordValue share.publicPermission = .readWrite let (results, _) = try await privateDB.modifyRecords(saving: [shar
3
0
204
Apr ’26
Reply to Detect hardware keyboard with SwiftUI
Hi @Dokug, To detect the presence of a hardware keyboard, you can utilize the isHardwareKeyboardInputExpected property. It signifies that a hardware keyboard is connected and available for input. It's part of UIKit, but you could, for example, use .onReceive in SwiftUI to monitor the keyboardWillShow notification, and update a @State property accordingly. Best, -J
Topic: App & System Services SubTopic: Hardware Tags:
Apr ’26
Drag on a Canvas with XCUICoordinate.press(...)
I am trying to create a test case in XCTest using the UI Test target. I have a use case where I use a SwiftUI Canvas to draw a network graph; and the user can drag the graph on the Canvas. After the drag, the user may click on a node. The application presents a popup with the information about the network node clicked. SwiftUI provides the information required for the application to translate the location of the tap into the original location prior to the drag; and so the logic behind the popup can determine which node the network graph was tapped by the user. It appears that the distance of the drag operation performed does not match distance that the image actually moved. The drag distance is always larger than the actual distance dragged. I can observe this during the test execution. The arrow starts at the correct spot but then goes further than the object being dragged. I also observe this when I am driving the application. Is there some standard and supported way to determine the dista
Replies
3
Boosts
0
Views
168
Activity
Apr ’26
Reply to SwiftUI View Not Initialized on Background Relaunch (CoreBluetooth / Cold Start?)
Argun and I have been talking about this issue privately, and he asked me to comment on this: [quote='884915022, Engineer, /thread/823017?answerId=884915022#884915022'] I will leave the discussion of why UI elements are sometimes not initialized for non-UI (background) launches to others [/quote] Yeah, that’s been confusing folks since we first introduced multitasking to iOS |-: When the system launches your app in the background, it may or may not instantiates your views. Whether it does is based on a wide range of criteria, stuff that’s changed in the past and may well change again in the future. For example, the system might want to refresh its snapshop of your app’s UI, in which case it has to instantiate your views in order to do that. Or it might be happy with its current snapshot, and thus not. Which brings us to this: [quote='884915022, Engineer, /thread/823017?answerId=884915022#884915022'] In general it is not a correct pattern to make app-wide non-UI functionality dependent on UI elements [/quote]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to Increase Contrast reduces List selection contrast in dark appearance in SwiftUI NavigationSplitView
I think there are two confounding issues here. The first is that the default accentColor is not intended to be used as a background color, and its high contrast versions reduce rather than increase contrast with .primary color text (in both light and dark themes). NavigationSplitView & Passwords are both using the default accentColor while Contacts and Messages are both probably using a custom color as a background, which have high contrast versions that are intended to be used as a background for .primary color text. The other issue is much more difficult to work around, which is that certain views aren't actually using the high contrast version of the color, but are further amplifying these colors programmatically, even if you do specify a high contrast color. I think this is based on whether they are contained inside other UIKit-based views, but I am very not sure. import SwiftUI @main struct HighContrastBlueDemoApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct Content
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26
SwiftUI Catalyst Resizable Sheet
I am porting a macOS app to SwiftUI Catalyst and have run into a usability issue. On macOS, presented sheets are user resizable. On SwiftUI macOS, they are also resizable, but on Catalyst, they are not. Does anyone have a good reference on how to make a sheet resizable under SwiftUI Catalyst?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
181
Activity
Apr ’26
Reply to SystemLanguageModel.Adapter leaks ~100MB of irrecoverable APFS disk space per call
To clarify, this isn't a memory leak, it's an issue with not de-duplicating or evicting copied model weights from a SIP-protected disk space. I'm also not sure the bug is CLI-specific. I definitely observed it with my CLI tool, Junco,, but I have another SwiftUI application where I'm observing the issue as well. Simply running the app from XCode copies the weights & metadata to the location above, and I've only been able to delete the accumulated ~104GB (645 model clones) through Recovery Mode.
Replies
Boosts
Views
Activity
Apr ’26
Reply to SwiftUI View Not Initialized on Background Relaunch (CoreBluetooth / Cold Start?)
I will leave the discussion of why UI elements are sometimes not initialized for non-UI (background) launches to others who have more expertise on these things. Here, I will address the CoreBluetooth problem you are obviously having due to this behavior. In general it is not a correct pattern to make app-wide non-UI functionality dependent on UI elements like Views. Indeed, CoreBluetooth works at the app level, and needs to be initialized and used at the app level, not hidden behind a view. When the system relaunches your app due to the sensor coming back in range, it is doing so because the expectation is your app needs to take some action and respond to the BLE event that occurred (whether it is the sensor coming in or out of range, new data arriving, connection dropping, etc.) as soon as possible, and it should not be waiting for the app views to be rebuilt after launch, even in the 9 out of 10 case this seems to work for you. The correct use is to bring all CoreBluetooth functionality to the app level. Pr
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26
View Navigation Title Disappears on watchOS Target When Built With Xcode 26+
I have a SwiftUI view in a watch companion app, and when I build my app with Xcode 26.2 or 26.3, the navigation title on a presented screen disappears after the watch screen goes dark. So, the navigation title is only visible when the screen is first presented and not again after the watch screen goes dark, for example when the user lowers their arm. Please see the screenshots for a better understanding. Notice that the Bench Press text is not visible in the third image. Also, I’ve confirmed that this does not happen when the app is built with Xcode 16.4. First Image (initial presentation of the screen): Second Image (watch screen goes dark): Third Image (watch screen goes back on, title missing): Although I've confirmed that this is related to Xcode versioning, and it happens on multiple screens, here is the redacted version of this SwiftUI view that is shown in the screenshots, in case it helps: var body: some View { NavigationStack(path: $viewModel.pushedViews) { TabView(selection: $selec
Replies
0
Boosts
0
Views
70
Activity
Apr ’26
Trying to load image & identifier from photo library with PhotosPicker
I'm updating an older Mac app written in Objective C and OpenGL to be a mutliplatform app in SwiftUI and Metal. The app loads images and creates kaleidoscope animations from them. It is a document-based application, and saves info about the kaleidoscope into the document. On macOS, it creates a security-scoped bookmark to remember the user's chosen image. On iOS, I use a PhotosPicker to have the user choose an image from their photo library to use. I would like to get the itemIdentifier from the image they choose and save that into my document so I can use it to fetch the image when the user reloads the kaleidoscope document in the future. However, the call to loadTransferable is returning nil for the itemIdentifier. Here is my iOS/iPadOS code: #if os(macOS) // Mac code #else PhotosPicker(Choose image, selection: $selectedItem, matching: .images) .onChange(of: selectedItem) { Task { if let newValue = selectedItem { scopeState.isHEIC = newValue.supportedContentTypes.contains(UTType.heic) let data = tr
Replies
1
Boosts
0
Views
661
Activity
Apr ’26
MapKit SwiftUI Map with .standard(elevation: .realistic) falls back to 2D in globe mode, while .hybrid(elevation: .realistic) remains 3D
Overview When using SwiftUI Map with .standard(elevation: .realistic) and a globe-style presentation, the map unexpectedly renders as a flat 2D map instead of a 3D globe / realistic terrain view. In the same view, switching to .hybrid(elevation: .realistic) preserves the expected 3D globe behavior. This appears to be a rendering bug or regression specific to the .standard style under globe mode, not an app-level issue. The issue is reproducible in my app’s competition map screen and has also been reported by other developers online. Steps to Reproduce Create a SwiftUI Map. Bind it to a MapCameraPosition. Apply a standard map style with realistic elevation: .mapStyle(.standard(elevation: .realistic)) Configure the UI so the user can switch between: standard + globe hybrid + globe Zoom out / interact with the map in globe mode. Expected Results Map with .standard(elevation: .realistic) should continue to render with globe / 3D realistic terrain behavior, consistent with realistic elevation sup
Replies
1
Boosts
0
Views
257
Activity
Apr ’26
SwiftUI View Not Initialized on Background Relaunch (CoreBluetooth / Cold Start?)
I have a question regarding cold start and pre-warming behavior on iOS. I’m developing a SwiftUI app that continuously receives data from a BLE device in the background. We’ve observed that after the BLE stream stops, the OS often terminates our app. Later, when the sensor comes back into range, iOS appears to relaunch (or reinitialize) the app. In our app, we use a WindowGroup like this: WindowGroup { AppView(store: store) } We’ve placed our BLE reconnection logic inside a .task modifier in AppView. What’s confusing is this: Most of the time, when the app is relaunched, AppView is created and the .task runs as expected. However, in about 1 out of 10 cases, AppView is not created at all, so the .task does not execute. I’m trying to understand: Under what conditions does iOS relaunch an app without fully initializing the SwiftUI view hierarchy? Is this related to pre-warming or background relaunch mechanisms (e.g., CoreBluetooth state restoration)? What determines whether the WindowGroup and
Replies
2
Boosts
0
Views
224
Activity
Apr ’26
Reply to Can’t paste into Simulator after updating to Xcode 26.4
@dser I don't see that issue on 26.5 beta 2. I went ahead and created a new project in SwiftUI struct ContentView: View { @State private var inputText: String = var body: some View { VStack { TextField(Test, text: $inputText) } } } I was able to copy and paste into the TextField. Can you provide me the steps you doing where you are still seeing the issue? Can you copy and paste the version of your Xcode including the build number? Thanks Albert
  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
Apr ’26
Embedded Collection View in SwiftUI offset issue
I have a collection view that covers all the screen and it is scrolling behavior is paging. This collection view is embedded in a UIViewRepresentable and used in a SwiftUI app. The issue is that when users rotate the devices, sometimes the CollectionView.contentOffset get miscalculated and shows 2 pages. This is the code that I'm using for the collectionView and collectionViewLayout: class PageFlowLayout: UICollectionViewFlowLayout { override class var layoutAttributesClass: AnyClass { UICollectionViewLayoutAttributes.self } private var calculatedAttributes: [UICollectionViewLayoutAttributes] = [] private var calculatedContentWidth: CGFloat = 0 private var calculatedContentHeight: CGFloat = 0 public weak var delegate: PageFlowLayoutDelegate? override var collectionViewContentSize: CGSize { return CGSize(width: self.calculatedContentWidth, height: self.calculatedContentHeight) } override init() { super.init() self.estimatedItemSize = .zero self.scrollDirection = .horizontal self.minimumLineSpacing = 0
Replies
6
Boosts
0
Views
249
Activity
Apr ’26
CKRecordZone deleted when second user accepts zone-wide CKShare
I'm seeing a critical issue where a custom CKRecordZone is consistently deleted server-side when a second iCloud account interacts with a zone-wide CKShare. I've reproduced this 20+ times across two days and have exhausted every client-side fix I can think of. Looking for guidance on what might be going wrong. Setup Container: iCloud.com.cohencooks (production app on App Store) Custom CKRecordZone in owner's private database Zone-wide CKShare(recordZoneID:) (iOS 15+ zone sharing) SwiftData with ModelConfiguration(cloudKitDatabase: .none) — no automatic CloudKit mirroring Acceptance via CKFetchShareMetadataOperation → CKContainer.accept(metadata) (no UICloudSharingController) Minimal reproduction // 1. Owner creates zone + share let zone = CKRecordZone(zoneName: MyZone) try await privateDB.save(zone) let share = CKShare(recordZoneID: zone.zoneID) share[CKShare.SystemFieldKey.title] = My Share as CKRecordValue share.publicPermission = .readWrite let (results, _) = try await privateDB.modifyRecords(saving: [shar
Replies
1
Boosts
0
Views
268
Activity
Apr ’26
CKRecordZone deleted when second user accepts zone-wide CKShare
I'm seeing a critical issue where a custom CKRecordZone is consistently deleted server-side when a second iCloud account interacts with a zone-wide CKShare. I've reproduced this 20+ times across two days and have exhausted every client-side fix I can think of. Looking for guidance on what might be going wrong. Setup Container: iCloud.com.cohencooks (production app on App Store) Custom CKRecordZone in owner's private database Zone-wide CKShare(recordZoneID:) (iOS 15+ zone sharing) SwiftData with ModelConfiguration(cloudKitDatabase: .none) — no automatic CloudKit mirroring Acceptance via CKFetchShareMetadataOperation → CKContainer.accept(metadata) (no UICloudSharingController) Minimal reproduction // 1. Owner creates zone + share let zone = CKRecordZone(zoneName: MyZone) try await privateDB.save(zone) let share = CKShare(recordZoneID: zone.zoneID) share[CKShare.SystemFieldKey.title] = My Share as CKRecordValue share.publicPermission = .readWrite let (results, _) = try await privateDB.modifyRecords(saving: [shar
Replies
3
Boosts
0
Views
204
Activity
Apr ’26
Reply to Detect hardware keyboard with SwiftUI
Hi @Dokug, To detect the presence of a hardware keyboard, you can utilize the isHardwareKeyboardInputExpected property. It signifies that a hardware keyboard is connected and available for input. It's part of UIKit, but you could, for example, use .onReceive in SwiftUI to monitor the keyboardWillShow notification, and update a @State property accordingly. Best, -J
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Apr ’26