Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24663] (6_1_X) iOS: Fix TabGroup more-tab crash #9029

Merged
merged 3 commits into from
May 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion iphone/Classes/TiUITabGroup.m
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectView

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
// TIMOB-24663: Previous implementations nil'd the VC and then passed it, which is invalid.
// Now we check if the VC should be passed and if not we pass nil instead of nilling the VC itself.
BOOL shouldPassVC = YES;

if ([tabBarController moreNavigationController] == viewController)
{
if (self != [(UINavigationController *)viewController delegate])
Expand All @@ -349,11 +353,12 @@ - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewCon
else
{
[self updateMoreBar:(UINavigationController *)viewController];
shouldPassVC = NO;
}

}

[self handleDidShowTab:(TiUITabProxy *)[(UINavigationController *)viewController delegate]];
[self handleDidShowTab:shouldPassVC ? (TiUITabProxy *)[(UINavigationController *)viewController delegate] : nil];
}

- (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed
Expand Down