ios - Delete an action from the NavigationBar -


i have 3 views 3 controllers: homeview -> loginview -> accountview in homeview added navigationbarcontroller. when user logs in in loginview, moved accountview. when clicks on button in navigationbar, sent loginview , problem. after logging if user clicks on button, want show him homeview , not loginview. tried code takes time executed , can see loginview milliseconds.

override func viewwillappear(animated: bool) {        if let token = userdefaults.valueforkey("token") { //user logged in         self.performseguewithidentifier("homesegue", sender: self)     } } 

is there way it?

at viewdidapper in accountview, can delete loginview viewcontrollers stack way

self.navigationcontroller?.viewcontrollers.removeatindex(1) 

this way, if user go back, he/she see home page requested


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -