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) } }
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 🙃
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) } }
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
Reply to Xcode Cloud for a solo developer?
Huge benefits I think depending on what the price is though. Being able to offload your builds is great and even if you are a solo developer you have users I am assuming that will test your app.
Replies
Boosts
Views
Activity
Jun ’21