Post

Replies

Boosts

Views

Activity

Reply to CloudKit, core data: "Failed to sync user keys" after Xcode update to 13.4.1
Use real device, and now you don't have to use your developer account (iCloud) on your real device, you could use your personal iCloud account. On CloudKit Dashboard there is a new option called "Act as iCloud Account" which can be used into your personal account Then you can debug and see your private database records for your personal account. If you don't have more than 1 device you could a build a simple UI (swiftUI), use your Mac as your other device
Topic: App & System Services SubTopic: iCloud Tags:
Aug ’22
Reply to NavigationStack and NavigationSplitView Runtime warnings
Xcode 14.0 beta 5 (14A5294e) seem to have fixed my issues with NavigationSplitView Fixed - Warnings Fixed - Selection of cell not happening (2nd time) in compact mode (For 3 column layout) - so no need to set the selected state of the middle column to nil onDisappear Hopefully it has fixed your issues as well, if not please file a feedback
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to Are CKRecords Guaranteed to be Added to an NSPersistentCloudKitContainer Store in creationDate order?
My understanding of your problem (could be wrong): You have a share extension and you have a parent Mac app. When you share data using the extension, the data gets duplicated Questions Where are you storing the data (which entity) when data is share extension? My approach (could be wrong) Share Extension should write to a separate entity that is not synced to iCloud Then sync the data from your share extension entity to your original entity You would have hooked your original entity to sync to iCloud so that should automatically take of syncing Steps Add a new configuration called ShareExt (example name) to your CoreData data model (xcdatamodeld file ) Add a new entity called MyEntity (example name) Add MyEntity to ShareExt configuration To persistentStoreDescriptions and add ShareExt (refer https://developer.apple.com/wwdc19/202) Sync from your MyEntity to your OriginalEntity (which you are using in the app) - refer https://developer.apple.com/documentation/coredata/linking_data_between_two_core_data_stores Reference Using CoreData with CloudKit Consuming Relevant Store Changes Linking Data Between Two Core Data Stores
Topic: App & System Services SubTopic: iCloud Tags:
Aug ’22
Reply to Using Core Data objects with Transferable
I didn't know about this till I read your post Based on the documentation, it looks like Item needs to be transferrable struct CKShareTransferRepresentation<Item> where Item : Transferable I am not sure how it fits in with CloudKit Sharing, CloudKit sharing already exists without transferable, may be it would be transformed, I am not sure CloudKit Sharing (without using transferable) - https://developer.apple.com/documentation/cloudkit/shared_records/sharing_cloudkit_data_with_other_icloud_users
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to ShareLink and DataRepresentation
Try it on iOS (iPad Simulator), try to share it and locally save it to Files locally on the iPad (you don't need iCloud) If it works then your code is fine, I feel transferable on macOS has a lot of bugs. After testing and confirming the issue, it would be great if you could file a feedback.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to Drag file from app to Finder on macOS
This seems like a bug, it works fine on iOS but macOS it doesn't work Please file a bug and post the feedback ID. The only workaround for now is to use ProxyRepresentation Note: ProxyRepresentation has a different purpose to serve as a proxy, but since the bug that is the only workaround I can think of.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to NavigationStack and NavigationSplitView Runtime warnings
NavigationStack - Works as expected The following code works as expected struct ContentView: View { @StateObject private var dataStore = DataStore() @State private var navigationPath = [Car]() var body: some View { NavigationStack(path: $navigationPath) { List { ForEach(dataStore.cars) { car in NavigationLink(car.name, value: car) } } .navigationDestination(for: Car.self) { car in CarDetail(car: car, navigationPath: $navigationPath) } .navigationTitle("Car List") } } } NavigationSplitView - Doesn't work on compact width (iPhone) The problem with NavigationSplitView is that on iPhone (compact width - behaves like pushing views) the following happens: Select one cell and going into the detail view Press back to come parent view Select another cell, nothing happens, it just selects the cell but doesn't push to the detail view
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to Pass on Binding
Learn It would be best if you could learn about Binding, there is a convenient propertyWrapper @Binding Refer: https://developer.apple.com/documentation/swiftui/binding/ Sample code struct ContentView: View { //This is using the Binding propertyWrapper @Binding var data: [TodoItem] var body: some View { List { ForEach($data) { datum in TableRow(data: datum) // <- what goes here? .swipeActions { Button(role: .destructive) { data.delete(datum) //data.removeAll { $0 == datum.wrappedValue } } label: { Label("Delete", systemImage: "trash") } } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Error: Failed to sync user keys in simulator
Best to use a real device, it is fine if your device uses a different iCloud account (which is different from your Apple Dev account), you could login into CloudKit Console and use "Act as iCloud Account" to view your private database records
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Xcode 14 Beta CloudKit Error
Check your entitlements file and see what the iCloud Container Identifier is. It needs to be iCloud.$(CFBundleIdentifier). It should start with iCloud.
Replies
Boosts
Views
Activity
Aug ’22
Reply to CloudKit Console Database Section Not Working
Not sure, it works for me now, if issue persists, logout and login, otherwise file a feedback to Apple
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to CloudKit, core data: "Failed to sync user keys" after Xcode update to 13.4.1
Use real device, and now you don't have to use your developer account (iCloud) on your real device, you could use your personal iCloud account. On CloudKit Dashboard there is a new option called "Act as iCloud Account" which can be used into your personal account Then you can debug and see your private database records for your personal account. If you don't have more than 1 device you could a build a simple UI (swiftUI), use your Mac as your other device
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to NavigationStack and NavigationSplitView Runtime warnings
Xcode 14.0 beta 5 (14A5294e) seem to have fixed my issues with NavigationSplitView Fixed - Warnings Fixed - Selection of cell not happening (2nd time) in compact mode (For 3 column layout) - so no need to set the selected state of the middle column to nil onDisappear Hopefully it has fixed your issues as well, if not please file a feedback
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Are CKRecords Guaranteed to be Added to an NSPersistentCloudKitContainer Store in creationDate order?
My understanding of your problem (could be wrong): You have a share extension and you have a parent Mac app. When you share data using the extension, the data gets duplicated Questions Where are you storing the data (which entity) when data is share extension? My approach (could be wrong) Share Extension should write to a separate entity that is not synced to iCloud Then sync the data from your share extension entity to your original entity You would have hooked your original entity to sync to iCloud so that should automatically take of syncing Steps Add a new configuration called ShareExt (example name) to your CoreData data model (xcdatamodeld file ) Add a new entity called MyEntity (example name) Add MyEntity to ShareExt configuration To persistentStoreDescriptions and add ShareExt (refer https://developer.apple.com/wwdc19/202) Sync from your MyEntity to your OriginalEntity (which you are using in the app) - refer https://developer.apple.com/documentation/coredata/linking_data_between_two_core_data_stores Reference Using CoreData with CloudKit Consuming Relevant Store Changes Linking Data Between Two Core Data Stores
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Using Core Data objects with Transferable
I didn't know about this till I read your post Based on the documentation, it looks like Item needs to be transferrable struct CKShareTransferRepresentation<Item> where Item : Transferable I am not sure how it fits in with CloudKit Sharing, CloudKit sharing already exists without transferable, may be it would be transformed, I am not sure CloudKit Sharing (without using transferable) - https://developer.apple.com/documentation/cloudkit/shared_records/sharing_cloudkit_data_with_other_icloud_users
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to SWIFT TASK CONTINUATION MISUSE: loadTransferable(for:) leaked its continuation!
Overview Your original code works fine both on iOS and macOS Please test on latest Xcode beta Code change One small code change (API has changed) for the latest Xcode beta: .dropDestination(for: String.self) { (strings: [String], location) in Tested on macOS 13.0 Beta (22A5311f) Xcode Version 14.0 beta 4 (14A5284g)
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to ShareLink and DataRepresentation
Try it on iOS (iPad Simulator), try to share it and locally save it to Files locally on the iPad (you don't need iCloud) If it works then your code is fine, I feel transferable on macOS has a lot of bugs. After testing and confirming the issue, it would be great if you could file a feedback.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Drag file from app to Finder on macOS
This seems like a bug, it works fine on iOS but macOS it doesn't work Please file a bug and post the feedback ID. The only workaround for now is to use ProxyRepresentation Note: ProxyRepresentation has a different purpose to serve as a proxy, but since the bug that is the only workaround I can think of.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Drag file from app to Finder on macOS
I have the same doubt, did you manage to get it to export to a file?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to NavigationStack and NavigationSplitView Runtime warnings
@justletmeintotheforum Thanks a ton!!!!! Made my day! Wow Is this a must? Or is this workaround for a bug?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to NavigationStack and NavigationSplitView Runtime warnings
Yes, best to use the new APIs as suggested in https://developer.apple.com/wwdc22/10054 There is a bug (mentioned in my earlier post) with NavigationSplitView with the navigation on a single column, but this is marked as a known issue in iOS 16 beta (3, 4) release notes.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to NavigationStack and NavigationSplitView Runtime warnings
NavigationStack - Works as expected The following code works as expected struct ContentView: View { @StateObject private var dataStore = DataStore() @State private var navigationPath = [Car]() var body: some View { NavigationStack(path: $navigationPath) { List { ForEach(dataStore.cars) { car in NavigationLink(car.name, value: car) } } .navigationDestination(for: Car.self) { car in CarDetail(car: car, navigationPath: $navigationPath) } .navigationTitle("Car List") } } } NavigationSplitView - Doesn't work on compact width (iPhone) The problem with NavigationSplitView is that on iPhone (compact width - behaves like pushing views) the following happens: Select one cell and going into the detail view Press back to come parent view Select another cell, nothing happens, it just selects the cell but doesn't push to the detail view
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Pass on Binding
Learn It would be best if you could learn about Binding, there is a convenient propertyWrapper @Binding Refer: https://developer.apple.com/documentation/swiftui/binding/ Sample code struct ContentView: View { //This is using the Binding propertyWrapper @Binding var data: [TodoItem] var body: some View { List { ForEach($data) { datum in TableRow(data: datum) // <- what goes here? .swipeActions { Button(role: .destructive) { data.delete(datum) //data.removeAll { $0 == datum.wrappedValue } } label: { Label("Delete", systemImage: "trash") } } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22