Frank
Frank

Reputation: 507

Problems with backBarButtonItem

I am trying to make a backBarButton so that it performs its function like in normal apps. I made a segue from my button to the previous view controller and chose "push". It works like a normal button, but not like a backBarButtonItem should work. What am I doing wrong?

Upvotes: 0

Views: 114

Answers (2)

user1410948
user1410948

Reputation: 41

If you do not want to use the NavigationController and are just trying to mimic the back button behavior you want to use popViewControllerAnimated not push.

Upvotes: 0

Eli Waxman
Eli Waxman

Reputation: 2897

you should embed the whole view with a NavigationController; in Xcode in the Storyboard : Editor - embed in navigation controller and change all the segues to push from modal.

You don't need a back button because it will be created automatically , the only segues you create is from vc1 to vc2 and the NavigationController takes care of the back button.

Upvotes: 3

Related Questions