" Cannot preview in this file — Connection interrupted: send message to agent"
Here's my code
Code Block SwiftUI struct SettingsView: View { @Environment(\.managedObjectContext) var moc @FetchRequest(entity: ChildProfile.entity(), sortDescriptors: []) var children: FetchedResults<ChildProfile> var body: some View { VStack { List { Section(header: Text("Children")) { ForEach(children, id: \.id) { child in ChildRow(child: child) } } } } } } struct SettingsView_Previews: PreviewProvider { static let moc = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType) static var previews: some View { let defaultChild = ChildProfile(context: moc) defaultChild.id = UUID() defaultChild.name = "Lex" return SettingsView().environment(\.managedObjectContext, moc) } }
Previewing ChildRow with the same preview code works fine in the canvas
Is this a bug in Xcode or am I missing something?