override func viewDidLoad() {
super.viewDidLoad()
let _btBack = UIButton(type: .Custom)
_btBack.addTarget(self, action: "returnToRoot:", forControlEvents: UIControlEvents.TouchUpInside)
_btBack.setImage(UIImage(named: "arrow-left")?.imageWithRenderingMode(.AlwaysTemplate), forState: .Normal)
_btBack.imageView?.tintColor = UIColor.whiteColor()
_btBack.sizeToFit()
self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: _btBack)
self.navigationController?.setNavigationBarHidden(false, animated:true)
}
func returnToRoot() {
if let navContr = self.navigationController {
navContr.popViewControllerAnimated(true)
}
}