ashfurrow / C-41

C-41 is an application to help people develop film at home by providing a series of "recipes" for photographers to use.
MIT License
2.05k stars 368 forks source link

How to implement state restoration of view model? #15

Closed kkazuo closed 10 years ago

kkazuo commented 10 years ago

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?

kkazuo commented 10 years ago

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.