Skip to content

Commit 62bf989

Browse files
committed
fix: UINavigationControllerDelegate behavior
1 parent 7140ad6 commit 62bf989

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
0.6.6
2+
3+
- fix `UINavigationControllerDelegate` behavior, always pass user **VC**
4+
5+
0.6.5
6+
7+
- use `navigationItem.title` first, then `title`
8+
19
0.6.4
210

311
- fix #147, `prefersHomeIndicatorAutoHidden` support

RTRootNavigationController.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'RTRootNavigationController'
11-
s.version = '0.6.5'
11+
s.version = '0.6.6'
1212
s.summary = 'Transparently make every view controller has its own navigation bar'
1313
s.description = <<-DESC
1414
More and more apps use custom navigation bar for each different view controller, instead of one common, gloabal navigation bar.

RTRootNavigationController/Classes/RTRootNavigationController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,8 @@ - (void)navigationController:(UINavigationController *)navigationController
887887
animated:(BOOL)animated
888888
{
889889
BOOL isRootVC = viewController == navigationController.viewControllers.firstObject;
890+
viewController = RTSafeUnwrapViewController(viewController);
890891
if (!isRootVC) {
891-
viewController = RTSafeUnwrapViewController(viewController);
892892

893893
BOOL hasSetLeftItem = viewController.navigationItem.leftBarButtonItem != nil;
894894
if (hasSetLeftItem && !viewController.rt_hasSetInteractivePop) {
@@ -990,8 +990,8 @@ - (UIInterfaceOrientation)navigationControllerPreferredInterfaceOrientationForPr
990990
if ([self.rt_delegate respondsToSelector:@selector(navigationController:animationControllerForOperation:fromViewController:toViewController:)]) {
991991
return [self.rt_delegate navigationController:navigationController
992992
animationControllerForOperation:operation
993-
fromViewController:fromVC
994-
toViewController:toVC];
993+
fromViewController:RTSafeUnwrapViewController(fromVC)
994+
toViewController:RTSafeUnwrapViewController(toVC)];
995995
}
996996
return nil;
997997
}

0 commit comments

Comments
 (0)