BMViewController
open class BMViewController<View> : UIViewController where View : UIView, View : BMViewWithViewControllerAndViewModelOverview
A BMViewController replaces the default UIViewController. It manages a single screen,
and listen to the users interactions with it.
Refer to BMViewWithViewControllerAndViewModel to understand the architecture of a view.
The BMViewController gives you access to a rootView which is the view properly casted.
- 
                  
                  The rootView associated with the BMViewController.DeclarationSwift public var rootView: View { get }
- 
                  
                  The latest ViewModelreceived by thisBMViewControllerThis should not be directly set. Please useupdate(to: View.VM).DeclarationSwift public var viewModel: View.VM? { get set }
- 
                  
                  An more convenient initializer. Since we are not not using the storyboard DeclarationSwift public init()
- 
                  
                  Required init. DeclarationSwift required public init?(coder aDecoder: NSCoder)
- 
                  
                  Used to load the specific main view managed by this view controller. DeclarationSwift override public func loadView()
- 
                  
                  Called after the controller's view is loaded into memory. DeclarationSwift override open func viewDidLoad()
- 
                  
                  Called when view about to layout subviews. DeclarationSwift open override func viewWillLayoutSubviews()
- 
                  
                  Called everytime the VM needs to be updated. Should be called on the main Thread. DeclarationSwift public func update(to newModel: View.VM)ParametersnewModelThe new ViewModel
- 
                  
                  Called just before the update, override point for subclasses. DeclarationSwift open func willUpdate(new: View.VM?)
- 
                  
                  Called right after the update, override point for subclasses. DeclarationSwift open func didUpdate(old: View.VM?)
- 
                  
                  Asks to setup the interaction with the managed view, override point for subclasses. DeclarationSwift open func setupInteractions()
- 
                  
                  Adds a BMViewControllerand its root view toDeclarationSwift func add<V: BMViewWithViewControllerAndViewModel & UIView>( _ child: BMViewController<V>, to container: BMContainerView )ParameterschildThe child view controller to add to the hierarchy. containerThe container in which the view of the child should go in. 
- 
                  
                  Removes a BMViewControllerand its view from the parent view controller.DeclarationSwift func remove()
 View on GitHub
View on GitHub BMViewController Class Reference
        BMViewController Class Reference