Mixed Objective C and Swift Project

Is it recommended to use the Objective C or Swift MongoDB Realm SDK when working with a mixed Objective C/Swift code base? We migrated a mixed app to Realm last year and the Realm documentation stated that the Objective C SDK should be used. Is that still the case? I’ve noticed some methods in the SDK are marked with NS_REFINED_FOR_SWIFT which makes them unavailable in Swift. Also, there isn’t the RLMSupport.swift file that contains a lot of handy extensions.

@Nina_Friend RLMObject and RealmSwift.Object are different types that can’t be easily passed to functions expecting the other, so mixing the two gets really awkward

If RLMSupport.swift is missing wrappers for things marked as NS_REFINED_FOR_SWIFT then we should fix that - please open an issue here for what is missing that you need: GitHub - realm/realm-swift: Realm is a mobile database: a replacement for Core Data & SQLite

I’ll submit the issue.

Should I continue to have my data classes in Objective C and descending from RLMObject or should I rewrite the data classes in Swift and descend from Object even though other parts of my code are still in Objective C? In the future I would like to convert the whole project to Swift. If I start with Objective C/RLMObject and then want to switch to Swift/Object later is that going to be a problem?

@Ian_Ward
When using Ream SDK in a mixed Objective C and Swift project, is the restriction that you must use ObjC API still the same with the latest version of Realm SDK?
In my project (mixed Objective C and Swift project), I have realm-swift installed and only use import Realm, but is it okay to import RealmSwift and use the API for swift?