//设置设置导航栏标题
self.title="主页"
//设置导航栏背景色
self.navigationController?.navigationBar.barTintColor=UIColor.grayColor()
//导航栏还可以设置图片
self.navigationController?.navigationBar.setBackgroundImage(UIImage(named: "testnavigationBar"), forBarMetrics: UIBarMetrics.Default)
//导航是否透明
self.navigationController?.navigationBar.translucent=false
//隐藏导航栏
self.navigationController?.navigationBarHidden=true
//导航push到新view controller中(左右效果)
let secondViewController = SecondViewController()
self.navigationController!.pushViewController(secondViewController,animated:true)
//返回上一级页面
let firstViewController = FirstViewController()
self.navigationController?.popViewControllerAnimated(true)
// 获得视图控制器中的某一视图控制器
let viewController =self.navigationController?.viewControllers[0]
self.navigationController?.popToViewController(viewController as! UIViewController,animated:true)
//导航push到新view controller中(上下效果)
let secondViewController = SecondViewController()
self.presentViewController(secondViewController,animated:true,completion:nil)