Yes, it is possible to have two separate libraries / frameworks / code bases in the application, using Realm independently, and completely save your model objects.
If you have a collection of subclasses of Realm Object that you would like to keep confidential, you can mark them so that they are not automatically added to the default application schema by adding the following static override method:
public class MyModel: Object { public override class func shouldIncludeInDefaultSchema() -> Bool { return false } }
This class will only be added to the Realm database if it is explicitly declared in the objectTypes property of this Realm Configuration object.
Thus, you can isolate all your own classes of the Realm model only from your own structure, and the parent application can use Realm in the original context without adding any objects to it.
source share