0

In my iOS/iPhone app I use a root view that shows a login form after startup (presented as modal view). After the user entered the login data, another view shall be shown:

[self dismissModalViewControllerAnimated:NO];
// Init UIViewController collector
collector.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:collector animated:YES]

What happens is:

  • The login view is dismissed, the root view is shown
  • The root view flips to the collector view

What I want to do

  • The login view flips to the collector view (without showing the root view)

If I enable the animation in step 1, I receive an error that an animation is running and view two is not shown. Absolutely clear. Any suggestion how to explain iOS 6 that I do not want the root view to blink up? Thanks!

paulmelnikow
  • 16,895
  • 8
  • 63
  • 114
BurninLeo
  • 4,240
  • 4
  • 39
  • 56
  • Why are you presenting viewcontroller modally and not by NavigationController. If it's because of animation, there are ways to achieve it using navigationController itself. – Anupdas Mar 07 '13 at 10:21
  • The login form is something that the user must complete before he can continue. Further, the order of views is strictly defined (this app is rather a scientific tool). Therefore presenting the view modally seemed the correct solution. Am I wrong? – BurninLeo Mar 07 '13 at 10:25
  • There is nothing wrong in this approach. Login Screen to detail screen is a regular screen flow. Usually viewController is presented modally when some non regular or a different context is shown. Can you share a little more data about the app, just the different screens. – Anupdas Mar 07 '13 at 10:54
  • Well - what exactly do you mean? Both screens are created with Interface Builder. The login screen shos a text field for the login code. The other screen shows a few labels and an image to move around via touch. But I think this is not what you meant? I should add that the second view used to be my root view (MainView) once, but in the current version I need to show different views (using the same controller) depending on the login. – BurninLeo Mar 07 '13 at 10:59
  • @BurningLeo I was asking if you could show LoginViewController as your RootViewController and on successful authentication, you can your "Current MainViewController". – Anupdas Mar 07 '13 at 11:13
  • Well, I have another switch from the second screen to a goodbye screen later - same problem. If I make the login view my root view then is would blink up on the second switch. Worse, further versions may support more switches. I cannot beliefe that iOS does not support an animated switch from one (child) ViewController to another?! – BurninLeo Mar 07 '13 at 13:35
  • Sorry, I didn't understand what you said. Please take a look at this answer, you add a category to UINavigationController, and can almost have any transition. http://stackoverflow.com/a/2445775/767730 – Anupdas Mar 07 '13 at 13:43
  • If I understand the UINavigationController correctly, it "stacks" the views. That would work for some views (I could also stack modal views) but when the app should support multiple switches in future, ressources may become an issue. Did I misundestand the NavController or you? – BurninLeo Mar 07 '13 at 13:46
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/25775/discussion-between-anupdas-and-burninleo) – Anupdas Mar 07 '13 at 13:47

0 Answers0