Post

Replies

Boosts

Views

Activity

Reply to ModelActor Implementation Changes In Xcode 15 Beta 7
Actually you can skip the constructor. @ModelActor actor CountryModelActor { func newItem() { let item = Item(timestamp: .now, name: "\(Int.random(in: 0...3))") modelContext.insert(item) try! modelContext.save() } } You will get an error Invalid redeclaration of 'init(modelContainer:)' if you define init(container: ModelContainer). Its being created automatically by macro now.
Aug ’23