Skip to content

Commit 7140ad6

Browse files
committed
fix rickytan#168 ,优先使用 navigationItem.title,与系统行为一致
VC 的默认行为:当在 viewDidLoad 中设置 self.title 时,同时会更新 self.navigationItem.title,但如果在 initWithCoder (xib)中设置 title,这里 navigationItem 还没有初始化,所以无效。这里保持兼容,取不到 navigationItem.title 时,取 title
1 parent 67ef813 commit 7140ad6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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.4'
11+
s.version = '0.6.5'
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ - (void)pushViewController:(UIViewController *)viewController
669669
viewController.rt_navigationBarClass,
670670
self.useSystemBackBarButtonItem,
671671
currentLast.navigationItem.backBarButtonItem,
672-
currentLast.title)
672+
currentLast.navigationItem.title ?: currentLast.title)
673673
animated:animated];
674674
}
675675
else {

0 commit comments

Comments
 (0)