Example Project : Realm with Swift 2.0

Realm with Swift 2.0

TA-DA this is name of this example app. I like funny sound like Minions say Taa-Daa haha… it very relax sound. K we will create mini-project for show how to use Realm with Swift 2.0. I think a lot of iOS Developer even try to use Core Data ….. but someone give up because it difficult for understand…. sure me too :P.
Now! comes the solution. We have Realm, it is a mobile database easy to use, fast, cross-platform, advanced and bla bla bla.
I can’t explain a lot of detail but now you and me will go to try with easy example project for understand the power of Realm.

Part 1

  • Init project, install reaml by cocoapod to project, init to-do model.
  • Create xcode project
  • Install Realm follow how to : Install Realm to project
  • Create Realm Object – TDTask model

Part 2

  • Create tableview for list to-do task
  • Get all task in Realm database

  • Create to-do form for input to-do data
  • and create save function for insert task to database

  • BAMM! Now task will store on mobile database

Part 3

  • Update/Edit to-do task object and show status in tableview.

  • Now we can edit task object it very easy to update object, we open write transaction use realm.beginWrite() and update task object and save update data with try! realm.commitWrite().

Part 4

  • Filtering realm object with NSPredicate.

Part 5

  • Sorting object with sorted function.

Next part
I’ll show how to queries with Chaining and other useful technic with Realm.

Fork this project on GitHub

Thank nice image from

The iOS Security Model
Infinite Scroll with custom UIPageViewController with filter data
How to make tableviewcell animation using Swift