BWSnippet

Swift Right Bar Button Items

Swift Right Bar Button Items

Setting the right bar button items on nav controller with swift.

let doneBtn = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Done , target: self, action: #selector(controller.donePressed) )

let editBtn = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Edit , target: self, action: #selector(controller.editPressed) )

navigationItem.rightBarButtonItems = [ doneBtn , editBtn]

 

Tags

Swift Right Bar Button Items