Realm-cocoa: Unable to use new RealmSwift syntax

Created on 17 May 2015  路  2Comments  路  Source: realm/realm-cocoa

I changed over to RealmSwift and removed RLMSupport.swift.

Now when I change let backgroundRealm = RLMRealm.defaultRealm()(which has no errors) to let backgroundRealm = Realm(), I see these errors:

Invalid use of '()' to call a value of non-function type 'module'
and
Expected module member name after module name

Could someone please help me figure out what I am missing?

T-Help

Most helpful comment

In any swift files using realm, you need to change your import statements from import Realm to import RealmSwift.

All 2 comments

In any swift files using realm, you need to change your import statements from import Realm to import RealmSwift.

Thanks for answering, @angrybear11. That's most certainly the appropriate solution, as Swift is likely confused between Realm the module and RealmSwift.Realm the type.

Was this page helpful?
0 / 5 - 0 ratings