What ways are there to change views other than using a navigation-based app? I want my first view to be basically just a simple form and when the user hits a “submit” button I want to send him over to the main view, without being able to return. And I don’t want the bar on the top of the view either.
How can I achieve this, and if possible without losing the animations that come with a navigation-based app.
If you wanted your app to be entirely navigation controller free, you can use one of the signatures of
presentModalViewController:animated:from whichever UIViewController you deem best fit to be the parent. Call[self dismissModalViewControllerAnimated:YES]on the child view (form you want submitted) after you’ve handled state change on submit. One thing to watch out with this, is as of iOS 5, Apple now prefers that you usepresentViewController:instead, andpresentModalViewController:is marked for deprecation at a future date.In terms of “how you would know the user submitted the form, so they may now proceed in your application” – one way you could do that is to use delegation / notifications to maintain awareness of the state of the form. When the child form is submitted, you can call the parentViewController’s delegate callback to set flags – or return authentication data, for example – in your AppDelegate or some high-level class. Delegation and Notifications are useful tools when using the iOS SDK.
Option two could be using a completion handler in with your call to present the child, such as:
Lots of possibilities ~