1

In my Xcode Swift project, I have a view controller that has a programatically created back button for the left bar button item. The text shows up, but the back arrow is missing. How do I add a back arrow so that it matches the other view controllers in my project? I'd prefer to not have to use a custom image, but if that is the only way then I'd like to know how to do it.

var backButton = UIBarButtonItem(title: "My List", style: UIBarButtonItemStyle.Plain, target: self, action: "goBack")
self.navigationItem.leftBarButtonItem = backButton
Josh
  • 1,031
  • 2
  • 19
  • 31

1 Answers1

4

I don't think you can.

As seen here and here you'll have to create the image.

let backButton = UIBarButtonItem(customView: "yourView")
self.navigationItem.leftBarButtonItem = backButton
Community
  • 1
  • 1
BenJammin
  • 1,479
  • 13
  • 18