Check out example codes for "predicate realm bool swift". It will help you in understanding the concepts better.

Code Example 1

import RealmSwift

class User: Object {
    dynamic var isRegistered = true
}

let realm = Realm()
realm.write {
    realm.add(User())
}
let p1 = NSPredicate(format: "isRegistered == YES")
let p2 = NSPredicate(format: "isRegistered == true")
let p3 = NSPredicate(format: "isRegistered == %@", NSNumber(bool: true))
let p4 = NSPredicate(format: "isRegistered = YES")
let p5 = NSPredicate(format: "isRegistered = true")
let p6 = NSPredicate(format: "isRegistered = %@", NSNumber(bool: true))
for predicate in [p1, p2, p3, p4, p5, p6] {
    println("users matching \(predicate): \(realm.objects(User).filter(predicate))")
}

Learn ReactJs, React Native from akashmittal.com