ios - Change UITabBar selected view programmatically -
i'm trying update uitabbar
selected view programmatically i've tried below code :
uiviewcontroller *currentview = self.frostedviewcontroller.contentviewcontroller; nslog(@"current index %lu", currentview.tabbarcontroller.selectedindex); currentview.tabbarcontroller.selectedindex = 3; nslog(@"changing index %lu", currentview.tabbarcontroller.selectedindex); //self.frostedviewcontroller.contentviewcontroller = categorie; [self.frostedviewcontroller hidemenuviewcontroller];
but tab bar view not changing check image :
by setting selectedviewcontroller:
func selecttab(atindex index: int) { if index >= 0 && index < tabbarcontroller.viewcontrollers.count { tabbarcontroller.selectedviewcontroller = tabbarcontroller.viewcontrollers[index] } }
Comments
Post a Comment