0
votes

My Navigation bar already has two bar button items on it but my intention is to have the two items and the back button that is generated when a segue to another view happens.

This is what I have now (image those two "items" are a menu button and a cart) enter image description here

This is what I want it to look like enter image description here

Thanks!

1

1 Answers

2
votes

Try the Code

override func viewDidLoad() { 
    let hamburgerButton = UIBarButtonItem( ... )
    let backButton = UIBarButtonItem(image: <#UIImage?#>, style: <#UIBarButtonItemStyle#>, target: self, action: Selector("backButtonPressed:"))
    self.navigationItem.leftBarButtonItems = [hamburgerButton, backButton]
}

func backButtonPressed(sender:AnyObject) {
    self.navigationController!.popViewController(true)
}