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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -