-
Notifications
You must be signed in to change notification settings - Fork 2
Director
Anton Goncharov edited this page May 12, 2020
·
5 revisions
Director is an entity that controls the behavior of UITableView or UICollectionView.
Сreate Director in your UIViewController and subscribe to sections using it. Also, don't forget to set director as tableView/collectionView delegate.
let director = TableDirector()
Observable.just(sections)
.bind(to: tableView.rx.items(director: director))
.disposed(by: disposeBag)
tableView.rx.setDelegate(director)
.disposed(by: disposeBag)See Creating your first list and Events in Cells for details.
It can also be animatable. To make Director animatable just pass AnimationConfiguration instance into Director init. AnimationConfiguration has default values fade and shift. To turn off animations just leave init empty. Note that you can't use animatable UITableView if you have nested collection in it. For more details see Nested Collection.