ios - how to remove a bar button in swift 3? -
i have used swrevealviewcontroller having side menu , in having myaccount page use navigate myaccount page. according requirement placed tab bar in storyboard in 1 tab used account page , tab bar placed using storyboard , here while moving tab bar account page, need remove bar button placed in storyboard. can 1 me how implement ?
you can hide menu button setting nill in viewdidload
self.navigationitem.leftbarbuttonitem = nil;
store controller identity in userdefault(sidemenu , tabbar) like
//leaving side menu account userdefaults.standard.set("side", forkey: "menubutton") //leaving side menu account userdefaults.standard.set("tab", forkey: "menubutton")
when view disappear , check menubutton
key in myaccount , show/hide menu button like
let controllername = userdefaults.standard.value(forkey: "menubutton") if (controllername == "side") { } else { self.navigationitem.leftbarbuttonitem = nil; }
Comments
Post a Comment