views:

569

answers:

2

Hi,

My app uses a landscape only view and requires the user to answer a series of questions using a UISlider to select their answer before clicking "Next" to move to the next question.

The user can't go back to previous questions so only has one "direction" of travel. Once the final question is answered the app will return them to the Main Menu view.

I've had some trouble with the slide transition sliding the next view in but it thinks it is in portrait mode. I have seen a solution somewhere that NavController fixes this but is that necessary for my app?

The user doesn't really navigate as they can only go to the next screen, never to the previous.

If anyone has any other opinions on how to implement this it'd be much appreciated.

Thanks!

Oliver

+2  A: 

I'm not sure if I know exactly what you want... but from what I understand I would simply use a navigation controller to handle all of the transitions. You can hide the back button so the user can't go back and all of the view animation comes with it! When the user selects an answer, just push the next question on the navigation controller's stack. Once you get to the end of the list, just pop off all the view controllers to get back to the start (main menu).

Is this kind of what you wanted? If you need help with some code snippets I can add some.

Ryan Ferretti
+1 I would add that as a general rule you should use a nav controller whenever an action in one view causes another view to load. It might seem like overkill but it saves headaches in the long run
TechZen
Thanks guys, that helps a lot. Saves some hassle. I was worried that the NavigationController would be overkill and cumbersome for what I wanted but I guess if it works I shouldn't complain :D
Fogmeister
TechZen is exactly right... it is generally easier to customize what apple has provided rather than create something from scratch
Ryan Ferretti
Well, I'm back home and just tried this on my app and it works brilliantly :DThanks again!
Fogmeister
One last question regarding this. There could be up to 40 questions in the app that will need to be answered. They will all be objects of the same class and an Array will control the content. Anyway, seeing as I am not going to be letting people go back through the navcontroller could I release the views as I go? i.e. push a new view and release the old one?Do i even need to do that or will they get released automatically?Thanks again!
Fogmeister
I wouldn't worry about releasing them right away... The NavigationController will retain each controller pushed onto the stack so if you want to release anything it should be done from there. I start with that though... if I were you, I would START with releasing the data of each question after the user selects an answer and you push on a new controller... if you are still having problems after that, then I would start releasing the old controllers (this probably could have been a new question :)
Ryan Ferretti
A: 

I think you will have to transform the transition so that it slides in on the right axis. By default it will slide right-left in portrait. The transition animation doesn't actually know the orientation of the device or the view.

TechZen
if you want to see view animations in action check out apples sample app: http://developer.apple.com/iphone/library/samplecode/ViewTransitions/index.html
Ryan Ferretti