             }))
             .disposed(by: bag)
         
-//        tickBtn.rx.tap
-//            .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
-                }
-            }
-        }
+        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) {
-        Observable.changeset(from: dogs)
-            .subscribe(onNext: { [unowned self] _, changes in
-                if let changes = changes {
-                    self.tableView.applyChangeset(changes)
-                } else {
-                    self.tableView.reloadData()
-                }
-                
-            }).disposed(by: bag)
+        super.viewWillAppear(animated)
+    }
+    
+    func tickBtnClicked(){
+        print("tickBtnClicked")
     }
 }
 

        }
        .disposed(by: bag)
        
        
        addBtn.rx.tap
            .map{ [Dog(name: "dogname1", age: 4), Dog(name: "dogname2", age: 5)] }

    override func viewDidLoad() {
        super.viewDidLoad()
        
        tableView.rx.setDelegate(self).disposed(by: bag)
        
        Realm.Configuration.defaultConfiguration = config
        let realm = try! Realm()
