Post

Replies

Boosts

Views

Activity

Reply to SwiftUI SwiftData Previews not working as expected
Looks like an @Model must be inserted into the context before use in SwiftUI actor PreviewSampleData { @MainActor static var container: ModelContainer = { let schema = Schema([Trip.self, BucketListItem.self, LivingAccommodation.self]) let configuration = ModelConfiguration(inMemory: true) let container = try! ModelContainer(for: schema, configurations: [configuration]) let sampleData: [any PersistentModel] = [ Trip.preview, BucketListItem.preview, LivingAccommodation.preview ] sampleData.forEach { container.mainContext.insert($0) } return container }() @MainActor static var previewTrip: Trip = { let container = PreviewSampleData.container let trip = Trip.preview container.mainContext.insert(trip) return trip }() } #Preview { MainActor.assumeIsolated { List { TripListItem(trip: PreviewSampleData.previewTrip) } .modelContainer(PreviewSampleData.container) } }
Topic: App & System Services SubTopic: iCloud Tags:
Jun ’23
Reply to Swift playgrounds unsupported file format
Same issue ? Tried both the current and the TestFlight version (4.3.1 and 4.4 beta) , playground works but app doesn’t.
Replies
Boosts
Views
Activity
Jul ’23
Reply to SwiftUI SwiftData Previews not working as expected
Interesting! not sure why I didn't try this 🙃
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to SwiftUI SwiftData Previews not working as expected
Looks like an @Model must be inserted into the context before use in SwiftUI actor PreviewSampleData { @MainActor static var container: ModelContainer = { let schema = Schema([Trip.self, BucketListItem.self, LivingAccommodation.self]) let configuration = ModelConfiguration(inMemory: true) let container = try! ModelContainer(for: schema, configurations: [configuration]) let sampleData: [any PersistentModel] = [ Trip.preview, BucketListItem.preview, LivingAccommodation.preview ] sampleData.forEach { container.mainContext.insert($0) } return container }() @MainActor static var previewTrip: Trip = { let container = PreviewSampleData.container let trip = Trip.preview container.mainContext.insert(trip) return trip }() } #Preview { MainActor.assumeIsolated { List { TripListItem(trip: PreviewSampleData.previewTrip) } .modelContainer(PreviewSampleData.container) } }
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Macos 12 not available after update to Xcode to Version 13.0 (13A233)
Unfortunately this is not possible in Xcode cloud since they seem to not have the earlier beta available :( Completely broke my process
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Xcode cloud not saving post actions
I have attempted to do this from both the web and directly in Xcode.
Replies
Boosts
Views
Activity
Sep ’21