AYRealmer
About
AYRealmer library - is a wrapper that allows you to interact only with models instead of realm-entities.
Installation
AYRealmer is available through CocoaPods. To install it, simply add the following line to your Podfile:
inhibit_all_warnings!
target 'YOUR_TARGET_NAME' do
use_frameworks!
pod 'AYRealmer'
end
Usage
// 'AYRConfiguration' - enum that confirm to protocol 'AYDataBaseConfiguration' (configuration).
// 'User' - struct that confirm to protocol 'AYRealmConvertibleModel' (model).
// 1. Create 'AYRealmer' object with configuration and file location
var realmer = AYRealmer(with: AYRConfiguration.user, in: .documents)
// 2. Prepare 'User' object for saving
var user = User()
user.email = "[email protected]"
user.fullName = "Tester User"
// 3. Store 'User' object
realmer.add(model: user)
// 4. Fetch & print 'User' objects
let users: [User] = realmer.objects()
print(users)
// 5. Remove 'User' object
realmer.remove(model: user)
Author
License
AYRealmer is available under the MIT license. See the LICENSE file for more info.