1) Original implementation of the chain of persistence:
loop through view controller hierarchy
alloc + init next view controller
restore its persistent state (here is the recursion to the next level).
push or present it
2) Since iOS 3, some of the view-related states could not be restored before the view is available.
In these cases we modified the implementation:
loop through view controller hierarchy
alloc + init next view controller
restore part of its persistent state (here is the recursion to the next level).
push or present it
apply remaining part of its persistent state.
3) The current implementation as outlined in (2) is confusing; but worse, it is fragile.
We get warnings like "Presenting view controllers on detached view controllers is discouraged."
Actually, it is recommended to delay the presentation of the next view controller till viewWillAppear.
Resolved in svn 3546, however following open issues:
a) Single card from Card list, then Question
b) Single card from card list, then select category
c) Single card from Drill
d) DB edit, rename database (this one is #436, and is resolved in svn 3549 / 3550).
Open issue (c) fixed in svn 3555.
(a) and (b) are still open.
The broken scenario in detail:
Expected behaviour: see the learning data.
Observed behaviour: see the card list.
Similar behaviour for card / select categorie, and for the question or answer view after single card.
open issues (a) and (b) resolved in svn 3561.
Tested on true device iPad Air 2 (iOS 11 beta) at svn 3563.
The logic is correct.
The animations for modal views are not perfect, I will open a separate tracker for this.