vhesener/Closures

UIViewController

SentoCrespo opened this issue · 3 comments

It would be reaaaaally nice to have life cycle methods:
viewDidLoad
will/did appear/disappear
etc.

Thanks for this nice kit!

Interesting concept. I've thought about it in other lifecycle mechanisms, but not view controllers.

This will be different because UIViewController lifecycle methods are subclassed, rather than delegated. It's an interesting problem though.

Can you set the stage with a use case for how you would interact with these methods? I'm assuming from outside the controller, correct? Is there a particular navigation architecture (i.e. VIPER) that would benefit from this?

Hello Sir!

You're very right, indeed.
Model View Presenter for instance or any other architecture that separates the view from who controls it like VIPER, or MVVM or whatever. The presenter would be able to control everything from outside it, although I know it might be coupled to a specific type but I was only curious about all this concept.

Right now I'm using RxSwift with some extension for UIViewController that allows me to do such thing:
https://github.com/devxoul/RxViewController

Let me think for a little about how to do this. Stay tuned.