Had a quick question:
I have 2 view controllers, and their associated views.
The first VC have images which have been coloured through masking. This is a link to the technique I will be employing.
The second VC and view is simply a settings screen that will hold random content.
Assume this scenario:
-
First VC with images is loaded up and the coloring is completed
NOTE: Coloring is random and the value is not stored anywhere. With
so many images it would be difficult to store all those random
colors in variables. -
On the First VC the user presses the button navigating to the
setting screen -
the Second VC is now loaded, via a Modal operation
-
On the Second VC the user presses a “back” button to return to
the previous VC, which in this case is the First VC.
The question: During navigation and after the the navigation back to the First VC will the images and colors I randomly and programmatically chose still be visible or will I lose those randomly generated colors? If not how do I ensure that what has been rendered on the First VC will be maintained throughout any navigation operations?
As long as the View Controller stays on the navigation stack, all of the data it holds will still be valid when you return to it. Pushing any number of View Controllers on top of the stack will do nothing to the first view controller, but as soon as you pop the first one off of the stack, it will lose any data it had unless saved otherwise and reloaded(in a variable in the App Delegate, for example).