EzRealm is an easy way of managing Realms objects.
- Protocol oriented Realms
- Easily create, save, delete, update your Realm Object Classes synchronously.
- Access delegate methods as "willDeleteOnRealm" or "didMakeARealmCall" in a Swifty familiar way.
- No more thread problems.
Let's take as an example the User class, ready to be persisted on Realm.
class User: Object {
...
}
If you want to use the EzRealm methods, you just have to make it inherit from PersistableOnRealm. The protocol just needs the path where you want to save the Realm file.
extension User: PersistableOnRealm {
static var realmPath: RealmPath {
return Realms.users
}
}
That you can privide from an enum of all the Realms used by your application.
enum Realms: String, RealmPath {
case users
var pathComponent: String {
return .rawValue
}
}
Now, the object is ready to be persisted!
let user = User()
try user.save()
try user.delete()
try user.update() {
...
}
- iOS 10.0+
- Xcode 10+
- Swift 4.2+
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate EzRealm into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'EzRealm'
If you prefer not to use any of the aforementioned dependency managers, you can integrate EzRealm into your project manually.
- If you need help using Realm, contact Realm or check their documentation.
- If you need to find or understand an API, contact me (a better documentation is work in progress).
- If you found a bug, open an issue here on GitHub and follow the guide. The more detail the better!
- If you want to contribute, submit a pull request.
We all know that Realm is synonymous with simple and fast, but while working on my projects I wanted to find a way to make it even easier and faster, with an eye to the frequent bugs related to background threads. I am aware of the fact that it is not a complex library, but it should make its own in projects of not large dimensions.
I DON'T own ANYTHING about Realm. This is just a manager which wrap Realm classes. For any informations about Realm, contact them or look at their website. EzRealm is owned and maintained by Luca Celiento. You can follow me on Twitter at @lookatlooka for project updates, advices and releases.
If you believe you have identified a security vulnerability with EzRealm, please report it as soon as possible.
EzRealm is released under the MIT license.