Closed kkazuo closed 10 years ago
Should I implement -application:viewControllerWithRestorationIdentifierPath:coder: for all view controllers and assign viewModel at runtime?
-application:viewControllerWithRestorationIdentifierPath:coder:
When using Storyboard, view controller restoration is automatic, but viewModel is not. Could you show an idea?
I found the solution.
Use DI (Dependency Injection). http://railsware.com/blog/2013/10/15/dependency-injection-in-objective-c-with-blood-and-magic/
Thanks.
Should I implement
-application:viewControllerWithRestorationIdentifierPath:coder:
for all view controllers and assign viewModel at runtime?When using Storyboard, view controller restoration is automatic, but viewModel is not. Could you show an idea?