Post

Replies

Boosts

Views

Activity

Disable automatic iCloud sync with SwiftData
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.+++")
14
4
4.7k
Mar ’24
SwiftUI Toolbar back button on macOS
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")             }         }
2
0
4.3k
Dec ’20