swift - How to add barButtonItem to ToolBar -
how convert code have button appear in toolbar? :
navigationitem.rightbarbuttonitem = editbuttonitem()
try this,
let barbuttonitem = uibarbuttonitem(title: "edit", style: .plain, target: self, action: "oneditbuttontapped:") self.navigationitem.rightbarbuttonitem = barbuttonitem
then write action function likes this,
func oneditbuttontapped(sender:uibarbuttonitem) { ... }
Comments
Post a Comment