Skip to content

Chapter 3. Binder.

Dmitriy Shulzhenko edited this page Sep 25, 2020 · 4 revisions

Here is a definition of ViewControllerBinder protocol. It is so common to touch the view of the view controller inside of the “viewDidLoad”. There are rare cases where we use a different approach, but the current one suits 99% of the time.

import RxSwift

protocol ViewControllerBinder: Disposable {
    associatedtype DisposeViewControllerContainer: UIViewController, DisposeContainer
    
    var viewController: DisposeViewControllerContainer { get }
    
    func bindLoaded()
}

And how actual logic can be implemented.

Style from config State binding Actions binding

Want even more separation of UI logic? Look further.

Clone this wiki locally