Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewControllers don't maintain state on modal dismissal #10

Closed
aernum opened this issue Jan 31, 2015 · 8 comments
Closed

ViewControllers don't maintain state on modal dismissal #10

aernum opened this issue Jan 31, 2015 · 8 comments

Comments

@aernum
Copy link

aernum commented Jan 31, 2015

When I dismiss a modal within one of my view controllers, the swipe controller somehow resets back to the first view controller in the array. I've tried to set it back to the right view controller in the completion block of the modal dismissal, but that didn't work. Any ideas?

@cwRichardKim
Copy link
Owner

interesting, do you mind giving me an example? screenshots might help, sorry for the late response

@nashsu
Copy link

nashsu commented Feb 22, 2015

I have the same problem, I embed the swipe controller in a tab bar controller, and when I change to another tab and then change back, the swipe controller reset back to first view controller. Hope you can help me, thx.

@tomoyuki28jp
Copy link

+1 I had the same problem.

@cwRichardKim
Copy link
Owner

It's funny that this is such an obvious thing but I've never needed it. Hmm, so I will probably work on a full solution some time later, but for now I would recommend storing what page you left off on, and then calling the UIPageViewController delegate function for turning pages

http://stackoverflow.com/questions/7208871/is-it-possible-to-turn-page-programmatically-in-uipageviewcontroller

http://stackoverflow.com/questions/13633059/uipageviewcontroller-how-do-i-correctly-jump-to-a-specific-page-without-messing

Thanks for letting me know, I'll keep this open until I build it out

@nashsu
Copy link

nashsu commented Feb 24, 2015

I think the reason is that you put setup code in viewDidAppear, I move setup codes into viewDidLoad, and every thing works fine.

@cwRichardKim
Copy link
Owner

weird, I hardly ever put code in viewDidAppear without good reason. I'll do some investigation, but thanks for helping out

@aernum
Copy link
Author

aernum commented Apr 28, 2015

Hi @cwRichardKim this was closed but was it fixed?

@cwRichardKim
Copy link
Owner

Apologies, forgot to push but yea this should be fixed at master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants