Skip to content

Commit

Permalink
QMUINavigationController 不要引用 QMUINavigationButton
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLice committed Apr 25, 2018
1 parent 802e37a commit e92f23d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
24 changes: 23 additions & 1 deletion QMUIKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,30 @@ Pod::Spec.new do |s|
end

ss.subspec 'QMUIButton' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIButton/*.{h,m}'
sss.source_files = 'QMUIKit/QMUIComponents/QMUIButton/QMUIButton.{h,m}'
sss.dependency 'QMUIKit/QMUIComponents/QMUILog'
end

ss.subspec 'QMUIFillButton' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIButton/QMUIFillButton.{h,m}'
end

ss.subspec 'QMUIGhostButton' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIButton/QMUIGhostButton.{h,m}'
end

ss.subspec 'QMUILinkButton' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIButton/QMUILinkButton.{h,m}'
end

ss.subspec 'QMUINavigationButton' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIButton/QMUINavigationButton.{h,m}'
sss.dependency 'QMUIKit/QMUIMainFrame'
sss.dependency 'QMUIKit/QMUIComponents/QMUILog'
end

ss.subspec 'QMUIToolbarButton' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIButton/QMUIToolbarButton.{h,m}'
end

ss.subspec 'QMUITableView' do |sss|
Expand Down Expand Up @@ -266,6 +287,7 @@ Pod::Spec.new do |s|
sss.dependency 'QMUIKit/QMUIComponents/QMUIImagePreviewViewController'
sss.dependency 'QMUIKit/QMUIComponents/QMUITableViewCell'
sss.dependency 'QMUIKit/QMUIComponents/QMUIButton'
sss.dependency 'QMUIKit/QMUIComponents/QMUINavigationButton'
sss.dependency 'QMUIKit/QMUIComponents/QMUIAssetLibrary'
sss.dependency 'QMUIKit/QMUIComponents/QMUIZoomImageView'
sss.dependency 'QMUIKit/QMUIComponents/QMUIAlertController'
Expand Down
5 changes: 2 additions & 3 deletions QMUIKit/QMUIMainFrame/QMUINavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#import "UINavigationController+QMUI.h"
#import "QMUILog.h"
#import "QMUIMultipleDelegates.h"
#import "QMUINavigationButton.h"

@implementation UIViewController (QMUINavigationController)

Expand Down Expand Up @@ -342,12 +341,12 @@ - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)ani
if (currentViewController) {
if (!NeedsBackBarButtonItemTitle) {
// 会自动从 UIBarButtonItem.title 取值作为下一个界面的返回按钮的文字
currentViewController.navigationItem.backBarButtonItem = [UIBarButtonItem qmui_itemWithTitle:@"" target:nil action:NULL];
currentViewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:NULL];
} else {
UIViewController<QMUINavigationControllerAppearanceDelegate> *vc = (UIViewController<QMUINavigationControllerAppearanceDelegate> *)viewController;
if ([vc respondsToSelector:@selector(backBarButtonItemTitleWithPreviousViewController:)]) {
NSString *title = [vc backBarButtonItemTitleWithPreviousViewController:currentViewController];
currentViewController.navigationItem.backBarButtonItem = [UIBarButtonItem qmui_itemWithTitle:title target:nil action:NULL];
currentViewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:nil action:NULL];
}
}
}
Expand Down

0 comments on commit e92f23d

Please sign in to comment.