I’m trying to make an app where a user inputs some information and then performs a search based on that info and returns something based on the query.
I made the option-inputting view with no problems, but then came across a problem: how do I switch the view to a new view controller when a button is clicked? After some reading I thought about trying a RootViewController which could load different nibs but then I realised that it is advised to only have one view controller on the screen at once, so probably not a good idea to have a rootviewcontroller which loads an optionsviewcontroller and eventually a resultsviewcontroller. If that makes any sense!
If someone could point me in the right direction, at least so I know which questions I should be asking that’d be great.
You could consider using a
UINavigationController. It will allow you to seamlessly push view controllers on screen while at the same time keeping the ability to navigate back to the parent; so you could move back and forth between the result view controller and the option view controller. It is one of the main application templates provided by Xcode and one of the most common type of UI for iOS apps.Have a look at the class reference.