Saving Array to Realm in Swift?
问题 Is it possible to save an array of objects to Realm ? Anytime I make a change to the array it should be saved to Realm. My current solution is to save object for object with a for loop . For append/modifying objects calling save() will do the job, but not when I remove an object from it. class CustomObject: Object { dynamic var name = "" dynamic var id = 0 override static func primaryKey() -> String? { return "id" } } struct RealmDatabase { static var sharedInstance = RealmDatabase() var