Skip to content

Commit

Permalink
fix(ios): navigation bar jumps at end of open animation on iOS15
Browse files Browse the repository at this point in the history
Fixes TIMOB-28488
  • Loading branch information
jquick-axway authored and ewanharris committed Sep 14, 2021
1 parent 54132d2 commit d334ac9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
17 changes: 4 additions & 13 deletions iphone/Classes/TiUINavigationWindowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ - (void)cleanNavStack
#pragma mark - TiWindowProtocol
- (void)viewWillAppear:(BOOL)animated
{
if ([self viewAttached]) {
if (navController && [self viewAttached]) {
UIViewController *parentController = [self windowHoldingController];
[parentController addChildViewController:navController];
[navController didMoveToParentViewController:parentController];
[navController viewWillAppear:animated];
}
[super viewWillAppear:animated];
Expand Down Expand Up @@ -527,18 +530,6 @@ - (void)windowWillOpen
[super windowWillOpen];
}

- (void)windowDidOpen
{
// Set parent for navigation controller
if (navController) {
UIViewController *parentController = [self windowHoldingController];
[parentController addChildViewController:navController];
[navController didMoveToParentViewController:parentController];
}

[super windowDidOpen];
}

- (void)windowDidClose
{
[self cleanNavStack];
Expand Down
16 changes: 3 additions & 13 deletions iphone/Classes/TiUITabGroupProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,6 @@ - (void)windowWillOpen
[super windowWillOpen];
}

- (void)windowDidOpen
{
// Set parent view controller for UITabBarController
TiUITabGroup *tabGroup = (TiUITabGroup *)self.view;
if (tabGroup) {
UITabBarController *tabController = [tabGroup tabController];
UIViewController *parentController = [self windowHoldingController];
[parentController addChildViewController:tabController];
[tabController didMoveToParentViewController:parentController];
}
[super windowDidOpen];
}

- (void)windowWillClose
{
TiUITabGroup *tabGroup = (TiUITabGroup *)self.view;
Expand Down Expand Up @@ -230,6 +217,9 @@ - (void)viewWillAppear:(BOOL)animated;
{
if ([self viewAttached]) {
UITabBarController *tabController = [(TiUITabGroup *)[self view] tabController];
UIViewController *parentController = [self windowHoldingController];
[parentController addChildViewController:tabController];
[tabController didMoveToParentViewController:parentController];
[tabController viewWillAppear:animated];
}
[super viewWillAppear:animated];
Expand Down

0 comments on commit d334ac9

Please sign in to comment.