Is there a way to use SwiftData without automatic iCloud sync? I’d like to do that manually using my own CloudKit solution or CKSyncEngine. SwiftData automatically picks up any CloudKit containers though and I have not seen an option to disable this behavior. Setting cloudKitContainerIdentifier to nil does still pick the first available CloudKit container.
Just in case this is a bug: FB12276416
Sample:
let configuration = ModelConfiguration(cloudKitContainerIdentifier: nil)
let modelContainer = try! ModelContainer(for: [GamesCollection.self], configuration)
print(modelContainer.configurations)
// [SwiftData.ModelConfiguration(url: …, name: …, sharedAppContainerIdentifier: …, cloudKitContainerIdentifier: Optional("iCloud.CloudKit.com.+++")
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
What's the recommended way to add a search bar in Mac Catalyst? The new NSSearchToolbarItem that was introduced in macOS 11 is not available in Catalyst. What's the alternative?
FB7828248
How can I use the same translucent selection style in the sidebar that apps like Finder, Music, and Podcasts use? By default Mac Catalyst apps seem to use the tint color for the selection, which looks out of place with the system apps.
I use UICollectionLayoutListConfiguration by the way.
I have a layout similar to Music or Podcasts, where I have a sidebar and a grid content area. When clicking on one of the items in the grid I want to open a full screen detail view just like Music does. My question is: How can I display a back button in the toolbar? I only figured out how to add buttons to the trailing side of the toolbar. Is this even possible in pure SwiftUI?
.toolbar {
Button(action: showSearch) {
Label("Add Game", systemImage: "plus")
}
}