[Solved] How to put the burger icon in a UIBarButtonItem?

You’ll want to use the UIBarButtonItem constructor init(image: UIImage?, style: UIBarButtonItemStyle, target: Any?, action: Selector?) an example usage would be: self.navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: “burger_icon”), style: .plain, target: self, action: #selector(self.someMethod)) In this example “burger_icon” is the name of the image asset in your project and self.someMethod is the method that is called when this … Read more

[Solved] Default Back Button Text and Font Setting

Change your code in viewDidLoad like this. class BaseViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } func setNavigationWithCustomBackButton() { let btnLeft:UIButton! = UIButton(frame: CGRectMake(0, 0, 20, 16)) btnLeft.setTitle(“<=|”, forState: .Normal) btnLeft.titleLabel?.font = UIFont.systemFontOfSize(19, weight: UIFontWeightLight) btnLeft!.addTarget(self, action: “handleBack:”,forControlEvents: UIControlEvents.TouchUpInside) let leftItem:UIBarButtonItem = UIBarButtonItem(customView: btnLeft!) self.navigationItem.leftBarButtonItem = leftItem } func handleBack(sender: UIButton) { self.navigationController?.popViewControllerAnimated(true) } … Read more