Pravin Tate
Pravin Tate

Reputation: 1130

Some confusions about implementing realm in swift

I want to learn realm. I searched about it on the internet but I have some doubts about it. I am using swift language for it. So which file should I import in my class

import Realm

OR

import RealmSwift

while create class for real table from which class it will be inherited means from RLMObject or Object and for making object array which Thing I will use List or RLMArray

I have downloaded realm's latest version on proper site but still its print log tells that latest version available.

Thanks in advance

Upvotes: 1

Views: 91

Answers (1)

TiM
TiM

Reputation: 15991

Awesome! Glad to hear you're interested in learning Realm!

At this point, there are 2 discrete versions of Realm for iOS, the Objective-C version, and the Swift version. RLMObject/RLMArray is the Objective-C version and Object/List is the native Swift version.

Before the native version of Realm for Swift was released, a 'bridged' version was released that simply let you use the Objective-C version in a Swift codebase.

At this point, I would recommend moving completely over to the Swift version of Realm (Which is the import RealmSwift keyword you mentioned above).

We released v0.95.1 of Realm yesterday; very recently. So if you're seeing an upgrade notice, you can fix that by completely deleting that version of Realm you downloaded (Which cleans out the prebuilt copies of the framework), and re-downloading it again.

(Disclaimer: I work for Realm)

Upvotes: 1

Related Questions