I have two views ViewA and ViewB. From ViewA, I can navigate to ViewB through a table view cell select which is very common. My ViewA has a UIPageControl and several virtual pages so i can swap to select Page1 or Page2 in ViewA and navigate to ViewB accordingly(I set up properties of ViewB before view appears).
That works perfectly except one problem. Since it is a navigation based, and I do have a system provided back button. When I am at ViewB and navigate back to ViewA, it always loads Page1. Is there a way to dynamically navigate to different page of ViewA when the back button is tapped?
Thanks very much for reading my question.
In view A’s viewWillDisappear() function, save the currently displayed page (or it’s number).
And then in viewWillDisappear(), check if a page has been saved, and then display the correct page.
Hope that helps.