Is the SwiftUI CoreData-CloudKit iOS template supposed to do anything?

When creating a new SwiftUI project (either Xcode 12 or 12.2) and selecting both CoreData and CloudKit options, running the app on an iOS device shows absolutely nothing.

This is not the case if creating a universal project and running it on macOS, which works and shows some UI.

It's just a blank screen on iOS.
It's an issue with this block of code:

Code Block
        .toolbar {
            #if os(iOS)
            EditButton()
            #endif
            Button(action: addItem) {
                Label("Add Item", systemImage: "plus")
            }
        }


if you replace the View with this you should see a "+ Add Item" button in the menu which will add items to CoreData.

Code Block
var body: some View {
NavigationView {
List {
ForEach(items) { item in
Text("Item at \(item.timestamp!, formatter: itemFormatter)")
}
.onDelete(perform: deleteItems)
}
.navigationBarItems(trailing: Button(action: addItem) {
Label("Add Item", systemImage: "plus")
})
}
    }


I field Feedback on issues with .toolBar back in July and it hasn't been resolved yet. FB8101065


I've fixed this for Xcode 12.3 default CoreData code.
Answered here :https://stackoverflow.com/a/65315807/1890317
Is the SwiftUI CoreData-CloudKit iOS template supposed to do anything?
 
 
Q