ios - how replace self.navigationItem.leftBarButtonItem = self.editButtonItem() } with button action -


i replace barbuttonitem's self.editbuttonitem() button @ibaction..

override func viewdidload() {     super.viewdidload()     ....     self.navigationitem.leftbarbuttonitem = self.editbuttonitem() } 

i delete self.navigationitem.leftbarbuttonitem = self.editbuttonitem() above code

i wanna replace @ibaction button () { code }...

what's code?

let barbutton = uibarbuttonitem(title: "button", style: .plain, target: self, action: "buttonaction:") self.navigationitem.leftbarbuttonitem = barbutton  @ibaction func buttonaction(sender:anyobject?) {      //do thing } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -