I am designing registration form at iphone but i am confused about best approach.
I couldn't be sure how should i design views for best approach?
- Design each step new viewcontroller and push next viewcontroller when user clicks next.
- Design each step new view and set hidden=NO next view when user clicks next and set hidden=YES for current view.
At last, second approach seems more effective but Interface Builder seems doesn't help too much while designing.
Agree with your question that it's a tough to decide. I'd sum up the alternatives as many views corresponding to registration steps inside of one vc, or a container vc presenting many vcs where each one does a reg step.
Another alternative of the first variety (1 vc, many views) is to put the many views in a large uiscrollview with paging enabled.
I don't think there's a hard and fast answer, but my pref for a reg interaction is a single vc. The user probably understands reg as a single step with substeps, not as distinct parts of your app (which is implied by the vc push transition, imo).
You're right though, IB makes doing the design for this awkward. I've handled this challenge two ways: 1) just deal with it, including reordering views in ib so you can work on the uppermost one 2) build nibs for each view. load them all on viewDidLoad for the single vc. frame them in code
I recommend idea two for anything non-trivial on those views. Good luck.
I think the best approach for this would be to use a UINavigationController. It is very simple to set up in storyboards and will allow you to navigate back and forth between multiple view controllers with very little effort.
The user would be free to move around between the different parts of the form and on your end, the back action is handled for you and all you have to do to push forward is use:
UIViewController *myController = [self.storyboard instantiateViewControllerWithIdentifier:@"someID"]; [self.navigationController pushViewController:myController animated:YES];