Post

Replies

Boosts

Views

Activity

Reply to Core Data template Xcode 12.2
In Persistence.swift check static var preview starting line 13. Over there the following code segment creates the ten record. &#9; for _ in 0..<10 {    &#9; let newItem = Item(context: viewContext)      &#9;&#9;newItem.timestamp = Date() &#9; } You can adapt it to accommodate to your own needs. Otherwise you have got the option not to use the preview context by simply not using it in ContentView.swiftat the very end of the file. struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)     } }
Sep ’20