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 : enter image description here

by setting selectedviewcontroller:

func selecttab(atindex index: int) {     if index >= 0 && index < tabbarcontroller.viewcontrollers.count {        tabbarcontroller.selectedviewcontroller = tabbarcontroller.viewcontrollers[index]     } } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -