swift 給導航增加item,實現介面的跳轉

來源:互聯網
上載者:User

標籤:ios   swift   導航   介面   


//給導航增加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 給導航增加item,實現介面的跳轉

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.