You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added some additional methods to "AXStretchableHeaderTabViewController.m" to add this feature.
-(void)setCurrentViewControllerToIndex:(int)index
{
if(_viewControllers.count > index)
{
[_tabBar setSelectedItem:_tabBar.items[index]];
[self didSelectTabBarItemAtIndex:index];
[self layoutSubViewControllerToSelectedViewController:self.selectedViewController];
}
}
-(void)setCurrentViewControllerToTabName:(NSString *)tabName
{
//search through each tab bar button to find out which one matches the requested page
[_tabBar.items enumerateObjectsUsingBlock:^(UIBarButtonItem *barButton, NSUInteger idx, BOOL *stop)
{
//if the button matches our text
if([barButton.title isEqualToString:tabName])
{
//get the index of this button and set the view controller based on this index
int indexOfButton = (int)[_tabBar.items indexOfObject:barButton];
[self setCurrentViewControllerToIndex:indexOfButton];
//return out of the enumeration, we only expect to find one match
return;
}
}];
}
What's the recommended way to make the second sub view controller selected after the AXStretchableHeaderTabViewController has loaded?
The text was updated successfully, but these errors were encountered: