Last active
March 19, 2020 20:47
-
-
Save adevone/685ec7a397b22f47c2171e79ae5c0966 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseController: UIViewController { | |
private var controller: SummerPresenterController! | |
func setPresenter(_ controller: SummerPresenterController) { | |
controller.setViewProviderUnsafe(viewProvider: { [weak self] in | |
return self | |
}) | |
self.controller = controller | |
} | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
if controller == nil { | |
fatalError("\(String(describing: self)) call setPresenter before super.viewDidLoad") | |
} | |
controller.viewCreated() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment