Posts

Showing posts with the label uibarbuttonitem

Swift Custom NavBar Back Button Image and Text

Image
Clash Royale CLAN TAG #URR8PPP Swift Custom NavBar Back Button Image and Text I need to customise the look of a back button in a Swift project. Here's what I have: Here's what I want: I've tried creating my own UIBarButtonItem but I can't figure out how to get the image to be beside the text, rather than as a background or a replacement for the text. let backButton = UIBarButtonItem(title: "Custom", style: .Plain, target: self, action: nil ) //backButton.image = UIImage(named: "imageName") //Replaces title backButton.setBackgroundImage(UIImage(named: "imageName"), forState: .Normal, barMetrics: .Default) // Stretches image navigationItem.setLeftBarButtonItem(backButton, animated: false) @Randy You mean make a UIView and add a Label and ImageView and set that? – Conor May 31 '16 at 18:25 ...