CLASS
ScreenViewController
¶
Generic base class that can be subclassed in order to to define a UI implementation that is powered by the given screen type.
Using this base class, a screen can be implemented as:
struct MyScreen: Screen {
func viewControllerDescription(environment: ViewEnvironment) -> ViewControllerDescription {
return MyScreenViewController.description(for: self, environment: environment)
}
}
private class MyScreenViewController: ScreenViewController<MyScreen> {
override func screenDidChange(from previousScreen: MyScreen, previousEnvironment: ViewEnvironment) {
// … update views as necessary
}
}
Properties¶
screen
¶
screenType
¶
Methods¶
init(screen:environment:)
¶
init(coder:)
¶
update(screen:)
¶
screenDidChange(from:previousEnvironment:)
¶
Subclasses should override this method in order to update any relevant UI bits when the screen model changes.