         self.age = 0
     }
     
-        override static func indexedProperties() -> [String] {
-            return ["name"]
-        }
+    override static func indexedProperties() -> [String] {
+        return ["name"]
+    }
 }
 
 class Person: Object {

    
    let bag = DisposeBag()
    
    lazy var dog: Dog = {
        let realm = try! Realm()
        let dog = Dog()
//        try! realm.write {
//            realm.add(dog)
//        }
        return dog
    }()
    

            }))
            .disposed(by: bag)
        
        tickBtn.rx.tap
            .bind{[weak self] in
                self?.tickBtnClicked()
        }.disposed(by: bag)
        //                    .subscribe(onNext: { [unowned self] _ in
        //                        try! realm.write {
        //                            self.ticker.ticks += 1
        //                        }
        //                    })
        
        
        
        //        let myDog = Dog()
        //        myDog.name = "Rex"
        //        myDog.age = 1
        //        print("name of dog: \(myDog.name)")
        //
        //
        //        let puppies = realm.objects(Dog.self)
        //        //            .filter("age < 2")
        //        print(puppies.elements)
        //        print(puppies.count)
        //
        //        try! realm.write {
        //            realm.add(myDog)
        //        }
        //
        //        print(puppies.count)
        
        //        DispatchQueue(label: "background").async {
        //            autoreleasepool {
        //                let realm = try! Realm()
        //                let theDog = realm.objects(Dog.self).filter("age == 1").first
        //                try! realm.write {
        //                    theDog!.age = 3
        //                }
        //            }
        //        }
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
    }
    
    func tickBtnClicked(){
        print("tickBtnClicked")
    }
}

