swift 给导航增加item,实现界面的跳转

前端之家收集整理的这篇文章主要介绍了swift 给导航增加item,实现界面的跳转前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


//给导航增加item
var rightItem = UIBarButtonItem(title: "First",style: UIBarButtonItemStyle.Plain,target: self,action: "fisrtItem:")
rightItem.title = "First"
self.navigationItem.rightBarButtonItem = rightItem


点击事件

func fisrtItem(right:UIBarButtonItem) { var vc = ViewController2() self.navigationController?.pushViewController(vc,animated: true) }

猜你在找的Swift相关文章