Are we using RLMObject or Object in Swift Realm?

I saw examples for Realm where they use

class Person: Object {} 

and

 class Person: RLMObject {} 

which one should we use?

Also, I can't get the init function to work for the first one. Any help would be appreciated.

+5
source share
1 answer

If you work in Swift, Realm.Object ( Object ) was designed for the Swift interface. It has better type definition and more natural Swift phrases.

Object supported by RLMObject , so you can use RLMObject if you want, but its api is Objective-C, so some things can be a little tedious.

TL; DR

The kingdom made RealmSwift for some reason! Use Object :)

+5
source

All Articles