Post

Replies

Boosts

Views

Activity

Reply to Why do I get an error when deleting data from SwiftUI List and Realm?
Not a great solution but my work around was copying each realm result to a local object/array. class ContentViewController: ObservableObject { private var realmLocalData: [ScheduleModel] = [ScheduleModel]() private let realm = try! Realm() func updateData() { realmLocalData.removeAll()      let predicate = NSPredicate(format: "dateIndex >= %@ && dateIndex <= %@", argumentArray: [startDate, endDate])      let data = self.realm.objects(MonthScheduleModel.self).filter(predicate)            for obj in data {        realmLocalData.append(ScheduleModel(realmObj: obj))      } }
Apr ’22