Search code examples
iosswift3rx-swiftrx-cocoa

TabelView Delegate methods using RxSwift


I am using RxSwift for TableView.I need to calculate height of dynamic cells previously I did it in WillDisplayCell delegate method. I don't know how to bind TableView Delegate methods with RxSwift. Can any one help?


Solution

  • Conform your View Controller

    class YourViewController: UIViewController, UITableViewDelegate
    

    Then add this in viewDidLoad()

    tableView.rx.setDelegate(self).addDisposableTo(disposeBag)
    

    then you write UITableViewDelegate methods.