How to programmatically set action for barButtonItem in swift 3?

后端 未结 12 1550
鱼传尺愫
鱼传尺愫 2020-12-23 16:17

Here is what I used previously,

var barButtonItem = UIBarButtonItem(image: backImgs, style: UIBarButtonItemStyle.plain, target: self, action: Selector(\"menu         


        
12条回答
  •  失恋的感觉
    2020-12-23 16:44

    ex:-

    navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(addTapped))
    

提交回复
热议问题