javascript object has been invalidated code example
Example: Terminating app due to uncaught exception 'RLMException', reason: 'Object has been deleted or invalidated.'
DispatchQueue.main.async {
realm.delete()
}
DispatchQueue.main.async {
realm.delete()
}