Question

I have an app with a signup screen, which is basically just a form with a bunch of textfields and a few buttons. However, there are several distinct types of users, and some fields are either required, optional, or just not applicable based on the different type. Right now, one view controller handles displaying one view with all of the possible fields, and sections are shown/hidden as the user type requires. This is done in a Storyboard. However, as I'm being asked to add more fields in, I'm wondering if this is the best approach. Should I continue this way, or should I create separate nibs for each signup screen while still using the single view controller, or should I separate all of them out to their own view controllers? A lot of the submission and validation logic is similar, so I'd like to not have to duplicate it.

Was it helpful?

Solution

One possibility: You can design a complex view in a nib and then, when the app runs, you can load it from the nib without using a view controller and just swap it into place in your actual interface.

Another possibility: You could have multiple view controllers (each with its own interface) that are all subclasses of some single view controller.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top