如何在UISplitViewController中更改动作BackButton?

时间:2015-02-16 15:14:14

标签: swift uinavigationbar uisplitviewcontroller uinavigationitem

我有Split View Controller。 我想在swift上改变动作后退按钮。 我做了什么?

image http://organictraffic.mobi/quations.png

1 个答案:

答案 0 :(得分:1)

试试这个:

override func viewDidLoad() {
    super.viewDidLoad()

    var button = UIBarButtonItem(title: "YourNewButton", style: UIBarButtonItemStyle.Bordered, target: self, action: "doSomething")
    self.navigationItem.leftBarButtonItem = button

}

func doSomething()
{
    //do something
    var vc = YourDestinationViewController()

    self.presentViewController(vc, animated: true, completion: nil)
}
相关问题