uwotm8
uwotm8

Reputation: 123

Xcode / Swift Back Button On View Controllers

Got a few view controllers connected up, how ever i do not have the default IOS style back button in the nav bar. How do i add this in with out messing up the existing layout of the view controllers

Thanks!

Upvotes: 1

Views: 352

Answers (1)

Duncan C
Duncan C

Reputation: 131418

You haven't provided a lot of information, so it's a bit hard to tell what you are asking.

You need to use push transitions from the navigation controller's root view controller to each subsequent view controller. If you do that you should have back buttons on all but the root view controller.

The call is

pushViewController(_:animated)

And the function definition is

func pushViewController(viewController: UIViewController,
           animated animated: Bool)

You can also use push segues, which invoke the push call above.

Upvotes: 1

Related Questions