Slide 43
Slide 43 text
Launch iPhone3G
iOS Developer since mid 2008
try! Realm().objects(ContactRealm)
.asObservableChangeset()
.subscribeNext { [weak self] results, changeset in
guard let tableView = self?.tableView else { return }
self?.results = results
if let changeset = changeset {
tableView.beginUpdates()
tableView.insertRowsAtIndexPaths(…, withRowAnimation: .Automatic)
tableView.deleteRowsAtIndexPaths(…, withRowAnimation: .Automatic)
tableView.reloadRowsAtIndexPaths(…, withRowAnimation: .Automatic)
tableView.endUpdates()
} else {
tableView.reloadData()
}
}.addDisposableTo(disposeBag)
e.g.