Posts

Post not yet marked as solved
1 Replies
350 Views
I'm working on an app that presents a series of view controllers. There is no navigation controller because once the user goes through a view, we want him to continue to the next view. I've implemented the basic boiler plate delegation methods for restoration, namely application(_:shouldSaveApplicationState:) and application(_:shouldRestoreApplicationState:). I also made sure that all my view controllers have their restoration ID set. I'm doing all of this because if the user goes in the privacy settings and changes one of the settings for our app, the app is terminated. The next time the user opens the app, I obviously want him to land exactly where he left. It's kinda working except with one twist: all the view controllers that were presented before the last one are briefly shown. That's not exaclty what I would want. I would want to only display the last view controller that was shown before the user went to the Settings.I tried implementing application(_:viewControllerWithRestorationIdentifierPath:coder:). This method gets called multiple times when the app relauinch. Initially, the array of restoration IDs has only the restoration ID of the first view controller that was displayed. Then, the method is called again and this time both the restoration IDs of the first 2 view controllers are in the array. And it does this 4 times, each time, the array has an additional restorarion ID for a view controller that was displayed. I followed the directions and tried to return the view controller matching the last restoration ID in the array but that didn't change anything as each view controller is displayed.Obviously, I'm missing something. Anybody has any idea?Thanks in advance!
Posted
by ldaudelin.
Last updated
.