The usual flow is the stack. Push views and pop views. My requirements is a bit complex and I did not find a way to do it in IOS 16.
Let say we have a
- Cover page
- Contents page
- Details page
Now, the requirements;
Cover page
can push theDetails page
; this is easy.Cover page
can push theContents page
; this is also easy.Contents page
can push theDetails page
; this is also easy.
Now;
- Whatever way the
Details page
is pushed (1 or 3), it must return to Contents page
Is this a possible requirement? If so, any guidance is welcome.
PS: sorry no code since there is no solution that I've figured!
NavigationPath is a stack that doesn't allow insertion. Instead one can use array as used in hackingwithswift. Each page is represented with a number except the root page.
There is a nice feature of the path; one doesn't need to dismiss the page with environmental presentation mode (see). Once the last number is removed the page dismissed.
The insertion is easy, however, the animation doesn't exist when returning to the inserted page. This is a bug, I think.
Yes, the new navigation opens the path to complex navigations.
Many thanks to lorem-ipsum for their constructive comments.
Update: if the page loading time is fast then it can turn back the inserted page with animation, however, on a page that takes time, the animation is not performed. This is my observation and maybe the reason is something else.