-1

I consider creating Registration Wizard using UIPageViewController. I have seen that I can create each step (ith/nth) of registration in separate UIViewController and have scrollable animation on moving to the next steps.

However I have some doubts:

  1. I don't need forward swiping. I think that user should be obligated to fill form on current page and touch Next button in order to move foreward. So how can I block forward swiping? I would like to move to i+1 page programatically after user touching Next button, and correct ith step form validation.

  2. I think I could enable swiping backward to make some changes, and here I would like to have 2 possibilites

a) no changes made then forward swiping to ith step is possible

b) after modification then validation is needed and only Next button can change to forward page. But if next page has been filled previously I would like to have it filled and possibility to swipe forward as far as I meet page that hasn't been validated.

  1. So to sum up it seems that I need functionality to

a) programatically navigate in UIPageViewController forward/backward

b) some method like should navigate forward that conditionally enables/disables possibility of swiping forward.

... or if this approach with UIPageViewController isn't the best possible and there are better to make registration wizard (collecting profile data, settings, profile configurations, etc.) how can I do this in better way? Maybe should I go into some Navigation Controller or custom Collection View Controller, maybe solid 3rd party MIT license solutions for solving such problems.

Michał Ziobro
  • 7,390
  • 6
  • 50
  • 99

1 Answers1

0

I suggest using a Singleton object and a simple UINavigationController.

  • Going forward is simple as pushing a new UIViewController.
  • Going backwards would be always possible by swiping or tapping the back button. - In every viewWillAppear method of each VC manage your data by getting/setting data from/to your Singleton and update your UI
heyfrank
  • 4,302
  • 2
  • 26
  • 39