Here is what I used previously,
var barButtonItem = UIBarButtonItem(image: backImgs, style: UIBarButtonItemStyle.plain, target: self, action: Selector(\"menu
In Swift 3, you can add UIBarButtonItem like that,
let addButton = UIBarButtonItem(image:UIImage(named:"your_icon_name"), style:.plain, target:self, action:#selector(YourControllerName.buttonAction(_:)))
addButton.tintColor = UIColor.white
self.navigationItem.rightBarButtonItem = addButton
And handle button action like that,
func buttonAction(_ sender: UIBarButtonItem) {
}
Hope it helps.