EasyRealm 1.1.3

EasyRealm 1.1.3

DocsDocumented
TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Allan Vialatte.


Downloads

Total556
Week159
Month542

Installs

Apps22
Apps WeekApps This Week 15
Pod Tries4
Pod Tries WeekPod Tries This Week 1
Test Targets1
powered by Segment

GitHub

Stars192
Watchers5
Forks10
Issues0
Contributors1
Pull Requests0

Code

Files8
SizeIntegration Size 40 kb
FrameworkCreates Framework
LOCLines of Code 184


EasyRealm 1.1.3


EasyRealm


EasyRealm

EasyRealm is a micro-framework (less than 200 LOC) that helps you use Realm.

Promise

EasyRealm make 4 promises :

  • EasyRealm never transform secretly an unmanaged Object to a managed Object and vice-versa.
  • EasyRealm let you use managed and unmanaged objects identically.
  • EasyRealm never manipulate thread behind your back, you keep full control of your process flow.
  • EasyRealm never handle Error for you.

Features

Using

  • No inheritance.
  • No protocol.
  • Import Framework
  • Enjoy

Save

To save an object :

let pokemon = Pokemon()
try! pokemon.er.save(update: true)
//OR
let managed = try! pokemon.mr.saved(update: true)

Edit

To edit an object :

let pokemon = Pokemon()

try! pokemon.er.edit { $0.level = 42 }

Delete

To delete an object :

let pokemon = Pokemon(name: Pikachupl-pds>)

try! pokemon.er.delete()

To delete all objects :

try! Pokemon.er.deleteAll()

Queries

To query all objects of one type :

let pokemons = try! Pokemon.er.all()

To query one object by its primaryKey :

let pokemon = Pokemon.er.fromRealm(with: Pikachupl-pds>)

Helping Variables

  • isManaged :
pokemon.er.isManaged // Return true if realm != nil and return false if realm == nil
  • managed :
pokemon.er.managed // Return the managed version of the object if one exist in Realm Database
  • unmanaged :
pokemon.er.unmanaged // Return an unmanaged version of the object

Installation

EasyRealm is available through CocoaPods. To install it, simply add the following line to your Podfile:

Author

License

EasyRealm is available under the MIT license. See the LICENSE file for more info.

Other