-2

Like many apps, I have a main screen in my app that I want the app to launch to, but they also have the option of going back a screen to somewhat of a "home" view. I don't want to present this modally, as it is technically "before" the view controller they launch at.

So if my navigation controller has this first "home" view controller, then the "main" view controller after that (then some others after that...) how do I start the app at the second, main view controller and still allow them to easily press back to go home?

I tried setting my "Initial view controller" in my Storyboard to the second one, but it doesn't seem to work as it doesn't show the navigation bar and seemingly won't allow you to go back.

Doug Smith
  • 29,668
  • 57
  • 204
  • 388

2 Answers2

1

I'd recommend setting the "home" view controller as the "Initial view controller", but then segueing to the "main" view controller in the viewDidLoad or viewWillAppear of your "home" view controller; that way, unlike in Mike's answer, you can dismiss that "main" view and go back to the "home" view before it such that it's the only view controller on the stack.

Lyndsey Scott
  • 37,080
  • 10
  • 92
  • 128
  • Can you please check out this question? http://stackoverflow.com/questions/27632093/insert-a-uisearchbar-in-ios-8-xcode-6 and maybe you can find an answer? – Horray Dec 24 '14 at 18:46
0

You should make the second viewController the initial view, then make a UIBarButton on the second viewController, to let the user go back.

Horray
  • 693
  • 10
  • 25