From 36ee6af62102c3b591b6c62b2747673426000f89 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 23 May 2018 08:48:51 -0400 Subject: [PATCH] respond to CR --- .../ViewControllers/OWSNavigationController.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SignalMessaging/ViewControllers/OWSNavigationController.m b/SignalMessaging/ViewControllers/OWSNavigationController.m index 23a2e1571..10cdf6e44 100644 --- a/SignalMessaging/ViewControllers/OWSNavigationController.m +++ b/SignalMessaging/ViewControllers/OWSNavigationController.m @@ -13,6 +13,9 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - +// Expose that UINavigationController already secretly implements UIGestureRecognizerDelegate +// so we can call [super navigationBar:shouldPopItem] in our own implementation to take advantage +// of the important side effects of that method. @interface OWSNavigationController () @end @@ -24,6 +27,10 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithRootViewController:(UIViewController *)rootViewController { self = [self initWithNavigationBarClass:[OWSNavigationBar class] toolbarClass:nil]; + if (!self) { + return self; + } + [self pushViewController:rootViewController animated:NO]; if (![self.navigationBar isKindOfClass:[OWSNavigationBar class]]) { @@ -125,8 +132,8 @@ NS_ASSUME_NONNULL_BEGIN if (OWSWindowManager.sharedManager.hasCall) { CGRect oldFrame = navbar.frame; - CGRect newFrame - = CGRectMake(oldFrame.origin.x, navbar.callBannerHeight, oldFrame.size.width, oldFrame.size.height); + CGRect newFrame = oldFrame; + newFrame.size.height = navbar.callBannerHeight; navbar.frame = newFrame; } else { CGRect oldFrame = navbar.frame;