├── .gitignore ├── .travis.yml ├── Example ├── Assets.xcassets │ ├── Contents.json │ ├── icon_back.imageset │ │ ├── Contents.json │ │ ├── icon_back@2x.png │ │ └── icon_back@3x.png │ └── icon_nav_back.imageset │ │ ├── Contents.json │ │ ├── icon_nav_back@2x.png │ │ └── icon_nav_back@3x.png ├── HBDNavigationBar.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── HBDNavigationBar-Example.xcscheme ├── HBDNavigationBar.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── HBDNavigationBar │ ├── AViewController.h │ ├── AViewController.m │ ├── BViewController.h │ ├── BViewController.m │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── CViewController.h │ ├── CViewController.m │ ├── CViewController.xib │ ├── DViewController.h │ ├── DViewController.m │ ├── DemoViewController.h │ ├── DemoViewController.m │ ├── EViewController.h │ ├── EViewController.m │ ├── FSPNavigationController.h │ ├── FSPNavigationController.m │ ├── FViewController.h │ ├── FViewController.m │ ├── HBDAppDelegate.h │ ├── HBDAppDelegate.m │ ├── HBDNavigationBar-Info.plist │ ├── HBDNavigationBar-Prefix.pch │ ├── HBDPopAnimation.h │ ├── HBDPopAnimation.m │ ├── HBDPushAnimation.h │ ├── HBDPushAnimation.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Main.storyboard │ ├── TableViewController.h │ ├── TableViewController.m │ ├── YPGradientDemoViewController.h │ ├── YPGradientDemoViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── lakeside_sunset.png │ └── main.m ├── Podfile ├── Podfile.lock ├── Pods │ ├── Headers │ │ ├── Private │ │ │ └── HBDNavigationBar │ │ │ │ ├── HBDNavigationBar.h │ │ │ │ ├── HBDNavigationController.h │ │ │ │ └── UIViewController+HBD.h │ │ └── Public │ │ │ └── HBDNavigationBar │ │ │ ├── HBDNavigationBar.h │ │ │ ├── HBDNavigationController.h │ │ │ └── UIViewController+HBD.h │ ├── Local Podspecs │ │ └── HBDNavigationBar.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── HBDNavigationBar │ │ ├── HBDNavigationBar-dummy.m │ │ ├── HBDNavigationBar-prefix.pch │ │ ├── HBDNavigationBar-umbrella.h │ │ ├── HBDNavigationBar.debug.xcconfig │ │ ├── HBDNavigationBar.modulemap │ │ ├── HBDNavigationBar.release.xcconfig │ │ ├── HBDNavigationBar.xcconfig │ │ └── Info.plist │ │ ├── Pods-HBDNavigationBar_Example │ │ ├── Info.plist │ │ ├── Pods-HBDNavigationBar_Example-acknowledgements.markdown │ │ ├── Pods-HBDNavigationBar_Example-acknowledgements.plist │ │ ├── Pods-HBDNavigationBar_Example-dummy.m │ │ ├── Pods-HBDNavigationBar_Example-frameworks.sh │ │ ├── Pods-HBDNavigationBar_Example-resources.sh │ │ ├── Pods-HBDNavigationBar_Example-umbrella.h │ │ ├── Pods-HBDNavigationBar_Example.debug.xcconfig │ │ ├── Pods-HBDNavigationBar_Example.modulemap │ │ └── Pods-HBDNavigationBar_Example.release.xcconfig │ │ └── Pods-HBDNavigationBar_Tests │ │ ├── Info.plist │ │ ├── Pods-HBDNavigationBar_Tests-acknowledgements.markdown │ │ ├── Pods-HBDNavigationBar_Tests-acknowledgements.plist │ │ ├── Pods-HBDNavigationBar_Tests-dummy.m │ │ ├── Pods-HBDNavigationBar_Tests-frameworks.sh │ │ ├── Pods-HBDNavigationBar_Tests-resources.sh │ │ ├── Pods-HBDNavigationBar_Tests-umbrella.h │ │ ├── Pods-HBDNavigationBar_Tests.debug.xcconfig │ │ ├── Pods-HBDNavigationBar_Tests.modulemap │ │ └── Pods-HBDNavigationBar_Tests.release.xcconfig └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── HBDNavigationBar.podspec ├── HBDNavigationBar ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── HBDNavigationBar.h │ ├── HBDNavigationBar.m │ ├── HBDNavigationController.h │ ├── HBDNavigationController.m │ ├── UIViewController+HBD.h │ └── UIViewController+HBD.m ├── LICENSE ├── README.md ├── README_EN.md ├── _Pods.xcodeproj └── screenshot ├── alpha.gif ├── background.gif ├── gradient.gif ├── hidden.gif ├── juejin.gif ├── shadow.gif ├── storyboard.jpg └── weixin.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # AppCode 23 | .idea 24 | 25 | # Bundler 26 | .bundle 27 | 28 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 29 | # Carthage/Checkouts 30 | 31 | Carthage/Build 32 | 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 36 | # 37 | # Note: if you ignore the Pods directory, make sure to uncomment 38 | # `pod install` in .travis.yml 39 | # 40 | # Pods/ 41 | IDEWorkspaceChecks.plist 42 | contents.xcworkspacedata 43 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/HBDNavigationBar.xcworkspace -scheme HBDNavigationBar-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Assets.xcassets/icon_back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "icon_back@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "icon_back@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Example/Assets.xcassets/icon_back.imageset/icon_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/Example/Assets.xcassets/icon_back.imageset/icon_back@2x.png -------------------------------------------------------------------------------- /Example/Assets.xcassets/icon_back.imageset/icon_back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/Example/Assets.xcassets/icon_back.imageset/icon_back@3x.png -------------------------------------------------------------------------------- /Example/Assets.xcassets/icon_nav_back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "icon_nav_back@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "icon_nav_back@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Example/Assets.xcassets/icon_nav_back.imageset/icon_nav_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/Example/Assets.xcassets/icon_nav_back.imageset/icon_nav_back@2x.png -------------------------------------------------------------------------------- /Example/Assets.xcassets/icon_nav_back.imageset/icon_nav_back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/Example/Assets.xcassets/icon_nav_back.imageset/icon_nav_back@3x.png -------------------------------------------------------------------------------- /Example/HBDNavigationBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar.xcodeproj/xcshareddata/xcschemes/HBDNavigationBar-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 51 | 52 | 62 | 64 | 70 | 71 | 72 | 73 | 79 | 81 | 87 | 88 | 89 | 90 | 92 | 93 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/AViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/10/24. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface AViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/AViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/10/24. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | #import 9 | #import 10 | #import "AViewController.h" 11 | #import "CViewController.h" 12 | 13 | @interface AViewController () 14 | 15 | @end 16 | 17 | @implementation AViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | //self.hbd_barHidden = YES; 22 | self.hbd_barAlpha = 0; 23 | self.view.backgroundColor = [UIColor colorWithRed:((float) arc4random_uniform(256) / 255.0) green:((float) arc4random_uniform(256) / 255.0) blue:((float) arc4random_uniform(256) / 255.0) alpha:1.0]; 24 | } 25 | 26 | - (void)pushToNext:(UIButton *)button { 27 | AViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"a"]; 28 | [self.navigationController pushViewController:vc animated:YES]; 29 | } 30 | 31 | - (IBAction)presentC:(UIButton *)sender { 32 | UIViewController *vc = [[CViewController alloc] init]; 33 | HBDNavigationController *nav = [[HBDNavigationController alloc] initWithRootViewController:vc]; 34 | nav.modalPresentationStyle = UIModalPresentationCurrentContext; 35 | self.navigationController.definesPresentationContext = NO; 36 | [self presentViewController:nav animated:YES completion:^{ 37 | 38 | }]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/BViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/10/24. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface BViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/BViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/10/24. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "BViewController.h" 10 | #import "CViewController.h" 11 | #import 12 | #import 13 | 14 | @interface BViewController () 15 | 16 | @end 17 | 18 | @implementation BViewController 19 | 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view. 24 | self.hbd_barTintColor = UIColor.redColor; 25 | self.hbd_barStyle = UIBarStyleBlack; 26 | self.hbd_tintColor = UIColor.whiteColor; 27 | 28 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(toRoot) name:@"pop-to-root" object:nil]; 29 | 30 | self.view.backgroundColor = [UIColor colorWithRed:((float) arc4random_uniform(256) / 255.0) green:((float) arc4random_uniform(256) / 255.0) blue:((float) arc4random_uniform(256) / 255.0) alpha:1.0]; 31 | } 32 | 33 | - (void)viewWillAppear:(BOOL)animated { 34 | NSLog(@"%s", __FUNCTION__); 35 | } 36 | 37 | - (void)viewDidAppear:(BOOL)animated { 38 | NSLog(@"%s", __FUNCTION__); 39 | } 40 | 41 | - (void)dealloc { 42 | [[NSNotificationCenter defaultCenter] removeObserver:self name:@"pop-to-root" object:nil]; 43 | } 44 | 45 | - (void)toRoot { 46 | [self.navigationController popViewControllerAnimated:NO]; 47 | } 48 | 49 | - (IBAction)present:(UIButton *)sender { 50 | UIViewController *vc = [[CViewController alloc] init]; 51 | HBDNavigationController *nav = [[HBDNavigationController alloc] initWithRootViewController:vc]; 52 | nav.modalPresentationStyle = UIModalPresentationCurrentContext; 53 | self.navigationController.definesPresentationContext = NO; 54 | [self presentViewController:nav animated:YES completion:^{ 55 | 56 | }]; 57 | 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/CViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/10/24. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/CViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/10/24. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "CViewController.h" 10 | 11 | @interface CViewController () 12 | 13 | @end 14 | 15 | @implementation CViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view from its nib. 20 | 21 | self.view.backgroundColor = [UIColor colorWithRed:((float) arc4random_uniform(256) / 255.0) green:((float) arc4random_uniform(256) / 255.0) blue:((float) arc4random_uniform(256) / 255.0) alpha:1.0]; 22 | } 23 | 24 | - (IBAction)dismiss:(UIButton *)sender { 25 | [[NSNotificationCenter defaultCenter] postNotificationName:@"pop-to-root" object:nil]; 26 | [self dismissViewControllerAnimated:YES completion:^{ 27 | 28 | }]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/CViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/DViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/11/6. 6 | // Copyright © 2018 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/DViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/11/6. 6 | // Copyright © 2018 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "DViewController.h" 10 | 11 | @interface DViewController () 12 | 13 | @end 14 | 15 | @implementation DViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.view.backgroundColor = [UIColor colorWithRed:((float) arc4random_uniform(256) / 255.0) green:((float) arc4random_uniform(256) / 255.0) blue:((float) arc4random_uniform(256) / 255.0) alpha:1.0]; 21 | } 22 | 23 | - (IBAction)popToRoot:(UIButton *)sender { 24 | [self.navigationController popToRootViewControllerAnimated:YES]; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/DemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/4/18. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/DemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by Listen on 2018/4/18. 6 | // Copyright © 2018年 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "DemoViewController.h" 10 | #import 11 | #import 12 | #import "YPGradientDemoViewController.h" 13 | 14 | @interface DemoViewController () 15 | 16 | @property(weak, nonatomic) IBOutlet UISwitch *shadowHiddenSwitch; 17 | @property(weak, nonatomic) IBOutlet UISwitch *barHiddenSwitch; 18 | @property(weak, nonatomic) IBOutlet UISwitch *blackStyleSwitch; 19 | @property(weak, nonatomic) IBOutlet UISegmentedControl *colorSegment; 20 | @property(weak, nonatomic) IBOutlet UISlider *alphaSlider; 21 | @property(weak, nonatomic) IBOutlet UILabel *alphaComponent; 22 | 23 | @end 24 | 25 | @implementation DemoViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view. 30 | 31 | self.title = [NSString stringWithFormat:@"%lu", self.navigationController.childViewControllers.count]; 32 | 33 | if (self.navigationController.childViewControllers.count == 3) { 34 | self.title = @"测试"; 35 | UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] init]; 36 | buttonItem.title = @"返回"; 37 | buttonItem.tintColor = UIColor.redColor; 38 | self.navigationItem.backBarButtonItem = buttonItem; 39 | } else if (self.navigationController.childViewControllers.count <= 2) { 40 | self.title = @"我"; 41 | // self.hbd_tintColor = UIColor.whiteColor; 42 | } else { 43 | self.title = @"收藏"; 44 | self.hbd_tintColor = UIColor.blueColor; 45 | // self.hbd_barTintColor = UIColor.redColor; 46 | // self.hbd_barStyle = UIBarStyleBlack; 47 | // self.hbd_titleTextAttributes = @{ NSForegroundColorAttributeName: UIColor.whiteColor }; 48 | } 49 | 50 | if (self.navigationController.childViewControllers.count == 1) { 51 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"test" style:(UIBarButtonItemStylePlain) target:self action:@selector(pushToNext:)]; 52 | } 53 | 54 | } 55 | 56 | - (void)viewWillAppear:(BOOL)animated { 57 | [super viewWillAppear:animated]; 58 | NSLog(@"viewWillAppear:%@", self); 59 | } 60 | 61 | - (void)viewWillDisappear:(BOOL)animated { 62 | [super viewWillDisappear:animated]; 63 | NSLog(@"viewWillDisappear:%@", self); 64 | } 65 | 66 | - (IBAction)sliderValueChanged:(UISlider *)sender { 67 | self.alphaComponent.text = [NSString stringWithFormat:@"%.2f", sender.value]; 68 | self.hbd_barAlpha = sender.value; 69 | [self hbd_setNeedsUpdateNavigationBar]; 70 | } 71 | 72 | - (IBAction)pushToNext:(UIButton *)sender { 73 | UIViewController *vc = [self createDemoViewController]; 74 | [self.navigationController pushViewController:vc animated:YES]; 75 | } 76 | 77 | - (IBAction)dynamicGradient:(UIButton *)sender { 78 | UIViewController *vc = [[YPGradientDemoViewController alloc] init]; 79 | [self.navigationController pushViewController:vc animated:YES]; 80 | } 81 | 82 | - (IBAction)present:(UIButton *)sender { 83 | UIViewController *vc = [[YPGradientDemoViewController alloc] init]; 84 | HBDNavigationController *nav = [[HBDNavigationController alloc] initWithRootViewController:vc]; 85 | nav.modalPresentationStyle = UIModalPresentationCurrentContext; 86 | [self presentViewController:nav animated:YES completion:^{ 87 | 88 | }]; 89 | } 90 | 91 | - (IBAction)dismiss:(UIButton *)sender { 92 | if (self.presentingViewController) { 93 | [self dismissViewControllerAnimated:YES completion:^{ 94 | 95 | }]; 96 | } 97 | } 98 | 99 | 100 | - (UIViewController *)createDemoViewController { 101 | DemoViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"demo"]; 102 | 103 | vc.hbd_barShadowHidden = self.shadowHiddenSwitch.isOn; 104 | vc.hbd_barHidden = self.barHiddenSwitch.isOn; 105 | vc.hbd_barStyle = self.blackStyleSwitch.isOn ? UIBarStyleBlack : UIBarStyleDefault; 106 | UIColor *color = @[ 107 | [UIColor colorWithRed:247 / 255.0 green:247 / 255.0 blue:247 / 255.0 alpha:0.8], 108 | [UIColor colorWithRed:28 / 255.0 green:28 / 255.0 blue:28 / 255.0 alpha:0.729], 109 | [UIColor.redColor colorWithAlphaComponent:0.7], 110 | [UIColor.greenColor colorWithAlphaComponent:0.7], 111 | [UIColor.blueColor colorWithAlphaComponent:0.8] 112 | ][self.colorSegment.selectedSegmentIndex]; 113 | 114 | vc.hbd_barTintColor = color; 115 | // vc.hbd_barImage = [DemoViewController imageWithColor:color]; 116 | return vc; 117 | } 118 | 119 | 120 | + (UIImage *)imageWithColor:(UIColor *)color { 121 | CGRect rect = CGRectMake(0.0f, 0.0f, 8.0f, 8.0f); 122 | UIGraphicsBeginImageContext(rect.size); 123 | CGContextRef context = UIGraphicsGetCurrentContext(); 124 | CGContextSetFillColorWithColor(context, [color CGColor]); 125 | CGContextFillRect(context, rect); 126 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); 127 | UIGraphicsEndImageContext(); 128 | return theImage; 129 | } 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/EViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // EViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/11/27. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface EViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/EViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // EViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/11/27. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "EViewController.h" 10 | #import 11 | 12 | @interface EViewController () 13 | 14 | @end 15 | 16 | @implementation EViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | 22 | self.hbd_barTintColor = UIColor.redColor; 23 | self.hbd_barStyle = UIBarStyleBlack; 24 | self.hbd_tintColor = UIColor.whiteColor; 25 | 26 | } 27 | 28 | /* 29 | #pragma mark - Navigation 30 | 31 | // In a storyboard-based application, you will often want to do a little preparation before navigation 32 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 33 | // Get the new view controller using [segue destinationViewController]. 34 | // Pass the selected object to the new view controller. 35 | } 36 | */ 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/FSPNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSPNavigationController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/9/27. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface FSPNavigationController : HBDNavigationController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/FSPNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FSPNavigationController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/9/27. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "FSPNavigationController.h" 10 | #import "HBDPushAnimation.h" 11 | #import "HBDPopAnimation.h" 12 | 13 | @interface FSPNavigationController () 14 | 15 | // 不能命名为 interactiveTransition,因为 UINavigationController 内部已经有一个名为 interactiveTransition 的属性 16 | @property(nonatomic, strong) UIPercentDrivenInteractiveTransition *hbd_interactiveTransition; 17 | 18 | @end 19 | 20 | @implementation FSPNavigationController 21 | 22 | 23 | // 默认转场动画,默认转场交互,自定义全屏返回 24 | //- (void)viewDidLoad { 25 | // [super viewDidLoad]; 26 | // // 获取系统自带滑动手势的target对象 27 | // id target = self.interactivePopGestureRecognizer.delegate; 28 | // // 创建全屏滑动手势,调用系统自带滑动手势的target的action方法 29 | // UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)]; 30 | // // 设置手势代理,拦截手势触发 31 | // pan.delegate = self.interactivePopGestureRecognizer.delegate; 32 | // // 给导航控制器的view添加全屏滑动手势 33 | // [self.view addGestureRecognizer:pan]; 34 | // // 禁止使用系统自带的滑动手势 35 | // self.interactivePopGestureRecognizer.enabled = NO; 36 | // } 37 | 38 | // 自定义转场动画,自定义转场交互,自定义全屏返回 39 | - (void)viewDidLoad { 40 | [super viewDidLoad]; 41 | // 自定义转场动画 42 | self.delegate = self; 43 | 44 | // 自定义转场交互,自定义全屏返回 45 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleFullScreenGesture:)]; 46 | // 获取系统自带滑动手势的 target 对象 47 | id target = self.interactivePopGestureRecognizer.delegate; 48 | // 给全屏手势添加默认的 action 49 | [pan addTarget:target action:@selector(handleNavigationTransition:)]; 50 | // 设置手势代理,拦截手势触发 51 | pan.delegate = self.interactivePopGestureRecognizer.delegate; 52 | // 给导航控制器的view添加全屏滑动手势 53 | [self.view addGestureRecognizer:pan]; 54 | // 禁止使用系统自带的滑动手势 55 | self.interactivePopGestureRecognizer.enabled = NO; 56 | } 57 | 58 | // 自定义转场动画,自定义转场交互,默认侧滑返回 59 | //- (void)viewDidLoad { 60 | // [super viewDidLoad]; 61 | // // 自定义转场动画 62 | // self.delegate = self; 63 | // 64 | // // 自定义转场交互 65 | // [self.interactivePopGestureRecognizer addTarget:self action:@selector(handleFullScreenGesture:)]; 66 | //} 67 | 68 | - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { 69 | NSLog(@"%s", __FUNCTION__); 70 | } 71 | 72 | - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated { 73 | NSLog(@"%s", __FUNCTION__); 74 | } 75 | 76 | - (nullable id )navigationController:(UINavigationController *)navigationController 77 | animationControllerForOperation:(UINavigationControllerOperation)operation 78 | fromViewController:(UIViewController *)fromVC 79 | toViewController:(UIViewController *)toVC { 80 | if (operation == UINavigationControllerOperationPush) { 81 | return [HBDPushAnimation new]; 82 | } else if (operation == UINavigationControllerOperationPop) { 83 | return [HBDPopAnimation new]; 84 | } 85 | return nil; 86 | } 87 | 88 | // 如果不重写这个方法,就采用默认的转场交互方式 89 | // 如果重写了这个方法,需要自己处理转场交互方式,参考下面的 `handleFullScreenGesture:` 方法 90 | - (nullable id )navigationController:(UINavigationController *)navigationController 91 | interactionControllerForAnimationController:(id )animationController { 92 | if ([animationController isKindOfClass:[HBDPopAnimation class]]) { 93 | return self.hbd_interactiveTransition; 94 | } 95 | return nil; 96 | } 97 | 98 | - (void)handleFullScreenGesture:(UIPanGestureRecognizer *)pan { 99 | CGFloat process = [pan translationInView:self.view].x / self.view.bounds.size.width; 100 | process = MIN(1.0, (MAX(0.0, process))); 101 | if (pan.state == UIGestureRecognizerStateBegan) { 102 | NSLog(@"%s UIGestureRecognizerStateBegan", __FUNCTION__); 103 | self.hbd_interactiveTransition = [[UIPercentDrivenInteractiveTransition alloc] init]; 104 | //触发pop转场动画 105 | [self popViewControllerAnimated:YES]; 106 | } else if (pan.state == UIGestureRecognizerStateChanged) { 107 | NSLog(@"%s UIGestureRecognizerStateChanged", __FUNCTION__); 108 | UIPercentDrivenInteractiveTransition *transition = self.hbd_interactiveTransition; 109 | [transition updateInteractiveTransition:process]; 110 | } else if (pan.state == UIGestureRecognizerStateEnded 111 | || pan.state == UIGestureRecognizerStateCancelled) { 112 | NSLog(@"%s UIGestureRecognizerStateEnded", __FUNCTION__); 113 | if (process > 0.33) { 114 | [self.hbd_interactiveTransition finishInteractiveTransition]; 115 | } else { 116 | [self.hbd_interactiveTransition cancelInteractiveTransition]; 117 | } 118 | self.hbd_interactiveTransition = nil; 119 | } 120 | } 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/FViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/11/27. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface FViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/FViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/11/27. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "FViewController.h" 10 | #import 11 | 12 | @interface FViewController () 13 | 14 | @end 15 | 16 | @implementation FViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | self.hbd_barHidden = YES; 22 | } 23 | 24 | /* 25 | #pragma mark - Navigation 26 | 27 | // In a storyboard-based application, you will often want to do a little preparation before navigation 28 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 29 | // Get the new view controller using [segue destinationViewController]. 30 | // Pass the selected object to the new view controller. 31 | } 32 | */ 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // HBDAppDelegate.h 3 | // HBDNavigationBar 4 | // 5 | // Created by listenzz@163.com on 03/23/2018. 6 | // Copyright (c) 2018 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface HBDAppDelegate : UIResponder 12 | 13 | @property(strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // HBDAppDelegate.m 3 | // HBDNavigationBar 4 | // 5 | // Created by listenzz@163.com on 03/23/2018. 6 | // Copyright (c) 2018 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "HBDAppDelegate.h" 10 | 11 | @implementation HBDAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | self.window.backgroundColor = UIColor.blackColor; 15 | [[UINavigationBar appearance] setBackIndicatorImage:[UIImage imageNamed:@"icon_back"]]; 16 | [[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"icon_back"]]; 17 | // [[UINavigationBar appearance] setBarTintColor: [UIColor colorWithRed:247/255.0 green:247/255.0 blue:247/255.0 alpha:0.8]]; 18 | 19 | // [[UINavigationBar appearance] setBackgroundImage:[HBDAppDelegate imageWithColor:[UIColor colorWithRed:247/255.0 green:247/255.0 blue:247/255.0 alpha:0.8]] forBarMetrics:UIBarMetricsDefault]; 20 | // [UIBarButtonItem appearance].tintColor = UIColor.redColor; 21 | // [[UINavigationBar appearance] setTintColor:UIColor.blackColor]; 22 | 23 | return YES; 24 | } 25 | 26 | + (UIImage *)imageWithColor:(UIColor *)color { 27 | CGRect rect = CGRectMake(0.0f, 0.0f, 8.0f, 8.0f); 28 | UIGraphicsBeginImageContext(rect.size); 29 | CGContextRef context = UIGraphicsGetCurrentContext(); 30 | CGContextSetFillColorWithColor(context, [color CGColor]); 31 | CGContextFillRect(context, rect); 32 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); 33 | UIGraphicsEndImageContext(); 34 | return theImage; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDNavigationBar-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDNavigationBar-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDPopAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // HBDPopAnimation.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/9/28. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HBDPopAnimation : NSObject 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDPopAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // HBDPopAnimation.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/9/28. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "HBDPopAnimation.h" 10 | 11 | @implementation HBDPopAnimation 12 | 13 | - (NSTimeInterval)transitionDuration:(id )transitionContext { 14 | return 0.25f; 15 | } 16 | 17 | - (void)animateTransition:(id )transitionContext { 18 | UIView *fromView = [transitionContext viewForKey:UITransitionContextFromViewKey]; 19 | UIView *toView = [transitionContext viewForKey:UITransitionContextToViewKey]; 20 | 21 | [[transitionContext containerView] insertSubview:toView belowSubview:fromView]; 22 | 23 | toView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.93, 0.93); 24 | 25 | [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{ 26 | toView.transform = CGAffineTransformIdentity; 27 | fromView.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, transitionContext.containerView.bounds.size.width, 0); 28 | } completion:^(BOOL finished) { 29 | toView.transform = CGAffineTransformIdentity; 30 | fromView.transform = CGAffineTransformIdentity; 31 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; 32 | }]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDPushAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // HBDPushAnimation.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/9/28. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HBDPushAnimation : NSObject 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/HBDPushAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // HBDPushAnimation.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/9/28. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "HBDPushAnimation.h" 10 | 11 | @implementation HBDPushAnimation 12 | 13 | - (NSTimeInterval)transitionDuration:(id )transitionContext { 14 | return 0.3f; 15 | } 16 | 17 | - (void)animateTransition:(id )transitionContext { 18 | UIView *toView = [transitionContext viewForKey:UITransitionContextToViewKey]; 19 | toView.frame = transitionContext.containerView.bounds; 20 | [transitionContext.containerView addSubview:toView]; 21 | UIView *fromView = [transitionContext viewForKey:UITransitionContextFromViewKey]; 22 | 23 | toView.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, transitionContext.containerView.bounds.size.width, 0); 24 | [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{ 25 | //fromView.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, -transitionContext.containerView.bounds.size.width, 0); 26 | fromView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.93, 0.93); 27 | toView.transform = CGAffineTransformIdentity; 28 | } completion:^(BOOL finished) { 29 | fromView.transform = CGAffineTransformIdentity; 30 | toView.transform = CGAffineTransformIdentity; 31 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; 32 | }]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/TableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.h 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/11/23. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TableViewController : UITableViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/TableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.m 3 | // HBDNavigationBar_Example 4 | // 5 | // Created by 李生 on 2019/11/23. 6 | // Copyright © 2019 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | #import "TableViewController.h" 10 | #import 11 | 12 | @interface TableViewController () 13 | 14 | @end 15 | 16 | @implementation TableViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.hbd_barStyle = UIBarStyleBlack; 21 | self.hbd_barTintColor = UIColor.redColor; 22 | 23 | // Uncomment the following line to preserve selection between presentations. 24 | // self.clearsSelectionOnViewWillAppear = NO; 25 | 26 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 27 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/YPGradientDemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // YPGradientDemoViewController.h 3 | // YPNavigationBarTransition-Example 4 | // 5 | // Created by Li Guoyin on 2017/12/30. 6 | // Copyright © 2017年 yiplee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YPGradientDemoViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/YPGradientDemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // YPGradientDemoViewController.m 3 | // YPNavigationBarTransition-Example 4 | // 5 | // Created by Li Guoyin on 2017/12/30. 6 | // Copyright © 2017年 yiplee. All rights reserved. 7 | // 8 | 9 | #import "YPGradientDemoViewController.h" 10 | #import 11 | 12 | @interface YPGradientDemoViewController () 13 | 14 | @property(nonatomic, strong) UIImageView *headerView; 15 | @property(nonatomic, strong) UITableView *tableView; 16 | 17 | @end 18 | 19 | @implementation YPGradientDemoViewController { 20 | CGFloat _gradientProgress; 21 | } 22 | 23 | - (void)loadView { 24 | UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; 25 | self.view = tableView; 26 | self.tableView = tableView; 27 | } 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | self.title = @"Dynamic Gradient Bar"; 32 | 33 | UITableView *tableView = self.tableView; 34 | [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; 35 | 36 | tableView.delegate = self; 37 | tableView.dataSource = self; 38 | if (@available(iOS 11, *)) { 39 | tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; 40 | } else { 41 | self.automaticallyAdjustsScrollViewInsets = NO; 42 | } 43 | 44 | NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"lakeside_sunset" ofType:@"png"]; 45 | UIImage *headerImage = [UIImage imageWithContentsOfFile:imagePath]; 46 | _headerView = [[UIImageView alloc] initWithImage:headerImage]; 47 | _headerView.clipsToBounds = YES; 48 | _headerView.contentMode = UIViewContentModeScaleAspectFill; 49 | [self.view insertSubview:_headerView aboveSubview:tableView]; 50 | 51 | self.hbd_barAlpha = 0.0; 52 | self.hbd_barStyle = UIBarStyleBlack; 53 | self.hbd_tintColor = UIColor.whiteColor; 54 | self.hbd_titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor.whiteColor colorWithAlphaComponent:0.0]}; 55 | } 56 | 57 | - (void)viewDidLayoutSubviews { 58 | [super viewDidLayoutSubviews]; 59 | 60 | UITableView *tableView = self.tableView; 61 | UIImageView *headerView = self.headerView; 62 | 63 | CGFloat width = CGRectGetWidth(self.view.bounds); 64 | UIImage *headerImage = headerView.image; 65 | CGFloat imageHeight = headerImage.size.height / headerImage.size.width * width; 66 | CGRect headerFrame = headerView.frame; 67 | 68 | if (tableView.contentInset.top == 0) { 69 | UIEdgeInsets inset = UIEdgeInsetsZero; 70 | if (@available(iOS 11, *)) { 71 | inset.bottom = self.view.safeAreaInsets.bottom; 72 | } 73 | tableView.scrollIndicatorInsets = inset; 74 | inset.top = imageHeight; 75 | tableView.contentInset = inset; 76 | tableView.contentOffset = CGPointMake(0, -inset.top); 77 | } 78 | 79 | if (CGRectGetHeight(headerFrame) != imageHeight) { 80 | headerView.frame = [self headerImageFrame]; 81 | } 82 | } 83 | 84 | - (CGRect)headerImageFrame { 85 | UITableView *tableView = self.tableView; 86 | UIImageView *headerView = self.headerView; 87 | 88 | CGFloat width = CGRectGetWidth(self.view.bounds); 89 | UIImage *headerImage = headerView.image; 90 | CGFloat imageHeight = headerImage.size.height / headerImage.size.width * width; 91 | 92 | CGFloat contentOffsetY = tableView.contentOffset.y + tableView.contentInset.top; 93 | if (contentOffsetY < 0) { 94 | imageHeight += -contentOffsetY; 95 | } 96 | 97 | CGRect headerFrame = self.view.bounds; 98 | if (contentOffsetY > 0) { 99 | headerFrame.origin.y -= contentOffsetY; 100 | } 101 | headerFrame.size.height = imageHeight; 102 | 103 | return headerFrame; 104 | } 105 | 106 | - (void)popToRoot:(id)sender { 107 | [self.navigationController popToRootViewControllerAnimated:YES]; 108 | } 109 | 110 | #pragma mark - UITableViewDelegate 111 | 112 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 113 | return 60; 114 | } 115 | 116 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 117 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 118 | UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 119 | UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"demo"]; 120 | [self.navigationController pushViewController:vc animated:YES]; 121 | } 122 | 123 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 124 | return 16; 125 | } 126 | 127 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 128 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 129 | cell.textLabel.text = @"click me"; 130 | return cell; 131 | } 132 | 133 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 134 | CGFloat headerHeight = CGRectGetHeight(self.headerView.frame); 135 | if (@available(iOS 11, *)) { 136 | headerHeight -= self.view.safeAreaInsets.top; 137 | } else { 138 | headerHeight -= [self.topLayoutGuide length]; 139 | } 140 | 141 | CGFloat progress = scrollView.contentOffset.y + scrollView.contentInset.top; 142 | CGFloat gradientProgress = MIN(1, MAX(0, progress / headerHeight)); 143 | gradientProgress = gradientProgress * gradientProgress * gradientProgress * gradientProgress; 144 | if (gradientProgress != _gradientProgress) { 145 | _gradientProgress = gradientProgress; 146 | if (_gradientProgress < 0.1) { 147 | self.hbd_barStyle = UIBarStyleBlack; 148 | self.hbd_tintColor = UIColor.whiteColor; 149 | self.hbd_titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor.blackColor colorWithAlphaComponent:0]}; 150 | } else { 151 | self.hbd_barStyle = UIBarStyleDefault; 152 | self.hbd_tintColor = UIColor.blackColor; 153 | self.hbd_titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor.blackColor colorWithAlphaComponent:_gradientProgress]}; 154 | } 155 | 156 | self.hbd_barAlpha = _gradientProgress; 157 | [self hbd_setNeedsUpdateNavigationBar]; 158 | } 159 | self.headerView.frame = [self headerImageFrame]; 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/HBDNavigationBar/lakeside_sunset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/Example/HBDNavigationBar/lakeside_sunset.png -------------------------------------------------------------------------------- /Example/HBDNavigationBar/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HBDNavigationBar 4 | // 5 | // Created by listenzz@163.com on 03/23/2018. 6 | // Copyright (c) 2018 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "HBDAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([HBDAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | 2 | target 'HBDNavigationBar_Example' do 3 | pod 'HBDNavigationBar', :path => '../' 4 | 5 | target 'HBDNavigationBar_Tests' do 6 | inherit! :search_paths 7 | 8 | 9 | end 10 | post_install do |installer| 11 | installer.pods_project.targets.each do |target| 12 | target.build_configurations.each do |config| 13 | config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "amd64" 14 | if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0 15 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' 16 | end 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - HBDNavigationBar (1.9.4) 3 | 4 | DEPENDENCIES: 5 | - HBDNavigationBar (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | HBDNavigationBar: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | HBDNavigationBar: 6f2f5699c0d9f3e6087466c037b361d6f337ea22 13 | 14 | PODFILE CHECKSUM: dde7e6b55a5f954d962af30e3bb1e9a1b911127f 15 | 16 | COCOAPODS: 1.11.2 17 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/HBDNavigationBar/HBDNavigationBar.h: -------------------------------------------------------------------------------- 1 | ../../../../../HBDNavigationBar/Classes/HBDNavigationBar.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/HBDNavigationBar/HBDNavigationController.h: -------------------------------------------------------------------------------- 1 | ../../../../../HBDNavigationBar/Classes/HBDNavigationController.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/HBDNavigationBar/UIViewController+HBD.h: -------------------------------------------------------------------------------- 1 | ../../../../../HBDNavigationBar/Classes/UIViewController+HBD.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/HBDNavigationBar/HBDNavigationBar.h: -------------------------------------------------------------------------------- 1 | ../../../../../HBDNavigationBar/Classes/HBDNavigationBar.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/HBDNavigationBar/HBDNavigationController.h: -------------------------------------------------------------------------------- 1 | ../../../../../HBDNavigationBar/Classes/HBDNavigationController.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/HBDNavigationBar/UIViewController+HBD.h: -------------------------------------------------------------------------------- 1 | ../../../../../HBDNavigationBar/Classes/UIViewController+HBD.h -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/HBDNavigationBar.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "HBDNavigationBar", 3 | "version": "1.9.4", 4 | "summary": "An aspiring UINavigationBar.", 5 | "description": "TODO: Add long description of the pod here.", 6 | "homepage": "https://github.com/listenzz/HBDNavigationBar", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "listen": "listenzz@163.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/listenzz/HBDNavigationBar.git", 16 | "tag": "1.9.4" 17 | }, 18 | "platforms": { 19 | "ios": "9.0" 20 | }, 21 | "source_files": "HBDNavigationBar/Classes/**/*", 22 | "public_header_files": "HBDNavigationBar/Classes/**/*.h", 23 | "frameworks": "UIKit" 24 | } 25 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - HBDNavigationBar (1.9.4) 3 | 4 | DEPENDENCIES: 5 | - HBDNavigationBar (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | HBDNavigationBar: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | HBDNavigationBar: 6f2f5699c0d9f3e6087466c037b361d6f337ea22 13 | 14 | PODFILE CHECKSUM: dde7e6b55a5f954d962af30e3bb1e9a1b911127f 15 | 16 | COCOAPODS: 1.11.2 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 27E27C4D87B64B2456CED128C362500A /* Pods-HBDNavigationBar_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E758FE7F2D9C936949B2FB79CD01A0A4 /* Pods-HBDNavigationBar_Tests-dummy.m */; }; 11 | 509DE96F967E7A47562933F4AF4BA053 /* HBDNavigationBar.h in Headers */ = {isa = PBXBuildFile; fileRef = A42E9E3E29487BCC73D9C41213B615C8 /* HBDNavigationBar.h */; settings = {ATTRIBUTES = (Project, ); }; }; 12 | 8BF942BB86156CEBC1C617587516E144 /* UIViewController+HBD.h in Headers */ = {isa = PBXBuildFile; fileRef = B3254C89F6F313BE40F6AB764E32C4BC /* UIViewController+HBD.h */; settings = {ATTRIBUTES = (Project, ); }; }; 13 | 9AD3C67631926420280362CA3BE4E7C8 /* Pods-HBDNavigationBar_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C9ECC296FA9F352E9A54B2B8B69670D9 /* Pods-HBDNavigationBar_Example-dummy.m */; }; 14 | AAB597E73DE4146E1484BDF1F9E4F430 /* UIViewController+HBD.m in Sources */ = {isa = PBXBuildFile; fileRef = BEE1668D8C9D86212F900075047AF3A5 /* UIViewController+HBD.m */; }; 15 | B57DA4687FC8D055F27792D7321DF3E7 /* HBDNavigationBar-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = CA972CA6509E0E61483B0FB043075B3F /* HBDNavigationBar-dummy.m */; }; 16 | BA06ED49CBBD8135BFC5B7D6D4851989 /* HBDNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 03E212C70A538A87D60644B78AC9150D /* HBDNavigationController.m */; }; 17 | C3FB88FF693D373F82D9CF8FD2DEEB3D /* HBDNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = B5ECADE9A8105980E0E435F1D921CD80 /* HBDNavigationController.h */; settings = {ATTRIBUTES = (Project, ); }; }; 18 | EAC75BA58D3D8BE434BD8FEAC50A6083 /* HBDNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 708D1369C509E7FAA6FCDF3EB42FFED2 /* HBDNavigationBar.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 1AA20A394A3B9311EACB502B2C7DB63A /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 1075D76821AB59C63D215759CC7CB0A7; 27 | remoteInfo = HBDNavigationBar; 28 | }; 29 | 415F2405496C33D9CF7506516AB1E968 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 448E44C176A30038DEF6293723E6FA0B; 34 | remoteInfo = "Pods-HBDNavigationBar_Example"; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 035DAF5E0261E1C66CB822D7EE45393E /* HBDNavigationBar.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = HBDNavigationBar.release.xcconfig; sourceTree = ""; }; 40 | 03E212C70A538A87D60644B78AC9150D /* HBDNavigationController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HBDNavigationController.m; path = HBDNavigationBar/Classes/HBDNavigationController.m; sourceTree = ""; }; 41 | 0FC3A1AF672B353EC6115D508F6E07D6 /* HBDNavigationBar.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = HBDNavigationBar.debug.xcconfig; sourceTree = ""; }; 42 | 1D3F83756BC2B0525BCBCBAF096CA50C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; 43 | 2506257DC3D09691DA6D8D05B9934853 /* HBDNavigationBar.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = HBDNavigationBar.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 44 | 4080912C7C19D96CD1861F5CCD1BD6D5 /* Pods-HBDNavigationBar_Example */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "Pods-HBDNavigationBar_Example"; path = "libPods-HBDNavigationBar_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 6E65573D28330C75E8A4E0EA37DC9492 /* Pods-HBDNavigationBar_Tests */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "Pods-HBDNavigationBar_Tests"; path = "libPods-HBDNavigationBar_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 708D1369C509E7FAA6FCDF3EB42FFED2 /* HBDNavigationBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HBDNavigationBar.m; path = HBDNavigationBar/Classes/HBDNavigationBar.m; sourceTree = ""; }; 47 | 7A0853D74F67F1BA8A7A8FAE2F001996 /* HBDNavigationBar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HBDNavigationBar-prefix.pch"; sourceTree = ""; }; 48 | 7E6BF2D5DDD8A899175FF3C7E0B6D52D /* Pods-HBDNavigationBar_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HBDNavigationBar_Tests.debug.xcconfig"; sourceTree = ""; }; 49 | 89C20BF3874C67245C6B5883CEB19B7B /* Pods-HBDNavigationBar_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HBDNavigationBar_Example-acknowledgements.plist"; sourceTree = ""; }; 50 | 93FAA0B6B2D5D97E58587CF13FB4674C /* Pods-HBDNavigationBar_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HBDNavigationBar_Tests-acknowledgements.plist"; sourceTree = ""; }; 51 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 52 | A42E9E3E29487BCC73D9C41213B615C8 /* HBDNavigationBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HBDNavigationBar.h; path = HBDNavigationBar/Classes/HBDNavigationBar.h; sourceTree = ""; }; 53 | A97F9FD05DF3A863A9521942ED3E8565 /* Pods-HBDNavigationBar_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HBDNavigationBar_Example.debug.xcconfig"; sourceTree = ""; }; 54 | B3254C89F6F313BE40F6AB764E32C4BC /* UIViewController+HBD.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+HBD.h"; path = "HBDNavigationBar/Classes/UIViewController+HBD.h"; sourceTree = ""; }; 55 | B5ECADE9A8105980E0E435F1D921CD80 /* HBDNavigationController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HBDNavigationController.h; path = HBDNavigationBar/Classes/HBDNavigationController.h; sourceTree = ""; }; 56 | B94EACAE8193E2637ED120D6EF997FA6 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; 57 | BEE1668D8C9D86212F900075047AF3A5 /* UIViewController+HBD.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+HBD.m"; path = "HBDNavigationBar/Classes/UIViewController+HBD.m"; sourceTree = ""; }; 58 | C9BB9A5F1CA87A2DCFF96128C61185FE /* Pods-HBDNavigationBar_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HBDNavigationBar_Example-acknowledgements.markdown"; sourceTree = ""; }; 59 | C9ECC296FA9F352E9A54B2B8B69670D9 /* Pods-HBDNavigationBar_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HBDNavigationBar_Example-dummy.m"; sourceTree = ""; }; 60 | CA972CA6509E0E61483B0FB043075B3F /* HBDNavigationBar-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HBDNavigationBar-dummy.m"; sourceTree = ""; }; 61 | D9D655DBA65BE9BCE7572FC7A768FFBF /* Pods-HBDNavigationBar_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HBDNavigationBar_Tests.release.xcconfig"; sourceTree = ""; }; 62 | E758FE7F2D9C936949B2FB79CD01A0A4 /* Pods-HBDNavigationBar_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HBDNavigationBar_Tests-dummy.m"; sourceTree = ""; }; 63 | E7D389133D21FC42E51FCCD15E37CA8C /* Pods-HBDNavigationBar_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HBDNavigationBar_Tests-acknowledgements.markdown"; sourceTree = ""; }; 64 | FC3F4781CB6E0F1003784ADF2A2ECA89 /* Pods-HBDNavigationBar_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HBDNavigationBar_Example.release.xcconfig"; sourceTree = ""; }; 65 | FC673151C5497BC8027FF15C04A83C54 /* HBDNavigationBar */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = HBDNavigationBar; path = libHBDNavigationBar.a; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | /* End PBXFileReference section */ 67 | 68 | /* Begin PBXFrameworksBuildPhase section */ 69 | 31783269E40ED285492C48BF3842C40C /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 56A71F38CCB163A2FCBB73E8F6B07247 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | 8D8D0D5768EB5795650E8A3A922A3C1F /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 3CD337360BB2C1678A8666E150988780 /* Pod */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 2506257DC3D09691DA6D8D05B9934853 /* HBDNavigationBar.podspec */, 97 | B94EACAE8193E2637ED120D6EF997FA6 /* LICENSE */, 98 | 1D3F83756BC2B0525BCBCBAF096CA50C /* README.md */, 99 | ); 100 | name = Pod; 101 | sourceTree = ""; 102 | }; 103 | 46CE9492E0D585CE1EC621B8A8036B2C /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | FC673151C5497BC8027FF15C04A83C54 /* HBDNavigationBar */, 107 | 4080912C7C19D96CD1861F5CCD1BD6D5 /* Pods-HBDNavigationBar_Example */, 108 | 6E65573D28330C75E8A4E0EA37DC9492 /* Pods-HBDNavigationBar_Tests */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 692C1ACDD3F25BD746C2B315014797B4 /* Support Files */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | CA972CA6509E0E61483B0FB043075B3F /* HBDNavigationBar-dummy.m */, 117 | 7A0853D74F67F1BA8A7A8FAE2F001996 /* HBDNavigationBar-prefix.pch */, 118 | 0FC3A1AF672B353EC6115D508F6E07D6 /* HBDNavigationBar.debug.xcconfig */, 119 | 035DAF5E0261E1C66CB822D7EE45393E /* HBDNavigationBar.release.xcconfig */, 120 | ); 121 | name = "Support Files"; 122 | path = "Example/Pods/Target Support Files/HBDNavigationBar"; 123 | sourceTree = ""; 124 | }; 125 | 74D7B1372AF4794933E4A4DBD861133D /* Targets Support Files */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | BD293C9F7D85BDFECE5A4220F8EEE00D /* Pods-HBDNavigationBar_Example */, 129 | C01EA84269F80BB3F2E8AD0B7494605F /* Pods-HBDNavigationBar_Tests */, 130 | ); 131 | name = "Targets Support Files"; 132 | sourceTree = ""; 133 | }; 134 | BD293C9F7D85BDFECE5A4220F8EEE00D /* Pods-HBDNavigationBar_Example */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | C9BB9A5F1CA87A2DCFF96128C61185FE /* Pods-HBDNavigationBar_Example-acknowledgements.markdown */, 138 | 89C20BF3874C67245C6B5883CEB19B7B /* Pods-HBDNavigationBar_Example-acknowledgements.plist */, 139 | C9ECC296FA9F352E9A54B2B8B69670D9 /* Pods-HBDNavigationBar_Example-dummy.m */, 140 | A97F9FD05DF3A863A9521942ED3E8565 /* Pods-HBDNavigationBar_Example.debug.xcconfig */, 141 | FC3F4781CB6E0F1003784ADF2A2ECA89 /* Pods-HBDNavigationBar_Example.release.xcconfig */, 142 | ); 143 | name = "Pods-HBDNavigationBar_Example"; 144 | path = "Target Support Files/Pods-HBDNavigationBar_Example"; 145 | sourceTree = ""; 146 | }; 147 | C01EA84269F80BB3F2E8AD0B7494605F /* Pods-HBDNavigationBar_Tests */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | E7D389133D21FC42E51FCCD15E37CA8C /* Pods-HBDNavigationBar_Tests-acknowledgements.markdown */, 151 | 93FAA0B6B2D5D97E58587CF13FB4674C /* Pods-HBDNavigationBar_Tests-acknowledgements.plist */, 152 | E758FE7F2D9C936949B2FB79CD01A0A4 /* Pods-HBDNavigationBar_Tests-dummy.m */, 153 | 7E6BF2D5DDD8A899175FF3C7E0B6D52D /* Pods-HBDNavigationBar_Tests.debug.xcconfig */, 154 | D9D655DBA65BE9BCE7572FC7A768FFBF /* Pods-HBDNavigationBar_Tests.release.xcconfig */, 155 | ); 156 | name = "Pods-HBDNavigationBar_Tests"; 157 | path = "Target Support Files/Pods-HBDNavigationBar_Tests"; 158 | sourceTree = ""; 159 | }; 160 | C447C44484BE9572EA9268C59025EEFC /* Development Pods */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | D33EE6721FC6B637906844F8E6EE9189 /* HBDNavigationBar */, 164 | ); 165 | name = "Development Pods"; 166 | sourceTree = ""; 167 | }; 168 | CF1408CF629C7361332E53B88F7BD30C = { 169 | isa = PBXGroup; 170 | children = ( 171 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, 172 | C447C44484BE9572EA9268C59025EEFC /* Development Pods */, 173 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */, 174 | 46CE9492E0D585CE1EC621B8A8036B2C /* Products */, 175 | 74D7B1372AF4794933E4A4DBD861133D /* Targets Support Files */, 176 | ); 177 | sourceTree = ""; 178 | }; 179 | D33EE6721FC6B637906844F8E6EE9189 /* HBDNavigationBar */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | A42E9E3E29487BCC73D9C41213B615C8 /* HBDNavigationBar.h */, 183 | 708D1369C509E7FAA6FCDF3EB42FFED2 /* HBDNavigationBar.m */, 184 | B5ECADE9A8105980E0E435F1D921CD80 /* HBDNavigationController.h */, 185 | 03E212C70A538A87D60644B78AC9150D /* HBDNavigationController.m */, 186 | B3254C89F6F313BE40F6AB764E32C4BC /* UIViewController+HBD.h */, 187 | BEE1668D8C9D86212F900075047AF3A5 /* UIViewController+HBD.m */, 188 | 3CD337360BB2C1678A8666E150988780 /* Pod */, 189 | 692C1ACDD3F25BD746C2B315014797B4 /* Support Files */, 190 | ); 191 | name = HBDNavigationBar; 192 | path = ../..; 193 | sourceTree = ""; 194 | }; 195 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | ); 199 | name = Frameworks; 200 | sourceTree = ""; 201 | }; 202 | /* End PBXGroup section */ 203 | 204 | /* Begin PBXHeadersBuildPhase section */ 205 | 27BDDD3219EEA74AD387711FE8917F7C /* Headers */ = { 206 | isa = PBXHeadersBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 509DE96F967E7A47562933F4AF4BA053 /* HBDNavigationBar.h in Headers */, 210 | C3FB88FF693D373F82D9CF8FD2DEEB3D /* HBDNavigationController.h in Headers */, 211 | 8BF942BB86156CEBC1C617587516E144 /* UIViewController+HBD.h in Headers */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | 5FDB5855838FAE8A2ABD3017DEC8221D /* Headers */ = { 216 | isa = PBXHeadersBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | D73B2B10E8DE1580524A196D92BB0E3D /* Headers */ = { 223 | isa = PBXHeadersBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | /* End PBXHeadersBuildPhase section */ 230 | 231 | /* Begin PBXNativeTarget section */ 232 | 1075D76821AB59C63D215759CC7CB0A7 /* HBDNavigationBar */ = { 233 | isa = PBXNativeTarget; 234 | buildConfigurationList = A7DA7BCD0D506F0AA67D3B082DFE61BF /* Build configuration list for PBXNativeTarget "HBDNavigationBar" */; 235 | buildPhases = ( 236 | 27BDDD3219EEA74AD387711FE8917F7C /* Headers */, 237 | 8454588A9BF9864C501156C7246A4BB8 /* Sources */, 238 | 31783269E40ED285492C48BF3842C40C /* Frameworks */, 239 | ); 240 | buildRules = ( 241 | ); 242 | dependencies = ( 243 | ); 244 | name = HBDNavigationBar; 245 | productName = HBDNavigationBar; 246 | productReference = FC673151C5497BC8027FF15C04A83C54 /* HBDNavigationBar */; 247 | productType = "com.apple.product-type.library.static"; 248 | }; 249 | 448E44C176A30038DEF6293723E6FA0B /* Pods-HBDNavigationBar_Example */ = { 250 | isa = PBXNativeTarget; 251 | buildConfigurationList = 397B33D9C4017497B8D21B0EB2BD7B82 /* Build configuration list for PBXNativeTarget "Pods-HBDNavigationBar_Example" */; 252 | buildPhases = ( 253 | 5FDB5855838FAE8A2ABD3017DEC8221D /* Headers */, 254 | F99CE60FF04452DF9F067D096B787800 /* Sources */, 255 | 8D8D0D5768EB5795650E8A3A922A3C1F /* Frameworks */, 256 | ); 257 | buildRules = ( 258 | ); 259 | dependencies = ( 260 | 4A58ADA323370EBF3B94304811474CB1 /* PBXTargetDependency */, 261 | ); 262 | name = "Pods-HBDNavigationBar_Example"; 263 | productName = "Pods-HBDNavigationBar_Example"; 264 | productReference = 4080912C7C19D96CD1861F5CCD1BD6D5 /* Pods-HBDNavigationBar_Example */; 265 | productType = "com.apple.product-type.library.static"; 266 | }; 267 | DEE56EE42793FEE13226E6C678A975F8 /* Pods-HBDNavigationBar_Tests */ = { 268 | isa = PBXNativeTarget; 269 | buildConfigurationList = 08B9BD21F583A544F6D8C4A078BED712 /* Build configuration list for PBXNativeTarget "Pods-HBDNavigationBar_Tests" */; 270 | buildPhases = ( 271 | D73B2B10E8DE1580524A196D92BB0E3D /* Headers */, 272 | E61C3E7C88752374D4A792CFF7241283 /* Sources */, 273 | 56A71F38CCB163A2FCBB73E8F6B07247 /* Frameworks */, 274 | ); 275 | buildRules = ( 276 | ); 277 | dependencies = ( 278 | 59EF79EF3245C654BAD408C023CF735D /* PBXTargetDependency */, 279 | ); 280 | name = "Pods-HBDNavigationBar_Tests"; 281 | productName = "Pods-HBDNavigationBar_Tests"; 282 | productReference = 6E65573D28330C75E8A4E0EA37DC9492 /* Pods-HBDNavigationBar_Tests */; 283 | productType = "com.apple.product-type.library.static"; 284 | }; 285 | /* End PBXNativeTarget section */ 286 | 287 | /* Begin PBXProject section */ 288 | BFDFE7DC352907FC980B868725387E98 /* Project object */ = { 289 | isa = PBXProject; 290 | attributes = { 291 | LastSwiftUpdateCheck = 1240; 292 | LastUpgradeCheck = 1240; 293 | }; 294 | buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; 295 | compatibilityVersion = "Xcode 3.2"; 296 | developmentRegion = en; 297 | hasScannedForEncodings = 0; 298 | knownRegions = ( 299 | Base, 300 | en, 301 | ); 302 | mainGroup = CF1408CF629C7361332E53B88F7BD30C; 303 | productRefGroup = 46CE9492E0D585CE1EC621B8A8036B2C /* Products */; 304 | projectDirPath = ""; 305 | projectRoot = ""; 306 | targets = ( 307 | 1075D76821AB59C63D215759CC7CB0A7 /* HBDNavigationBar */, 308 | 448E44C176A30038DEF6293723E6FA0B /* Pods-HBDNavigationBar_Example */, 309 | DEE56EE42793FEE13226E6C678A975F8 /* Pods-HBDNavigationBar_Tests */, 310 | ); 311 | }; 312 | /* End PBXProject section */ 313 | 314 | /* Begin PBXSourcesBuildPhase section */ 315 | 8454588A9BF9864C501156C7246A4BB8 /* Sources */ = { 316 | isa = PBXSourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | EAC75BA58D3D8BE434BD8FEAC50A6083 /* HBDNavigationBar.m in Sources */, 320 | B57DA4687FC8D055F27792D7321DF3E7 /* HBDNavigationBar-dummy.m in Sources */, 321 | BA06ED49CBBD8135BFC5B7D6D4851989 /* HBDNavigationController.m in Sources */, 322 | AAB597E73DE4146E1484BDF1F9E4F430 /* UIViewController+HBD.m in Sources */, 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | E61C3E7C88752374D4A792CFF7241283 /* Sources */ = { 327 | isa = PBXSourcesBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | 27E27C4D87B64B2456CED128C362500A /* Pods-HBDNavigationBar_Tests-dummy.m in Sources */, 331 | ); 332 | runOnlyForDeploymentPostprocessing = 0; 333 | }; 334 | F99CE60FF04452DF9F067D096B787800 /* Sources */ = { 335 | isa = PBXSourcesBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | 9AD3C67631926420280362CA3BE4E7C8 /* Pods-HBDNavigationBar_Example-dummy.m in Sources */, 339 | ); 340 | runOnlyForDeploymentPostprocessing = 0; 341 | }; 342 | /* End PBXSourcesBuildPhase section */ 343 | 344 | /* Begin PBXTargetDependency section */ 345 | 4A58ADA323370EBF3B94304811474CB1 /* PBXTargetDependency */ = { 346 | isa = PBXTargetDependency; 347 | name = HBDNavigationBar; 348 | target = 1075D76821AB59C63D215759CC7CB0A7 /* HBDNavigationBar */; 349 | targetProxy = 1AA20A394A3B9311EACB502B2C7DB63A /* PBXContainerItemProxy */; 350 | }; 351 | 59EF79EF3245C654BAD408C023CF735D /* PBXTargetDependency */ = { 352 | isa = PBXTargetDependency; 353 | name = "Pods-HBDNavigationBar_Example"; 354 | target = 448E44C176A30038DEF6293723E6FA0B /* Pods-HBDNavigationBar_Example */; 355 | targetProxy = 415F2405496C33D9CF7506516AB1E968 /* PBXContainerItemProxy */; 356 | }; 357 | /* End PBXTargetDependency section */ 358 | 359 | /* Begin XCBuildConfiguration section */ 360 | 2D5AFEFF7AADCC8828EDED1F883E1836 /* Debug */ = { 361 | isa = XCBuildConfiguration; 362 | baseConfigurationReference = 7E6BF2D5DDD8A899175FF3C7E0B6D52D /* Pods-HBDNavigationBar_Tests.debug.xcconfig */; 363 | buildSettings = { 364 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 365 | CLANG_ENABLE_OBJC_WEAK = NO; 366 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 368 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 369 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = amd64; 370 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 371 | MACH_O_TYPE = staticlib; 372 | OTHER_LDFLAGS = ""; 373 | OTHER_LIBTOOLFLAGS = ""; 374 | PODS_ROOT = "$(SRCROOT)"; 375 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 376 | SDKROOT = iphoneos; 377 | SKIP_INSTALL = YES; 378 | TARGETED_DEVICE_FAMILY = "1,2"; 379 | }; 380 | name = Debug; 381 | }; 382 | 2FB6E04B5930F4077F6546B9C78B6E6B /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | baseConfigurationReference = 035DAF5E0261E1C66CB822D7EE45393E /* HBDNavigationBar.release.xcconfig */; 385 | buildSettings = { 386 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 387 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 388 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 389 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = amd64; 390 | GCC_PREFIX_HEADER = "Target Support Files/HBDNavigationBar/HBDNavigationBar-prefix.pch"; 391 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 392 | OTHER_LDFLAGS = ""; 393 | OTHER_LIBTOOLFLAGS = ""; 394 | PRIVATE_HEADERS_FOLDER_PATH = ""; 395 | PRODUCT_MODULE_NAME = HBDNavigationBar; 396 | PRODUCT_NAME = HBDNavigationBar; 397 | PUBLIC_HEADERS_FOLDER_PATH = ""; 398 | SDKROOT = iphoneos; 399 | SKIP_INSTALL = YES; 400 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 401 | TARGETED_DEVICE_FAMILY = "1,2"; 402 | VALIDATE_PRODUCT = YES; 403 | }; 404 | name = Release; 405 | }; 406 | 7EE7A78859F657F6BEFC651185B43192 /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ALWAYS_SEARCH_USER_PATHS = NO; 410 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 411 | CLANG_ANALYZER_NONNULL = YES; 412 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 413 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 414 | CLANG_CXX_LIBRARY = "libc++"; 415 | CLANG_ENABLE_MODULES = YES; 416 | CLANG_ENABLE_OBJC_ARC = YES; 417 | CLANG_ENABLE_OBJC_WEAK = YES; 418 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 419 | CLANG_WARN_BOOL_CONVERSION = YES; 420 | CLANG_WARN_COMMA = YES; 421 | CLANG_WARN_CONSTANT_CONVERSION = YES; 422 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 423 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 424 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 425 | CLANG_WARN_EMPTY_BODY = YES; 426 | CLANG_WARN_ENUM_CONVERSION = YES; 427 | CLANG_WARN_INFINITE_RECURSION = YES; 428 | CLANG_WARN_INT_CONVERSION = YES; 429 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 430 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 431 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 432 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 433 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 434 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 435 | CLANG_WARN_STRICT_PROTOTYPES = YES; 436 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 437 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 438 | CLANG_WARN_UNREACHABLE_CODE = YES; 439 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 440 | COPY_PHASE_STRIP = NO; 441 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 442 | ENABLE_NS_ASSERTIONS = NO; 443 | ENABLE_STRICT_OBJC_MSGSEND = YES; 444 | GCC_C_LANGUAGE_STANDARD = gnu11; 445 | GCC_NO_COMMON_BLOCKS = YES; 446 | GCC_PREPROCESSOR_DEFINITIONS = ( 447 | "POD_CONFIGURATION_RELEASE=1", 448 | "$(inherited)", 449 | ); 450 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 451 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 452 | GCC_WARN_UNDECLARED_SELECTOR = YES; 453 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 454 | GCC_WARN_UNUSED_FUNCTION = YES; 455 | GCC_WARN_UNUSED_VARIABLE = YES; 456 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 457 | MTL_ENABLE_DEBUG_INFO = NO; 458 | MTL_FAST_MATH = YES; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | STRIP_INSTALLED_PRODUCT = NO; 461 | SWIFT_COMPILATION_MODE = wholemodule; 462 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 463 | SWIFT_VERSION = 5.0; 464 | SYMROOT = "${SRCROOT}/../build"; 465 | }; 466 | name = Release; 467 | }; 468 | 8EDA6E715BB379708412AC8DC0D4F51E /* Debug */ = { 469 | isa = XCBuildConfiguration; 470 | baseConfigurationReference = 0FC3A1AF672B353EC6115D508F6E07D6 /* HBDNavigationBar.debug.xcconfig */; 471 | buildSettings = { 472 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 473 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 474 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 475 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = amd64; 476 | GCC_PREFIX_HEADER = "Target Support Files/HBDNavigationBar/HBDNavigationBar-prefix.pch"; 477 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 478 | OTHER_LDFLAGS = ""; 479 | OTHER_LIBTOOLFLAGS = ""; 480 | PRIVATE_HEADERS_FOLDER_PATH = ""; 481 | PRODUCT_MODULE_NAME = HBDNavigationBar; 482 | PRODUCT_NAME = HBDNavigationBar; 483 | PUBLIC_HEADERS_FOLDER_PATH = ""; 484 | SDKROOT = iphoneos; 485 | SKIP_INSTALL = YES; 486 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 487 | TARGETED_DEVICE_FAMILY = "1,2"; 488 | }; 489 | name = Debug; 490 | }; 491 | 99183F12511CF0BAE50933F0BF915775 /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | baseConfigurationReference = D9D655DBA65BE9BCE7572FC7A768FFBF /* Pods-HBDNavigationBar_Tests.release.xcconfig */; 494 | buildSettings = { 495 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 496 | CLANG_ENABLE_OBJC_WEAK = NO; 497 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 498 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 499 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 500 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = amd64; 501 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 502 | MACH_O_TYPE = staticlib; 503 | OTHER_LDFLAGS = ""; 504 | OTHER_LIBTOOLFLAGS = ""; 505 | PODS_ROOT = "$(SRCROOT)"; 506 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 507 | SDKROOT = iphoneos; 508 | SKIP_INSTALL = YES; 509 | TARGETED_DEVICE_FAMILY = "1,2"; 510 | VALIDATE_PRODUCT = YES; 511 | }; 512 | name = Release; 513 | }; 514 | C88D27E783EEF547833B6F914D9CAFF5 /* Release */ = { 515 | isa = XCBuildConfiguration; 516 | baseConfigurationReference = FC3F4781CB6E0F1003784ADF2A2ECA89 /* Pods-HBDNavigationBar_Example.release.xcconfig */; 517 | buildSettings = { 518 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 519 | CLANG_ENABLE_OBJC_WEAK = NO; 520 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 521 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 522 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 523 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = amd64; 524 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 525 | MACH_O_TYPE = staticlib; 526 | OTHER_LDFLAGS = ""; 527 | OTHER_LIBTOOLFLAGS = ""; 528 | PODS_ROOT = "$(SRCROOT)"; 529 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 530 | SDKROOT = iphoneos; 531 | SKIP_INSTALL = YES; 532 | TARGETED_DEVICE_FAMILY = "1,2"; 533 | VALIDATE_PRODUCT = YES; 534 | }; 535 | name = Release; 536 | }; 537 | D299434AB35E7FD6F7921C8EF24742FF /* Debug */ = { 538 | isa = XCBuildConfiguration; 539 | buildSettings = { 540 | ALWAYS_SEARCH_USER_PATHS = NO; 541 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 542 | CLANG_ANALYZER_NONNULL = YES; 543 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 544 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 545 | CLANG_CXX_LIBRARY = "libc++"; 546 | CLANG_ENABLE_MODULES = YES; 547 | CLANG_ENABLE_OBJC_ARC = YES; 548 | CLANG_ENABLE_OBJC_WEAK = YES; 549 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 550 | CLANG_WARN_BOOL_CONVERSION = YES; 551 | CLANG_WARN_COMMA = YES; 552 | CLANG_WARN_CONSTANT_CONVERSION = YES; 553 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 554 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 555 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 556 | CLANG_WARN_EMPTY_BODY = YES; 557 | CLANG_WARN_ENUM_CONVERSION = YES; 558 | CLANG_WARN_INFINITE_RECURSION = YES; 559 | CLANG_WARN_INT_CONVERSION = YES; 560 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 561 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 562 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 563 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 564 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 565 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 566 | CLANG_WARN_STRICT_PROTOTYPES = YES; 567 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 568 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 569 | CLANG_WARN_UNREACHABLE_CODE = YES; 570 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 571 | COPY_PHASE_STRIP = NO; 572 | DEBUG_INFORMATION_FORMAT = dwarf; 573 | ENABLE_STRICT_OBJC_MSGSEND = YES; 574 | ENABLE_TESTABILITY = YES; 575 | GCC_C_LANGUAGE_STANDARD = gnu11; 576 | GCC_DYNAMIC_NO_PIC = NO; 577 | GCC_NO_COMMON_BLOCKS = YES; 578 | GCC_OPTIMIZATION_LEVEL = 0; 579 | GCC_PREPROCESSOR_DEFINITIONS = ( 580 | "POD_CONFIGURATION_DEBUG=1", 581 | "DEBUG=1", 582 | "$(inherited)", 583 | ); 584 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 585 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 586 | GCC_WARN_UNDECLARED_SELECTOR = YES; 587 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 588 | GCC_WARN_UNUSED_FUNCTION = YES; 589 | GCC_WARN_UNUSED_VARIABLE = YES; 590 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 591 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 592 | MTL_FAST_MATH = YES; 593 | ONLY_ACTIVE_ARCH = YES; 594 | PRODUCT_NAME = "$(TARGET_NAME)"; 595 | STRIP_INSTALLED_PRODUCT = NO; 596 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 597 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 598 | SWIFT_VERSION = 5.0; 599 | SYMROOT = "${SRCROOT}/../build"; 600 | }; 601 | name = Debug; 602 | }; 603 | EFB4947E576F46AA1F161D5BAEC5D0B3 /* Debug */ = { 604 | isa = XCBuildConfiguration; 605 | baseConfigurationReference = A97F9FD05DF3A863A9521942ED3E8565 /* Pods-HBDNavigationBar_Example.debug.xcconfig */; 606 | buildSettings = { 607 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 608 | CLANG_ENABLE_OBJC_WEAK = NO; 609 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 610 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 611 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 612 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = amd64; 613 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 614 | MACH_O_TYPE = staticlib; 615 | OTHER_LDFLAGS = ""; 616 | OTHER_LIBTOOLFLAGS = ""; 617 | PODS_ROOT = "$(SRCROOT)"; 618 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 619 | SDKROOT = iphoneos; 620 | SKIP_INSTALL = YES; 621 | TARGETED_DEVICE_FAMILY = "1,2"; 622 | }; 623 | name = Debug; 624 | }; 625 | /* End XCBuildConfiguration section */ 626 | 627 | /* Begin XCConfigurationList section */ 628 | 08B9BD21F583A544F6D8C4A078BED712 /* Build configuration list for PBXNativeTarget "Pods-HBDNavigationBar_Tests" */ = { 629 | isa = XCConfigurationList; 630 | buildConfigurations = ( 631 | 2D5AFEFF7AADCC8828EDED1F883E1836 /* Debug */, 632 | 99183F12511CF0BAE50933F0BF915775 /* Release */, 633 | ); 634 | defaultConfigurationIsVisible = 0; 635 | defaultConfigurationName = Release; 636 | }; 637 | 397B33D9C4017497B8D21B0EB2BD7B82 /* Build configuration list for PBXNativeTarget "Pods-HBDNavigationBar_Example" */ = { 638 | isa = XCConfigurationList; 639 | buildConfigurations = ( 640 | EFB4947E576F46AA1F161D5BAEC5D0B3 /* Debug */, 641 | C88D27E783EEF547833B6F914D9CAFF5 /* Release */, 642 | ); 643 | defaultConfigurationIsVisible = 0; 644 | defaultConfigurationName = Release; 645 | }; 646 | 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { 647 | isa = XCConfigurationList; 648 | buildConfigurations = ( 649 | D299434AB35E7FD6F7921C8EF24742FF /* Debug */, 650 | 7EE7A78859F657F6BEFC651185B43192 /* Release */, 651 | ); 652 | defaultConfigurationIsVisible = 0; 653 | defaultConfigurationName = Release; 654 | }; 655 | A7DA7BCD0D506F0AA67D3B082DFE61BF /* Build configuration list for PBXNativeTarget "HBDNavigationBar" */ = { 656 | isa = XCConfigurationList; 657 | buildConfigurations = ( 658 | 8EDA6E715BB379708412AC8DC0D4F51E /* Debug */, 659 | 2FB6E04B5930F4077F6546B9C78B6E6B /* Release */, 660 | ); 661 | defaultConfigurationIsVisible = 0; 662 | defaultConfigurationName = Release; 663 | }; 664 | /* End XCConfigurationList section */ 665 | }; 666 | rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; 667 | } 668 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/HBDNavigationBar-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_HBDNavigationBar : NSObject 3 | @end 4 | @implementation PodsDummy_HBDNavigationBar 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/HBDNavigationBar-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/HBDNavigationBar-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "HBDNavigationBar.h" 14 | #import "HBDNavigationController.h" 15 | #import "UIViewController+HBD.h" 16 | 17 | FOUNDATION_EXPORT double HBDNavigationBarVersionNumber; 18 | FOUNDATION_EXPORT const unsigned char HBDNavigationBarVersionString[]; 19 | 20 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/HBDNavigationBar.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/HBDNavigationBar 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/HBDNavigationBar" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/HBDNavigationBar" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/HBDNavigationBar.modulemap: -------------------------------------------------------------------------------- 1 | framework module HBDNavigationBar { 2 | umbrella header "HBDNavigationBar-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/HBDNavigationBar.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/HBDNavigationBar 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/HBDNavigationBar" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/HBDNavigationBar" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/HBDNavigationBar.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/HBDNavigationBar 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/HBDNavigationBar" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/HBDNavigationBar" 4 | OTHER_LDFLAGS = -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/HBDNavigationBar/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## HBDNavigationBar 5 | 6 | Copyright (c) 2021 listen 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2021 listen <listenzz@163.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | HBDNavigationBar 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_HBDNavigationBar_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_HBDNavigationBar_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 104 | wait 105 | fi 106 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_HBDNavigationBar_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_HBDNavigationBar_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/HBDNavigationBar" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/HBDNavigationBar" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"HBDNavigationBar" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_HBDNavigationBar_Example { 2 | umbrella header "Pods-HBDNavigationBar_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Example/Pods-HBDNavigationBar_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/HBDNavigationBar" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/HBDNavigationBar" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"HBDNavigationBar" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_HBDNavigationBar_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_HBDNavigationBar_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 104 | wait 105 | fi 106 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_HBDNavigationBar_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_HBDNavigationBar_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/HBDNavigationBar" 4 | OTHER_LDFLAGS = $(inherited) -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_HBDNavigationBar_Tests { 2 | umbrella header "Pods-HBDNavigationBar_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-HBDNavigationBar_Tests/Pods-HBDNavigationBar_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/HBDNavigationBar" 4 | OTHER_LDFLAGS = $(inherited) -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HBDNavigationBarTests.m 3 | // HBDNavigationBarTests 4 | // 5 | // Created by listenzz@163.com on 03/23/2018. 6 | // Copyright (c) 2018 listenzz@163.com. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /HBDNavigationBar.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint HBDNavigationBar.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'HBDNavigationBar' 11 | s.version = '1.9.8' 12 | s.summary = 'An aspiring UINavigationBar.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | TODO: Add long description of the pod here. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/listenzz/HBDNavigationBar' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'listen' => 'listenzz@163.com' } 28 | s.source = { :git => 'https://github.com/listenzz/HBDNavigationBar.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '9.0' 32 | 33 | s.source_files = 'HBDNavigationBar/Classes/**/*' 34 | 35 | # s.resource_bundles = { 36 | # 'HBDNavigationBar' => ['HBDNavigationBar/Assets/*.png'] 37 | # } 38 | 39 | s.public_header_files = 'HBDNavigationBar/Classes/**/*.h' 40 | s.frameworks = 'UIKit' 41 | end 42 | -------------------------------------------------------------------------------- /HBDNavigationBar/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/HBDNavigationBar/Assets/.gitkeep -------------------------------------------------------------------------------- /HBDNavigationBar/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/HBDNavigationBar/Classes/.gitkeep -------------------------------------------------------------------------------- /HBDNavigationBar/Classes/HBDNavigationBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // HBDNavigationBar.h 3 | // HBDNavigationBar 4 | // 5 | // Created by Listen on 2018/3/23. 6 | // 7 | 8 | #import 9 | 10 | @interface HBDNavigationBar : UINavigationBar 11 | 12 | @property(nonatomic, strong, readonly) UIImageView *shadowImageView; 13 | @property(nonatomic, strong, readonly) UIVisualEffectView *fakeView; 14 | @property(nonatomic, strong, readonly) UIImageView *backgroundImageView; 15 | @property(nonatomic, strong, readonly) UILabel *backButtonLabel; 16 | @property(nonatomic, strong, readonly) UIView *hbd_backgroundView; 17 | 18 | @end 19 | 20 | 21 | @interface UILabel (NavigationBarTransition) 22 | 23 | @property(nonatomic, strong) UIColor *hbd_specifiedTextColor; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /HBDNavigationBar/Classes/HBDNavigationBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // HBDNavigationBar.m 3 | // HBDNavigationBar 4 | // 5 | // Created by Listen on 2018/3/23. 6 | // 7 | 8 | #import "HBDNavigationBar.h" 9 | #import 10 | 11 | #define hairlineWidth (1.f/[UIScreen mainScreen].scale) 12 | 13 | static void hbd_exchangeImplementations(Class class, SEL originalSelector, SEL swizzledSelector) { 14 | Method originalMethod = class_getInstanceMethod(class, originalSelector); 15 | Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); 16 | 17 | BOOL success = class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); 18 | if (success) { 19 | class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 20 | } else { 21 | method_exchangeImplementations(originalMethod, swizzledMethod); 22 | } 23 | } 24 | 25 | //static UIView* findViewByName(UIView *view, NSString *name) { 26 | // NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""]; 27 | // if ([viewName isEqualToString:name]) { 28 | // return view; 29 | // } 30 | // 31 | // UIView *v = nil; 32 | // 33 | // if (view.subviews.count > 0) { 34 | // for (UIView *sub in view.subviews) { 35 | // v = findViewByName(sub, name); 36 | // if (v != nil) { 37 | // break; 38 | // } 39 | // } 40 | // } 41 | // 42 | // return v; 43 | //} 44 | 45 | @interface HBDNavigationBar () 46 | 47 | @property(nonatomic, strong, readwrite) UIImageView *shadowImageView; 48 | @property(nonatomic, strong, readwrite) UIVisualEffectView *fakeView; 49 | @property(nonatomic, strong, readwrite) UIImageView *backgroundImageView; 50 | 51 | @end 52 | 53 | @implementation HBDNavigationBar 54 | 55 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 56 | if (!self.isUserInteractionEnabled || self.isHidden || self.alpha <= 0.01) { 57 | return nil; 58 | } 59 | 60 | UIView *view = [super hitTest:point withEvent:event]; 61 | NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""]; 62 | 63 | if ([view isKindOfClass:[self class]]) { 64 | for (UIView *subview in self.subviews) { 65 | NSString *viewName = [[[subview classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""]; 66 | NSArray *array = @[@"UINavigationItemButtonView"]; 67 | if ([array containsObject:viewName]) { 68 | CGPoint convertedPoint = [self convertPoint:point toView:subview]; 69 | CGRect bounds = subview.bounds; 70 | if (bounds.size.width < 80) { 71 | bounds = CGRectInset(bounds, bounds.size.width - 80, 0); 72 | } 73 | if (CGRectContainsPoint(bounds, convertedPoint)) { 74 | return view; 75 | } 76 | } 77 | } 78 | } 79 | 80 | NSArray *array = @[@"UINavigationBarContentView", @"UIButtonBarStackView", NSStringFromClass([self class])]; 81 | if ([array containsObject:viewName]) { 82 | if (self.backgroundImageView.image) { 83 | if (self.backgroundImageView.alpha < 0.01) { 84 | return nil; 85 | } 86 | } else if (self.fakeView.alpha < 0.01) { 87 | return nil; 88 | } 89 | } 90 | 91 | if (CGRectEqualToRect(view.bounds, CGRectZero)) { 92 | return nil; 93 | } 94 | 95 | return view; 96 | } 97 | 98 | - (void)layoutSubviews { 99 | [super layoutSubviews]; 100 | self.fakeView.frame = self.fakeView.superview.bounds; 101 | self.backgroundImageView.frame = self.backgroundImageView.superview.bounds; 102 | self.shadowImageView.frame = CGRectMake(0, CGRectGetHeight(self.shadowImageView.superview.bounds) - hairlineWidth, CGRectGetWidth(self.shadowImageView.superview.bounds), hairlineWidth); 103 | } 104 | 105 | - (void)setBarTintColor:(UIColor *)barTintColor { 106 | self.fakeView.subviews.lastObject.backgroundColor = barTintColor; 107 | [self makeSureFakeView]; 108 | } 109 | 110 | - (UIVisualEffectView *)fakeView { 111 | if (!_fakeView) { 112 | [super setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 113 | _fakeView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; 114 | _fakeView.userInteractionEnabled = NO; 115 | _fakeView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 116 | [[self.subviews firstObject] insertSubview:_fakeView atIndex:0]; 117 | } 118 | return _fakeView; 119 | } 120 | 121 | - (UIImageView *)backgroundImageView { 122 | if (!_backgroundImageView) { 123 | _backgroundImageView = [[UIImageView alloc] init]; 124 | _backgroundImageView.userInteractionEnabled = NO; 125 | _backgroundImageView.contentScaleFactor = 1; 126 | _backgroundImageView.contentMode = UIViewContentModeScaleToFill; 127 | _backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 128 | [[self.subviews firstObject] insertSubview:_backgroundImageView aboveSubview:self.fakeView]; 129 | } 130 | return _backgroundImageView; 131 | } 132 | 133 | - (UILabel *)backButtonLabel { 134 | if (@available(iOS 11, *)); else return nil; 135 | UIView *navigationBarContentView = [self valueForKeyPath:@"visualProvider.contentView"]; 136 | __block UILabel *backButtonLabel = nil; 137 | [navigationBarContentView.subviews enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(__kindof UIView *_Nonnull subview, NSUInteger idx, BOOL *_Nonnull stop) { 138 | if ([subview isKindOfClass:NSClassFromString(@"_UIButtonBarButton")]) { 139 | UIButton *titleButton = [subview valueForKeyPath:@"visualProvider.titleButton"]; 140 | backButtonLabel = titleButton.titleLabel; 141 | *stop = YES; 142 | } 143 | }]; 144 | return backButtonLabel; 145 | } 146 | 147 | - (void)setBackgroundImage:(UIImage *)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics { 148 | self.backgroundImageView.image = backgroundImage; 149 | [self makeSureFakeView]; 150 | } 151 | 152 | - (UIView *)hbd_backgroundView { 153 | return [self valueForKey:@"_backgroundView"]; 154 | } 155 | 156 | - (void)setTranslucent:(BOOL)translucent { 157 | // prevent default behavior 158 | [super setTranslucent:YES]; 159 | } 160 | 161 | - (void)setShadowImage:(UIImage *)shadowImage { 162 | self.shadowImageView.image = shadowImage; 163 | if (shadowImage) { 164 | self.shadowImageView.backgroundColor = nil; 165 | } else { 166 | self.shadowImageView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:77.0 / 255]; 167 | } 168 | } 169 | 170 | - (UIImageView *)shadowImageView { 171 | if (!_shadowImageView) { 172 | [super setShadowImage:[UIImage new]]; 173 | _shadowImageView = [[UIImageView alloc] init]; 174 | _shadowImageView.userInteractionEnabled = NO; 175 | _shadowImageView.contentScaleFactor = 1; 176 | _shadowImageView.layer.allowsEdgeAntialiasing = YES; 177 | [[self.subviews firstObject] insertSubview:_shadowImageView aboveSubview:self.backgroundImageView]; 178 | } 179 | return _shadowImageView; 180 | } 181 | 182 | - (void)makeSureFakeView { 183 | [UIView setAnimationsEnabled:NO]; 184 | if (!self.fakeView.superview) { 185 | [[self.subviews firstObject] insertSubview:_fakeView atIndex:0]; 186 | self.fakeView.frame = self.fakeView.superview.bounds; 187 | 188 | } 189 | 190 | if (!self.shadowImageView.superview) { 191 | [[self.subviews firstObject] insertSubview:_shadowImageView aboveSubview:self.backgroundImageView]; 192 | self.shadowImageView.frame = CGRectMake(0, CGRectGetHeight(self.shadowImageView.superview.bounds) - hairlineWidth, CGRectGetWidth(self.shadowImageView.superview.bounds), hairlineWidth); 193 | } 194 | 195 | if (!self.backgroundImageView.superview) { 196 | [[self.subviews firstObject] insertSubview:_backgroundImageView aboveSubview:self.fakeView]; 197 | self.backgroundImageView.frame = self.backgroundImageView.superview.bounds; 198 | } 199 | [UIView setAnimationsEnabled:YES]; 200 | } 201 | 202 | @end 203 | 204 | 205 | @implementation UILabel (NavigationBarTransition) 206 | 207 | - (UIColor *)hbd_specifiedTextColor { 208 | return objc_getAssociatedObject(self, _cmd); 209 | } 210 | 211 | - (void)setHbd_specifiedTextColor:(UIColor *)color { 212 | objc_setAssociatedObject(self, @selector(hbd_specifiedTextColor), color, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 213 | } 214 | 215 | + (void)load { 216 | if (@available(iOS 11, *)); else return; 217 | static dispatch_once_t onceToken; 218 | dispatch_once(&onceToken, ^{ 219 | Class class = [self class]; 220 | hbd_exchangeImplementations(class, @selector(setAttributedText:), @selector(hbd_setAttributedText:)); 221 | }); 222 | } 223 | 224 | - (void)hbd_setAttributedText:(NSAttributedString *)attributedText { 225 | if (self.hbd_specifiedTextColor) { 226 | NSMutableAttributedString *mutableAttributedText = [attributedText isKindOfClass:NSMutableAttributedString.class] ? attributedText : [attributedText mutableCopy]; 227 | [mutableAttributedText addAttributes:@{NSForegroundColorAttributeName: self.hbd_specifiedTextColor} range:NSMakeRange(0, mutableAttributedText.length)]; 228 | attributedText = mutableAttributedText; 229 | } 230 | [self hbd_setAttributedText:attributedText]; 231 | } 232 | 233 | 234 | @end 235 | -------------------------------------------------------------------------------- /HBDNavigationBar/Classes/HBDNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HBDNavigationController.h 3 | // HBDNavigationBar 4 | // 5 | // Created by Listen on 2018/3/23. 6 | // 7 | 8 | #import 9 | 10 | @interface HBDNavigationController : UINavigationController 11 | 12 | - (void)updateNavigationBarForViewController:(UIViewController *)vc; 13 | 14 | @end 15 | 16 | @interface UINavigationController (UINavigationBar) 17 | 18 | @end 19 | 20 | @protocol HBDNavigationTransitionProtocol 21 | 22 | - (void)handleNavigationTransition:(UIScreenEdgePanGestureRecognizer *)pan; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /HBDNavigationBar/Classes/HBDNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HBDNavigationController.m 3 | // HBDNavigationBar 4 | // 5 | // Created by Listen on 2018/3/23. 6 | // 7 | 8 | #import "HBDNavigationController.h" 9 | #import "UIViewController+HBD.h" 10 | #import "HBDNavigationBar.h" 11 | 12 | #define hairlineWidth (1.f/[UIScreen mainScreen].scale) 13 | 14 | BOOL isImageEqual(UIImage *image1, UIImage *image2) { 15 | if (image1 == image2) { 16 | return YES; 17 | } 18 | if (image1 && image2) { 19 | NSData *data1 = UIImagePNGRepresentation(image1); 20 | NSData *data2 = UIImagePNGRepresentation(image2); 21 | BOOL result = [data1 isEqual:data2]; 22 | return result; 23 | } 24 | return NO; 25 | } 26 | 27 | BOOL shouldShowFake(UIViewController *vc, UIViewController *from, UIViewController *to) { 28 | if (vc != to) { 29 | return NO; 30 | } 31 | 32 | if (from.hbd_splitNavigationBarTransition || to.hbd_splitNavigationBarTransition) { 33 | return YES; 34 | } 35 | 36 | if (from.hbd_computedBarImage && to.hbd_computedBarImage && isImageEqual(from.hbd_computedBarImage, to.hbd_computedBarImage)) { 37 | // have the same image 38 | return from.hbd_barAlpha != to.hbd_barAlpha; 39 | } 40 | 41 | if (!from.hbd_computedBarImage && !to.hbd_computedBarImage && [from.hbd_computedBarTintColor.description isEqual:to.hbd_computedBarTintColor.description]) { 42 | // no images and the colors are the same 43 | return from.hbd_barAlpha != to.hbd_barAlpha; 44 | } 45 | 46 | return YES; 47 | } 48 | 49 | BOOL colorHasAlphaComponent(UIColor *color) { 50 | if (!color) { 51 | return YES; 52 | } 53 | CGFloat red = 0; 54 | CGFloat green = 0; 55 | CGFloat blue = 0; 56 | CGFloat alpha = 0; 57 | [color getRed:&red green:&green blue:&blue alpha:&alpha]; 58 | return alpha < 1.0; 59 | } 60 | 61 | BOOL imageHasAlphaChannel(UIImage *image) { 62 | CGImageAlphaInfo alpha = CGImageGetAlphaInfo(image.CGImage); 63 | return (alpha == kCGImageAlphaFirst || 64 | alpha == kCGImageAlphaLast || 65 | alpha == kCGImageAlphaPremultipliedFirst || 66 | alpha == kCGImageAlphaPremultipliedLast); 67 | } 68 | 69 | void adjustLayout(UIViewController *vc) { 70 | BOOL isTranslucent = vc.hbd_barHidden || vc.hbd_barAlpha < 1.0; 71 | if (!isTranslucent) { 72 | UIImage *image = vc.hbd_computedBarImage; 73 | if (image) { 74 | isTranslucent = imageHasAlphaChannel(image); 75 | } else { 76 | UIColor *color = vc.hbd_computedBarTintColor; 77 | isTranslucent = colorHasAlphaComponent(color); 78 | } 79 | } 80 | 81 | if (isTranslucent || vc.extendedLayoutIncludesOpaqueBars) { 82 | vc.edgesForExtendedLayout |= UIRectEdgeTop; 83 | } else { 84 | vc.edgesForExtendedLayout &= ~UIRectEdgeTop; 85 | } 86 | 87 | if (vc.hbd_barHidden) { 88 | if (@available(iOS 11.0, *)) { 89 | UIEdgeInsets insets = vc.additionalSafeAreaInsets; 90 | CGFloat height = vc.navigationController.navigationBar.bounds.size.height; 91 | vc.additionalSafeAreaInsets = UIEdgeInsetsMake(-height + insets.top, insets.left, insets.bottom, insets.right); 92 | } 93 | } 94 | } 95 | 96 | UIColor *blendColor(UIColor *from, UIColor *to, CGFloat percent) { 97 | CGFloat fromRed = 0; 98 | CGFloat fromGreen = 0; 99 | CGFloat fromBlue = 0; 100 | CGFloat fromAlpha = 0; 101 | [from getRed:&fromRed green:&fromGreen blue:&fromBlue alpha:&fromAlpha]; 102 | 103 | CGFloat toRed = 0; 104 | CGFloat toGreen = 0; 105 | CGFloat toBlue = 0; 106 | CGFloat toAlpha = 0; 107 | [to getRed:&toRed green:&toGreen blue:&toBlue alpha:&toAlpha]; 108 | 109 | CGFloat newRed = fromRed + (toRed - fromRed) * fminf(1, (float) (percent * 4)); 110 | CGFloat newGreen = fromGreen + (toGreen - fromGreen) * fminf(1, (float) (percent * 4)); 111 | CGFloat newBlue = fromBlue + (toBlue - fromBlue) * fminf(1, (float) (percent * 4)); 112 | CGFloat newAlpha = fromAlpha + (toAlpha - fromAlpha) * fminf(1, (float) (percent * 4)); 113 | return [UIColor colorWithRed:newRed green:newGreen blue:newBlue alpha:newAlpha]; 114 | } 115 | 116 | void printViewHierarchy(UIView *view, NSString *prefix) { 117 | NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""]; 118 | NSLog(@"%@%@ %@", prefix, viewName, NSStringFromCGRect(view.frame)); 119 | if (view.subviews.count > 0) { 120 | for (UIView *sub in view.subviews) { 121 | printViewHierarchy(sub, [NSString stringWithFormat:@"--%@", prefix]); 122 | } 123 | } 124 | } 125 | 126 | @interface HBDNavigationControllerDelegate : UIScreenEdgePanGestureRecognizer 127 | 128 | @property(nonatomic, weak) id navDelegate; 129 | @property(nonatomic, weak, readonly) HBDNavigationController *nav; 130 | 131 | - (instancetype)initWithNavigationController:(HBDNavigationController *)navigationController; 132 | 133 | @end 134 | 135 | @interface HBDNavigationController () 136 | 137 | @property(nonatomic, readonly) HBDNavigationBar *navigationBar; 138 | @property(nonatomic, strong) UIVisualEffectView *fromFakeBar; 139 | @property(nonatomic, strong) UIVisualEffectView *toFakeBar; 140 | @property(nonatomic, strong) UIImageView *fromFakeShadow; 141 | @property(nonatomic, strong) UIImageView *toFakeShadow; 142 | @property(nonatomic, strong) UIImageView *fromFakeImageView; 143 | @property(nonatomic, strong) UIImageView *toFakeImageView; 144 | @property(nonatomic, weak) UIViewController *poppingViewController; 145 | @property(nonatomic, strong) HBDNavigationControllerDelegate *delegateProxy; 146 | 147 | - (void)updateNavigationBarStyleForViewController:(UIViewController *)vc; 148 | 149 | - (void)updateNavigationBarTintColorForViewController:(UIViewController *)vc; 150 | 151 | - (void)updateNavigationBarAlphaForViewController:(UIViewController *)vc; 152 | 153 | - (void)updateNavigationBarBackgroundForViewController:(UIViewController *)vc; 154 | 155 | - (void)showFakeBarFrom:(UIViewController *)from to:(UIViewController *)to; 156 | 157 | - (void)clearFake; 158 | 159 | - (void)resetSubviewsInNavBar:(UINavigationBar *)navBar; 160 | 161 | - (UIGestureRecognizer *)superInteractivePopGestureRecognizer; 162 | 163 | @end 164 | 165 | @implementation HBDNavigationControllerDelegate 166 | 167 | - (instancetype)initWithNavigationController:(HBDNavigationController *)nav { 168 | if (self = [super init]) { 169 | _nav = nav; 170 | self.edges = UIRectEdgeLeft; 171 | self.delegate = self; 172 | [self addTarget:self action:@selector(handleNavigationTransition:)]; 173 | [nav.view addGestureRecognizer:self]; 174 | [nav superInteractivePopGestureRecognizer].enabled = NO; 175 | } 176 | return self; 177 | } 178 | 179 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 180 | if (self.nav.viewControllers.count > 1) { 181 | // 先判断hbd_swipeBackEnabled再判断hbd_backInteractive, 182 | // 可以解决当用户已经将hbd_swipeBackEnabled设置为NO时,并且重写了hbd_backInteractive的getter方法,用手势返回时,先调用hbd_backInteractive的getter方法的问题 183 | // 应该是已经将hbd_swipeBackEnabled设置为NO后,用户再进行侧滑手势时,不触发任何操作。 184 | return self.nav.topViewController.hbd_swipeBackEnabled && self.nav.topViewController.hbd_backInteractive; 185 | } 186 | return NO; 187 | } 188 | 189 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer API_AVAILABLE(ios(7.0)) { 190 | if (gestureRecognizer == self.nav.interactivePopGestureRecognizer) { 191 | return YES; 192 | } 193 | return NO; 194 | } 195 | 196 | - (void)handleNavigationTransition:(UIScreenEdgePanGestureRecognizer *)pan { 197 | HBDNavigationController *nav = self.nav; 198 | if (![self.navDelegate respondsToSelector:@selector(navigationController:interactionControllerForAnimationController:)]) { 199 | id target = (id ) [nav superInteractivePopGestureRecognizer].delegate; 200 | if ([target respondsToSelector:@selector(handleNavigationTransition:)]) { 201 | [target handleNavigationTransition:pan]; 202 | } 203 | } 204 | 205 | if (@available(iOS 11.0, *)); else return; 206 | id coordinator = nav.transitionCoordinator; 207 | if (coordinator) { 208 | UIViewController *from = [coordinator viewControllerForKey:UITransitionContextFromViewControllerKey]; 209 | UIViewController *to = [coordinator viewControllerForKey:UITransitionContextToViewControllerKey]; 210 | if (pan.state == UIGestureRecognizerStateBegan || pan.state == UIGestureRecognizerStateChanged) { 211 | nav.navigationBar.tintColor = blendColor(from.hbd_tintColor, to.hbd_tintColor, coordinator.percentComplete); 212 | } 213 | } 214 | } 215 | 216 | - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { 217 | if (self.navDelegate && [self.navDelegate respondsToSelector:@selector(navigationController:willShowViewController:animated:)]) { 218 | [self.navDelegate navigationController:navigationController willShowViewController:viewController animated:animated]; 219 | } 220 | 221 | if (!viewController.hbd_extendedLayoutDidSet) { 222 | adjustLayout(viewController); 223 | viewController.hbd_extendedLayoutDidSet = YES; 224 | } 225 | 226 | HBDNavigationController *nav = self.nav; 227 | id coordinator = nav.transitionCoordinator; 228 | if (coordinator) { 229 | [self showViewController:viewController withCoordinator:coordinator]; 230 | } else { 231 | if (!animated && nav.childViewControllers.count > 1) { 232 | UIViewController *lastButOne = nav.childViewControllers[nav.childViewControllers.count - 2]; 233 | if (shouldShowFake(viewController, lastButOne, viewController)) { 234 | [nav showFakeBarFrom:lastButOne to:viewController]; 235 | return; 236 | } 237 | } 238 | [nav updateNavigationBarForViewController:viewController]; 239 | } 240 | } 241 | 242 | - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated { 243 | if (self.navDelegate && [self.navDelegate respondsToSelector:@selector(navigationController:didShowViewController:animated:)]) { 244 | [self.navDelegate navigationController:navigationController didShowViewController:viewController animated:animated]; 245 | } 246 | 247 | HBDNavigationController *nav = self.nav; 248 | if (!animated) { 249 | [nav updateNavigationBarForViewController:viewController]; 250 | [nav clearFake]; 251 | } 252 | 253 | nav.poppingViewController = nil; 254 | } 255 | 256 | - (UIInterfaceOrientationMask)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController { 257 | if (self.navDelegate && [self.navDelegate respondsToSelector:@selector(navigationControllerSupportedInterfaceOrientations:)]) { 258 | return [self.navDelegate navigationControllerSupportedInterfaceOrientations:navigationController]; 259 | } 260 | return UIInterfaceOrientationMaskPortrait; 261 | } 262 | 263 | - (UIInterfaceOrientation)navigationControllerPreferredInterfaceOrientationForPresentation:(UINavigationController *)navigationController { 264 | if (self.navDelegate && [self.navDelegate respondsToSelector:@selector(navigationControllerPreferredInterfaceOrientationForPresentation:)]) { 265 | return [self.navDelegate navigationControllerPreferredInterfaceOrientationForPresentation:navigationController]; 266 | } 267 | return UIInterfaceOrientationPortrait; 268 | } 269 | 270 | - (nullable id )navigationController:(UINavigationController *)navigationController 271 | interactionControllerForAnimationController:(id )animationController { 272 | if (self.navDelegate && [self.navDelegate respondsToSelector:@selector(navigationController:interactionControllerForAnimationController:)]) { 273 | return [self.navDelegate navigationController:navigationController interactionControllerForAnimationController:animationController]; 274 | } 275 | return nil; 276 | } 277 | 278 | - (nullable id )navigationController:(UINavigationController *)navigationController 279 | animationControllerForOperation:(UINavigationControllerOperation)operation 280 | fromViewController:(UIViewController *)fromVC 281 | toViewController:(UIViewController *)toVC { 282 | if (self.navDelegate && [self.navDelegate respondsToSelector:@selector(navigationController:animationControllerForOperation:fromViewController:toViewController:)]) { 283 | return [self.navDelegate navigationController:navigationController animationControllerForOperation:operation fromViewController:fromVC toViewController:toVC]; 284 | } 285 | return nil; 286 | } 287 | 288 | - (void)showViewController:(UIViewController *_Nonnull)viewController withCoordinator:(id )coordinator { 289 | UIViewController *from = [coordinator viewControllerForKey:UITransitionContextFromViewControllerKey]; 290 | UIViewController *to = [coordinator viewControllerForKey:UITransitionContextToViewControllerKey]; 291 | 292 | if (@available(iOS 12.0, *)) { 293 | // Fix a system bug https://github.com/listenzz/HBDNavigationBar/issues/35 294 | [self resetButtonLabelInNavBar:self.nav.navigationBar]; 295 | } 296 | 297 | if (self.nav.poppingViewController) { 298 | // Inspired by QMUI 299 | UILabel *backButtonLabel = self.nav.navigationBar.backButtonLabel; 300 | if (backButtonLabel) { 301 | backButtonLabel.hbd_specifiedTextColor = backButtonLabel.textColor; 302 | } 303 | 304 | [coordinator animateAlongsideTransition:^(id _Nonnull context) { 305 | 306 | } completion:^(id _Nonnull context) { 307 | backButtonLabel.hbd_specifiedTextColor = nil; 308 | }]; 309 | } 310 | 311 | [self.nav updateNavigationBarStyleForViewController:viewController]; 312 | 313 | [coordinator animateAlongsideTransition:^(id _Nonnull context) { 314 | BOOL shouldFake = shouldShowFake(viewController, from, to); 315 | if (shouldFake) { 316 | // title attributes, button tint color, barStyle 317 | [self.nav updateNavigationBarTintColorForViewController:viewController]; 318 | 319 | // background alpha, background color, shadow image alpha 320 | [self.nav showFakeBarFrom:from to:to]; 321 | } else { 322 | [self.nav updateNavigationBarForViewController:viewController]; 323 | if (@available(iOS 13.0, *)) { 324 | if (to == viewController) { 325 | self.nav.navigationBar.scrollEdgeAppearance.backgroundColor = viewController.hbd_computedBarTintColor; 326 | self.nav.navigationBar.scrollEdgeAppearance.backgroundImage = viewController.hbd_computedBarImage; 327 | self.nav.navigationBar.standardAppearance.backgroundColor = viewController.hbd_computedBarTintColor; 328 | self.nav.navigationBar.standardAppearance.backgroundImage = viewController.hbd_computedBarImage; 329 | } 330 | } 331 | } 332 | } completion:^(id _Nonnull context) { 333 | self.nav.poppingViewController = nil; 334 | if (@available(iOS 13.0, *)) { 335 | self.nav.navigationBar.scrollEdgeAppearance.backgroundColor = UIColor.clearColor; 336 | self.nav.navigationBar.scrollEdgeAppearance.backgroundImage = nil; 337 | self.nav.navigationBar.standardAppearance.backgroundColor = UIColor.clearColor; 338 | self.nav.navigationBar.standardAppearance.backgroundImage = nil; 339 | } 340 | 341 | if (context.isCancelled) { 342 | if (to == viewController) { 343 | [self.nav updateNavigationBarForViewController:from]; 344 | } 345 | } else { 346 | // `to` != `viewController` when present 347 | [self.nav updateNavigationBarForViewController:viewController]; 348 | } 349 | if (to == viewController) { 350 | [self.nav clearFake]; 351 | } 352 | }]; 353 | } 354 | 355 | - (void)resetButtonLabelInNavBar:(UINavigationBar *)navBar { 356 | if (@available(iOS 12.0, *)) { 357 | for (UIView *view in navBar.subviews) { 358 | NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""]; 359 | if ([viewName isEqualToString:@"UINavigationBarContentView"]) { 360 | [self resetButtonLabelInView:view]; 361 | break; 362 | } 363 | } 364 | } 365 | } 366 | 367 | - (void)resetButtonLabelInView:(UIView *)view { 368 | NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""]; 369 | if ([viewName isEqualToString:@"UIButtonLabel"]) { 370 | view.alpha = 1.0; 371 | } else if (view.subviews.count > 0) { 372 | for (UIView *sub in view.subviews) { 373 | [self resetButtonLabelInView:sub]; 374 | } 375 | } 376 | } 377 | 378 | @end 379 | 380 | @implementation HBDNavigationController 381 | 382 | @dynamic navigationBar; 383 | 384 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController { 385 | if (self = [super initWithNavigationBarClass:[HBDNavigationBar class] toolbarClass:nil]) { 386 | self.viewControllers = @[rootViewController]; 387 | } 388 | return self; 389 | } 390 | 391 | - (UINavigationController *)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClass { 392 | NSAssert([navigationBarClass isSubclassOfClass:[HBDNavigationBar class]], @"navigationBarClass Must be a subclass of HBDNavigationBar"); 393 | return [super initWithNavigationBarClass:navigationBarClass toolbarClass:toolbarClass]; 394 | } 395 | 396 | - (UINavigationController *)init { 397 | return [super initWithNavigationBarClass:[HBDNavigationBar class] toolbarClass:nil]; 398 | } 399 | 400 | - (void)setDelegate:(id )delegate { 401 | if ([delegate isKindOfClass:[HBDNavigationControllerDelegate class]] || !self.delegateProxy) { 402 | [super setDelegate:delegate]; 403 | } else { 404 | self.delegateProxy.navDelegate = delegate; 405 | } 406 | } 407 | 408 | - (UIGestureRecognizer *)interactivePopGestureRecognizer { 409 | return self.delegateProxy; 410 | } 411 | 412 | - (UIGestureRecognizer *)superInteractivePopGestureRecognizer { 413 | return [super interactivePopGestureRecognizer]; 414 | } 415 | 416 | - (UIViewController *)childViewControllerForStatusBarHidden { 417 | return self.topViewController; 418 | } 419 | 420 | - (UIStatusBarStyle)preferredStatusBarStyle { 421 | return self.topViewController.hbd_barStyle == UIBarStyleBlack ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault; 422 | } 423 | 424 | - (UIViewController *)childViewControllerForHomeIndicatorAutoHidden { 425 | return self.topViewController; 426 | } 427 | 428 | - (void)viewDidLoad { 429 | [super viewDidLoad]; 430 | [self.navigationBar setTranslucent:YES]; 431 | [self.navigationBar setShadowImage:[UINavigationBar appearance].shadowImage]; 432 | 433 | if (@available(iOS 13.0, *)) { 434 | UINavigationBarAppearance *scrollEdgeAppearance = [[UINavigationBarAppearance alloc] init]; 435 | [scrollEdgeAppearance configureWithTransparentBackground]; 436 | // scrollEdgeAppearance.backgroundEffect = nil; 437 | scrollEdgeAppearance.backgroundColor = UIColor.clearColor; 438 | scrollEdgeAppearance.shadowColor = UIColor.clearColor; 439 | [scrollEdgeAppearance setBackIndicatorImage:[UINavigationBar appearance].backIndicatorImage transitionMaskImage:[UINavigationBar appearance].backIndicatorTransitionMaskImage]; 440 | self.navigationBar.scrollEdgeAppearance = scrollEdgeAppearance; 441 | self.navigationBar.standardAppearance = [scrollEdgeAppearance copy]; 442 | } 443 | 444 | self.delegateProxy = [[HBDNavigationControllerDelegate alloc] initWithNavigationController:self]; 445 | self.delegateProxy.navDelegate = self.delegate; 446 | self.delegate = self.delegateProxy; 447 | } 448 | 449 | - (void)viewWillLayoutSubviews { 450 | [super viewWillLayoutSubviews]; 451 | id coordinator = self.transitionCoordinator; 452 | if (!coordinator) { 453 | [self updateNavigationBarForViewController:self.topViewController]; 454 | } 455 | } 456 | 457 | - (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item { 458 | if (self.viewControllers.count > 1 && self.topViewController.navigationItem == item) { 459 | if (!(self.topViewController.hbd_backInteractive && self.topViewController.hbd_clickBackEnabled)) { 460 | [self resetSubviewsInNavBar:self.navigationBar]; 461 | return NO; 462 | } 463 | } 464 | return [super navigationBar:navigationBar shouldPopItem:item]; 465 | } 466 | 467 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated { 468 | self.poppingViewController = self.topViewController; 469 | UIViewController *vc = [super popViewControllerAnimated:animated]; 470 | // vc != self.topViewController 471 | [self fixClickBackIssue]; 472 | return vc; 473 | } 474 | 475 | - (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated { 476 | self.poppingViewController = self.topViewController; 477 | NSArray *array = [super popToViewController:viewController animated:animated]; 478 | [self fixClickBackIssue]; 479 | return array; 480 | } 481 | 482 | - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated { 483 | self.poppingViewController = self.topViewController; 484 | NSArray *array = [super popToRootViewControllerAnimated:animated]; 485 | [self fixClickBackIssue]; 486 | return array; 487 | } 488 | 489 | - (void)fixClickBackIssue { 490 | if (@available(iOS 13.0, *)) { 491 | return; 492 | } 493 | if (@available(iOS 11.0, *)) { 494 | // fix:ios 11,12,当前后两个页面的 barStyle 不一样时,点击返回按钮返回,前一个页面的标题颜色响应迟缓或不响应 495 | id coordinator = self.transitionCoordinator; 496 | if (!(coordinator && coordinator.interactive)) { 497 | self.navigationBar.barStyle = self.topViewController.hbd_barStyle; 498 | self.navigationBar.titleTextAttributes = self.topViewController.hbd_titleTextAttributes; 499 | } 500 | } 501 | } 502 | 503 | - (void)resetSubviewsInNavBar:(UINavigationBar *)navBar { 504 | if (@available(iOS 11, *)) { 505 | // empty 506 | } else { 507 | // Workaround for >= iOS7.1. Thanks to @boliva - http://stackoverflow.com/posts/comments/34452906 508 | [navBar.subviews enumerateObjectsUsingBlock:^(__kindof UIView *_Nonnull subview, NSUInteger idx, BOOL *_Nonnull stop) { 509 | if (subview.alpha < 1.0) { 510 | [UIView animateWithDuration:.25 animations:^{ 511 | subview.alpha = 1.0; 512 | }]; 513 | } 514 | }]; 515 | } 516 | } 517 | 518 | - (void)updateNavigationBarForViewController:(UIViewController *)vc { 519 | [self updateNavigationBarStyleForViewController:vc]; 520 | [self updateNavigationBarAlphaForViewController:vc]; 521 | [self updateNavigationBarBackgroundForViewController:vc]; 522 | [self updateNavigationBarTintColorForViewController:vc]; 523 | } 524 | 525 | - (void)updateNavigationBarStyleForViewController:(UIViewController *)vc { 526 | self.navigationBar.barStyle = vc.hbd_barStyle; 527 | } 528 | 529 | - (void)updateNavigationBarTintColorForViewController:(UIViewController *)vc { 530 | self.navigationBar.tintColor = vc.hbd_tintColor; 531 | self.navigationBar.titleTextAttributes = vc.hbd_titleTextAttributes; 532 | if (@available(iOS 13.0, *)) { 533 | self.navigationBar.scrollEdgeAppearance.titleTextAttributes = vc.hbd_titleTextAttributes; 534 | self.navigationBar.standardAppearance.titleTextAttributes = vc.hbd_titleTextAttributes; 535 | } 536 | } 537 | 538 | - (void)updateNavigationBarAlphaForViewController:(UIViewController *)vc { 539 | if (vc.hbd_computedBarImage) { 540 | self.navigationBar.fakeView.alpha = 0; 541 | self.navigationBar.backgroundImageView.alpha = vc.hbd_barAlpha; 542 | } else { 543 | self.navigationBar.fakeView.alpha = vc.hbd_barAlpha; 544 | self.navigationBar.backgroundImageView.alpha = 0; 545 | } 546 | 547 | if (vc.hbd_barAlpha == 0) { 548 | self.navigationBar.hbd_backgroundView.layer.mask = [CALayer new]; 549 | } else { 550 | self.navigationBar.hbd_backgroundView.layer.mask = nil; 551 | } 552 | 553 | self.navigationBar.shadowImageView.alpha = vc.hbd_computedBarShadowAlpha; 554 | } 555 | 556 | - (void)updateNavigationBarBackgroundForViewController:(UIViewController *)vc { 557 | self.navigationBar.barTintColor = vc.hbd_computedBarTintColor; 558 | self.navigationBar.backgroundImageView.image = vc.hbd_computedBarImage; 559 | } 560 | 561 | - (void)showFakeBarFrom:(UIViewController *)from to:(UIViewController *_Nonnull)to { 562 | [UIView setAnimationsEnabled:NO]; 563 | self.navigationBar.fakeView.alpha = 0; 564 | self.navigationBar.shadowImageView.alpha = 0; 565 | self.navigationBar.backgroundImageView.alpha = 0; 566 | [self showFakeBarFrom:from]; 567 | [self showFakeBarTo:to]; 568 | [UIView setAnimationsEnabled:YES]; 569 | } 570 | 571 | - (void)showFakeBarFrom:(UIViewController *)from { 572 | self.fromFakeImageView.image = from.hbd_computedBarImage; 573 | self.fromFakeImageView.alpha = from.hbd_barAlpha; 574 | self.fromFakeImageView.frame = [self fakeBarFrameForViewController:from]; 575 | [from.view addSubview:self.fromFakeImageView]; 576 | 577 | self.fromFakeBar.subviews.lastObject.backgroundColor = from.hbd_computedBarTintColor; 578 | self.fromFakeBar.alpha = from.hbd_computedBarImage ? 0 : from.hbd_barAlpha; 579 | 580 | if (from.hbd_barAlpha == 0 || from.hbd_computedBarImage) { 581 | self.fromFakeBar.subviews.lastObject.layer.mask = [CALayer new]; 582 | } 583 | 584 | self.fromFakeBar.frame = [self fakeBarFrameForViewController:from]; 585 | [from.view addSubview:self.fromFakeBar]; 586 | 587 | self.fromFakeShadow.alpha = from.hbd_computedBarShadowAlpha; 588 | self.fromFakeShadow.frame = [self fakeShadowFrameWithBarFrame:self.fromFakeBar.frame]; 589 | [from.view addSubview:self.fromFakeShadow]; 590 | } 591 | 592 | - (void)showFakeBarTo:(UIViewController *_Nonnull)to { 593 | self.toFakeImageView.image = to.hbd_computedBarImage; 594 | self.toFakeImageView.alpha = to.hbd_barAlpha; 595 | self.toFakeImageView.frame = [self fakeBarFrameForViewController:to]; 596 | [to.view addSubview:self.toFakeImageView]; 597 | 598 | self.toFakeBar.subviews.lastObject.backgroundColor = to.hbd_computedBarTintColor; 599 | self.toFakeBar.alpha = to.hbd_computedBarImage ? 0 : to.hbd_barAlpha; 600 | self.toFakeBar.frame = [self fakeBarFrameForViewController:to]; 601 | [to.view addSubview:self.toFakeBar]; 602 | 603 | self.toFakeShadow.alpha = to.hbd_computedBarShadowAlpha; 604 | self.toFakeShadow.frame = [self fakeShadowFrameWithBarFrame:self.toFakeBar.frame]; 605 | [to.view addSubview:self.toFakeShadow]; 606 | } 607 | 608 | - (UIVisualEffectView *)fromFakeBar { 609 | if (!_fromFakeBar) { 610 | _fromFakeBar = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; 611 | } 612 | return _fromFakeBar; 613 | } 614 | 615 | - (UIVisualEffectView *)toFakeBar { 616 | if (!_toFakeBar) { 617 | _toFakeBar = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; 618 | } 619 | return _toFakeBar; 620 | } 621 | 622 | - (UIImageView *)fromFakeImageView { 623 | if (!_fromFakeImageView) { 624 | _fromFakeImageView = [[UIImageView alloc] init]; 625 | } 626 | return _fromFakeImageView; 627 | } 628 | 629 | - (UIImageView *)toFakeImageView { 630 | if (!_toFakeImageView) { 631 | _toFakeImageView = [[UIImageView alloc] init]; 632 | } 633 | return _toFakeImageView; 634 | } 635 | 636 | - (UIImageView *)fromFakeShadow { 637 | if (!_fromFakeShadow) { 638 | _fromFakeShadow = [[UIImageView alloc] initWithImage:self.navigationBar.shadowImageView.image]; 639 | _fromFakeShadow.backgroundColor = self.navigationBar.shadowImageView.backgroundColor; 640 | } 641 | return _fromFakeShadow; 642 | } 643 | 644 | - (UIImageView *)toFakeShadow { 645 | if (!_toFakeShadow) { 646 | _toFakeShadow = [[UIImageView alloc] initWithImage:self.navigationBar.shadowImageView.image]; 647 | _toFakeShadow.backgroundColor = self.navigationBar.shadowImageView.backgroundColor; 648 | } 649 | return _toFakeShadow; 650 | } 651 | 652 | - (void)clearFake { 653 | [_fromFakeBar removeFromSuperview]; 654 | [_toFakeBar removeFromSuperview]; 655 | [_fromFakeShadow removeFromSuperview]; 656 | [_toFakeShadow removeFromSuperview]; 657 | [_fromFakeImageView removeFromSuperview]; 658 | [_toFakeImageView removeFromSuperview]; 659 | _fromFakeBar = nil; 660 | _toFakeBar = nil; 661 | _fromFakeShadow = nil; 662 | _toFakeShadow = nil; 663 | _fromFakeImageView = nil; 664 | _toFakeImageView = nil; 665 | } 666 | 667 | - (CGRect)fakeBarFrameForViewController:(UIViewController *)vc { 668 | CGFloat height = self.navigationBar.frame.size.height + self.navigationBar.frame.origin.y; 669 | if (vc.view.frame.size.height == self.view.frame.size.height) { 670 | return CGRectMake(0, 0, self.navigationBar.frame.size.width, height); 671 | }else{ 672 | return CGRectMake(0, -height, self.navigationBar.frame.size.width, height); 673 | } 674 | } 675 | 676 | - (CGRect)fakeShadowFrameWithBarFrame:(CGRect)frame { 677 | return CGRectMake(frame.origin.x, frame.size.height + frame.origin.y - hairlineWidth, frame.size.width, hairlineWidth); 678 | } 679 | 680 | @end 681 | 682 | -------------------------------------------------------------------------------- /HBDNavigationBar/Classes/UIViewController+HBD.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+HBD.h 3 | // HBDNavigationBar 4 | // 5 | // Created by Listen on 2018/3/23. 6 | // 7 | 8 | #import 9 | 10 | @interface UIViewController (HBD) 11 | 12 | @property(nonatomic, assign) IBInspectable BOOL hbd_blackBarStyle; 13 | @property(nonatomic, assign) UIBarStyle hbd_barStyle; 14 | @property(nonatomic, strong) IBInspectable UIColor *hbd_barTintColor; 15 | @property(nonatomic, strong) IBInspectable UIImage *hbd_barImage; 16 | @property(nonatomic, strong) IBInspectable UIColor *hbd_tintColor; 17 | @property(nonatomic, strong) NSDictionary *hbd_titleTextAttributes; 18 | @property(nonatomic, assign) IBInspectable CGFloat hbd_barAlpha; 19 | @property(nonatomic, assign) IBInspectable BOOL hbd_barHidden; 20 | @property(nonatomic, assign) IBInspectable BOOL hbd_barShadowHidden; 21 | @property(nonatomic, assign) IBInspectable BOOL hbd_backInteractive; 22 | @property(nonatomic, assign) IBInspectable BOOL hbd_swipeBackEnabled; 23 | @property(nonatomic, assign) IBInspectable BOOL hbd_clickBackEnabled; 24 | @property(nonatomic, assign) IBInspectable BOOL hbd_splitNavigationBarTransition; 25 | 26 | // computed 27 | @property(nonatomic, assign, readonly) CGFloat hbd_computedBarShadowAlpha; 28 | @property(nonatomic, strong, readonly) UIColor *hbd_computedBarTintColor; 29 | @property(nonatomic, strong, readonly) UIImage *hbd_computedBarImage; 30 | 31 | // 这个属性是内部使用的 32 | @property(nonatomic, assign) BOOL hbd_extendedLayoutDidSet; 33 | 34 | - (void)hbd_setNeedsUpdateNavigationBar; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /HBDNavigationBar/Classes/UIViewController+HBD.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+HBD.m 3 | // HBDNavigationBar 4 | // 5 | // Created by Listen on 2018/3/23. 6 | // 7 | 8 | #import "UIViewController+HBD.h" 9 | #import 10 | #import "HBDNavigationController.h" 11 | 12 | @implementation UIViewController (HBD) 13 | 14 | - (BOOL)hbd_blackBarStyle { 15 | return self.hbd_barStyle == UIBarStyleBlack; 16 | } 17 | 18 | - (void)setHbd_blackBarStyle:(BOOL)hbd_blackBarStyle { 19 | self.hbd_barStyle = hbd_blackBarStyle ? UIBarStyleBlack : UIBarStyleDefault; 20 | } 21 | 22 | - (UIBarStyle)hbd_barStyle { 23 | id obj = objc_getAssociatedObject(self, _cmd); 24 | if (obj) { 25 | return [obj integerValue]; 26 | } 27 | return [UINavigationBar appearance].barStyle; 28 | } 29 | 30 | - (void)setHbd_barStyle:(UIBarStyle)hbd_barStyle { 31 | objc_setAssociatedObject(self, @selector(hbd_barStyle), @(hbd_barStyle), OBJC_ASSOCIATION_COPY_NONATOMIC); 32 | } 33 | 34 | - (UIColor *)hbd_barTintColor { 35 | return objc_getAssociatedObject(self, _cmd); 36 | } 37 | 38 | - (void)setHbd_barTintColor:(UIColor *)tintColor { 39 | objc_setAssociatedObject(self, @selector(hbd_barTintColor), tintColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 40 | } 41 | 42 | - (UIImage *)hbd_barImage { 43 | return objc_getAssociatedObject(self, _cmd); 44 | } 45 | 46 | - (void)setHbd_barImage:(UIImage *)image { 47 | objc_setAssociatedObject(self, @selector(hbd_barImage), image, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 48 | } 49 | 50 | - (UIColor *)hbd_tintColor { 51 | id obj = objc_getAssociatedObject(self, _cmd); 52 | return (obj ?: [UINavigationBar appearance].tintColor) ?: UIColor.blackColor; 53 | } 54 | 55 | - (void)setHbd_tintColor:(UIColor *)tintColor { 56 | objc_setAssociatedObject(self, @selector(hbd_tintColor), tintColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 57 | } 58 | 59 | - (NSDictionary *)hbd_titleTextAttributes { 60 | id obj = objc_getAssociatedObject(self, _cmd); 61 | if (obj) { 62 | return obj; 63 | } 64 | 65 | UIBarStyle barStyle = self.hbd_barStyle; 66 | NSDictionary *attributes = [UINavigationBar appearance].titleTextAttributes; 67 | if (attributes) { 68 | if (!attributes[NSForegroundColorAttributeName]) { 69 | NSMutableDictionary *mutableAttributes = [attributes mutableCopy]; 70 | if (barStyle == UIBarStyleBlack) { 71 | [mutableAttributes addEntriesFromDictionary:@{NSForegroundColorAttributeName: UIColor.whiteColor}]; 72 | } else { 73 | [mutableAttributes addEntriesFromDictionary:@{NSForegroundColorAttributeName: UIColor.blackColor}]; 74 | } 75 | return mutableAttributes; 76 | } 77 | return attributes; 78 | } 79 | 80 | if (barStyle == UIBarStyleBlack) { 81 | return @{NSForegroundColorAttributeName: UIColor.whiteColor}; 82 | } else { 83 | return @{NSForegroundColorAttributeName: UIColor.blackColor}; 84 | } 85 | } 86 | 87 | - (void)setHbd_titleTextAttributes:(NSDictionary *)attributes { 88 | objc_setAssociatedObject(self, @selector(hbd_titleTextAttributes), attributes, OBJC_ASSOCIATION_COPY_NONATOMIC); 89 | } 90 | 91 | - (BOOL)hbd_extendedLayoutDidSet { 92 | id obj = objc_getAssociatedObject(self, _cmd); 93 | return obj ? [obj boolValue] : NO; 94 | } 95 | 96 | - (void)setHbd_extendedLayoutDidSet:(BOOL)didSet { 97 | objc_setAssociatedObject(self, @selector(hbd_extendedLayoutDidSet), @(didSet), OBJC_ASSOCIATION_COPY_NONATOMIC); 98 | } 99 | 100 | - (CGFloat)hbd_barAlpha { 101 | id obj = objc_getAssociatedObject(self, _cmd); 102 | if (self.hbd_barHidden) { 103 | return 0; 104 | } 105 | return obj ? [obj floatValue] : 1.0f; 106 | } 107 | 108 | - (void)setHbd_barAlpha:(CGFloat)alpha { 109 | objc_setAssociatedObject(self, @selector(hbd_barAlpha), @(alpha), OBJC_ASSOCIATION_COPY_NONATOMIC); 110 | } 111 | 112 | - (BOOL)hbd_barHidden { 113 | id obj = objc_getAssociatedObject(self, _cmd); 114 | return obj ? [obj boolValue] : NO; 115 | } 116 | 117 | - (void)setHbd_barHidden:(BOOL)hidden { 118 | if (hidden) { 119 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[UIView new]]; 120 | self.navigationItem.titleView = [UIView new]; 121 | } else { 122 | self.navigationItem.leftBarButtonItem = nil; 123 | self.navigationItem.titleView = nil; 124 | } 125 | objc_setAssociatedObject(self, @selector(hbd_barHidden), @(hidden), OBJC_ASSOCIATION_COPY_NONATOMIC); 126 | } 127 | 128 | - (BOOL)hbd_barShadowHidden { 129 | id obj = objc_getAssociatedObject(self, _cmd); 130 | return self.hbd_barHidden || obj ? [obj boolValue] : NO; 131 | } 132 | 133 | - (void)setHbd_barShadowHidden:(BOOL)hidden { 134 | objc_setAssociatedObject(self, @selector(hbd_barShadowHidden), @(hidden), OBJC_ASSOCIATION_COPY_NONATOMIC); 135 | } 136 | 137 | - (BOOL)hbd_backInteractive { 138 | id obj = objc_getAssociatedObject(self, _cmd); 139 | return obj ? [obj boolValue] : YES; 140 | } 141 | 142 | - (void)setHbd_backInteractive:(BOOL)interactive { 143 | objc_setAssociatedObject(self, @selector(hbd_backInteractive), @(interactive), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 144 | } 145 | 146 | - (BOOL)hbd_swipeBackEnabled { 147 | id obj = objc_getAssociatedObject(self, _cmd); 148 | return obj ? [obj boolValue] : YES; 149 | } 150 | 151 | - (void)setHbd_swipeBackEnabled:(BOOL)enabled { 152 | objc_setAssociatedObject(self, @selector(hbd_swipeBackEnabled), @(enabled), OBJC_ASSOCIATION_COPY_NONATOMIC); 153 | } 154 | 155 | - (BOOL)hbd_clickBackEnabled { 156 | id obj = objc_getAssociatedObject(self, _cmd); 157 | return obj ? [obj boolValue] : YES; 158 | } 159 | 160 | - (void)setHbd_clickBackEnabled:(BOOL)enabled { 161 | objc_setAssociatedObject(self, @selector(hbd_clickBackEnabled), @(enabled), OBJC_ASSOCIATION_COPY_NONATOMIC); 162 | } 163 | 164 | - (BOOL)hbd_splitNavigationBarTransition { 165 | id obj = objc_getAssociatedObject(self, _cmd); 166 | return obj ? [obj boolValue] : NO; 167 | } 168 | 169 | - (void)setHbd_splitNavigationBarTransition:(BOOL)splitNavigationBarTransition { 170 | objc_setAssociatedObject(self, @selector(hbd_splitNavigationBarTransition), @(splitNavigationBarTransition), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 171 | } 172 | 173 | - (CGFloat)hbd_computedBarShadowAlpha { 174 | return self.hbd_barShadowHidden ? 0 : self.hbd_barAlpha; 175 | } 176 | 177 | - (UIImage *)hbd_computedBarImage { 178 | UIImage *image = self.hbd_barImage; 179 | if (!image) { 180 | if (self.hbd_barTintColor != nil) { 181 | return nil; 182 | } 183 | image = [[UINavigationBar appearance] backgroundImageForBarMetrics:UIBarMetricsDefault]; 184 | } 185 | return image; 186 | } 187 | 188 | - (UIColor *)hbd_computedBarTintColor { 189 | if (self.hbd_barHidden) { 190 | return UIColor.clearColor; 191 | } 192 | 193 | if (self.hbd_barImage) { 194 | return nil; 195 | } 196 | 197 | UIColor *color = self.hbd_barTintColor; 198 | if (!color) { 199 | if ([[UINavigationBar appearance] backgroundImageForBarMetrics:UIBarMetricsDefault] != nil) { 200 | return nil; 201 | } 202 | if ([UINavigationBar appearance].barTintColor != nil) { 203 | color = [UINavigationBar appearance].barTintColor; 204 | } else { 205 | color = [UINavigationBar appearance].barStyle == UIBarStyleDefault ? [UIColor colorWithRed:247 / 255.0 green:247 / 255.0 blue:247 / 255.0 alpha:0.8] : [UIColor colorWithRed:28 / 255.0 green:28 / 255.0 blue:28 / 255.0 alpha:0.729]; 206 | } 207 | } 208 | return color; 209 | } 210 | 211 | - (void)hbd_setNeedsUpdateNavigationBar { 212 | if (self.navigationController && [self.navigationController isKindOfClass:[HBDNavigationController class]]) { 213 | HBDNavigationController *nav = (HBDNavigationController *) self.navigationController; 214 | if (self == nav.topViewController) { 215 | [nav updateNavigationBarForViewController:self]; 216 | [nav setNeedsStatusBarAppearanceUpdate]; 217 | } 218 | } 219 | } 220 | 221 | @end 222 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 listen 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HBDNavigationBar 2 | 3 | [English Document](./README_EN.md) 4 | 5 | UINavigationBar 是每一个 iOS 工程师都会遇到的坎,它令人抓狂的地方在于是否能随着页面切换而平滑地过渡到目的状态。想要把这件事情做好,不需要高深的算法,不需要深刻的底层原理,只需要一颗执着的内心。 6 | 7 | ## 介绍 8 | 9 | 我们来看微信是如何平滑切换导航栏的状态的 10 | 11 | ![weixin](./screenshot/weixin.gif) 12 | 13 | **我** 页面和 **收藏** 页面的导航栏具有不同的 barStyle 以及背景色 14 | 15 | 当从 **收藏** 右滑返回 **我** 页面时,NavigationBar 的背景被分成黑白两段,并且 bar 上的元素平滑切换,就和只有一个背景色时一样。 16 | 17 | 仔细观察,**我** 页面和 **收藏** 页面的导航栏背景颜色不一样,但是**都有毛玻璃效果** 18 | 19 | **收藏** 页面往上滑动到一定程度时,导航栏会出现 shadowImage,此时如果右滑返回,导航栏依然在 **收藏** 页保留 shadowImage,然而 **我** 页面却没有这根线 20 | 21 | 不得不说,细节处理得真好 22 | 23 | 下面,我们来看一个反例,这是掘金 app 收藏页面的效果,当右滑返回上一个页面时,导航栏那反应实在是突兀,尖锐。 24 | 25 | > 特别说明,本人举掘金这个例子,纯粹是因为掘金是本人常用 app 之一 26 | 27 | ![juejin](./screenshot/juejin.gif) 28 | 29 | 导航栏的平滑过渡,可以划分为以下情况 30 | 31 | ### 阴影显示与隐藏 32 | 33 | 以下展示了平滑切换 shadowImage 的隐与现 34 | 35 | ![shadow](./screenshot/shadow.gif) 36 | 37 | ### 导航栏有与无 38 | 39 | 以下展示导航栏有与无之间的平滑切换,和调用 `setNavigationBarHidden:animated:` 的效果不一样哦 40 | 41 | ![hidden](./screenshot/hidden.gif) 42 | 43 | ### 导航栏背景透明度随 UIScrollView 滚动变化 44 | 45 | 这种效果是不是比掘金好多了 46 | 47 | ![gradient](./screenshot/gradient.gif) 48 | 49 | ### 控制器拥有不同的导航栏背景 50 | 51 | 看下面效果,导航栏背景的表现是不是和微信一样 52 | 53 | ![background](./screenshot/background.gif) 54 | 55 | ## Usage 56 | 57 | 上面这些效果是三个类共同协作的结果: 58 | 59 | HBDNavigationBar 继承 UINavigationBar 60 | 61 | HBDNavigationController 继承 UINavigationController, 内部使用了 HBDNavigationBar 62 | 63 | UIViewController(HBD) 是个分类,里面有一些可配置属性 64 | 65 | ```objc 66 | @property (nonatomic, assign) UIBarStyle hbd_barStyle; // 导航栏样式 67 | @property (nonatomic, strong) UIColor *hbd_barTintColor; // 导航栏背景颜色 68 | @property (nonatomic, strong) UIImage *hbd_barImage; // 导航栏背景图片 69 | @property (nonatomic, strong) UIColor *hbd_tintColor; // 导航栏按钮颜色 70 | @property (nonatomic, strong) NSDictionary *hbd_titleTextAttributes; // 导航栏标题属性 71 | @property (nonatomic, assign) float hbd_barAlpha; // 导航栏背景透明度 72 | @property (nonatomic, assign) BOOL hbd_barHidden; // 是否隐藏导航栏 73 | @property (nonatomic, assign) BOOL hbd_barShadowHidden; // 是否隐藏导航栏下面的阴影 74 | @property (nonatomic, assign) BOOL hbd_backInteractive; // 当前页面是否响应右滑返回,以及通过 `UINavigationBar` 的返回按钮返回,默认是 YES 75 | @property (nonatomic, assign) BOOL hbd_swipeBackEnabled; // 当前页面是否可以右滑返回,默认是 YES 76 | ``` 77 | 78 | 实际使用起来很简单 79 | 80 | 和使用普通的 `UINavigationBar` 一样,定义全局样式: 81 | 82 | ```objc 83 | // AppDelegate.m 84 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 85 | 86 | [[UINavigationBar appearance] setTintColor:UIColor.blackColor]; 87 | // ... 88 | 89 | return YES; 90 | } 91 | ``` 92 | 93 | 使用 `HBDNavigationController` 代替 `UINavigationController` 94 | 95 | ```objc 96 | DemoViewController *vc = [[DemoViewController alloc] init]; 97 | self.window.rootViewController = [[HBDNavigationController alloc] initWithRootViewController:vc]; 98 | ``` 99 | 100 | 如果某个控制器的导航栏样式和全局样式有差异,可以使用 `UIViewController(HBD)` 中的属性,在 `viewDidLoad` 这个生命周期函数里进行微调。这是声明式 API,只需要设置有差异的样式即可,也不需要清理。 101 | 102 | ```objc 103 | @implementation DemoViewController 104 | - (void)viewDidLoad { 105 | [super viewDidLoad]; 106 | // 隐藏导航栏,就这样,不需要调用 setNavigationBarHidden:animated: 107 | // 也不需要担心其它页面会受到影响 108 | self.hbd_barHidden = YES; 109 | } 110 | @end 111 | ``` 112 | 113 | 如果你使用 storyboard, 除了设置 `HBDNavigationController`, 也别忘了设置 `HBDNavigationBar` 114 | 115 | ![storyboard](./screenshot/storyboard.jpg) 116 | 117 | ### 注意事项以及限制 118 | 119 | #### hbd_barHidden 120 | 121 | `hbd_barHidden` 并不真正隐藏导航栏,只是把它变透明了,当然事件是可以穿透的,也正因为并不真正隐藏导航栏,才可以在导航栏有无之间平滑而优雅地切换 122 | 123 | #### Background algorithm 124 | 125 | 一旦通过 `hbd_barImage` 设置背景图片,`hbd_barTintColor` 就会失效 126 | 127 | 背景的计算规则如下: 128 | 129 | 1. hbd_barImage 是否有值,如果有,将其设置为背景,否则下一步 130 | 2. hbd_barTintColor 是否有值,如果有,将其设置为背景,否则下一步 131 | 3. [[UINavigationBar appearance] backgroundImageForBarMetrics:UIBarMetricsDefault] 是否有返回值,如果有,将其设置为背景,否则下一步 132 | 4. [UINavigationBar appearance].barTintColor 是否有值,如果有,将其设置为背景,否则下一步 133 | 5. 根据 barStyle 计算出默认的背景颜色,并将其设置为背景 134 | 135 | 如果使用图片来设置背景,并且希望带有透明度,使用带有透明度的图片即可。 136 | 137 | 如果需要毛玻璃效果,那么设置给 `hbd_barTintColor` 的值应该带有透明度,具体数值根据色值的不同而不同。不要通过 `hbd_barAlpha` 来调整毛玻璃效果,它是用来动态控制导航栏背景的透与暗的,就像掘金收藏页面那个效果一样。 138 | 139 | 图片是没有毛玻璃效果的 140 | 141 | #### Aways translucent 142 | 143 | 本库重写了 UINavigationBar 的 `translucent` 属性,使得它的值总是 YES。 144 | 145 | 本库根据导航栏的背景是否含有透明度,自动调整 `UIViewController#edgesForExtendedLayout` 这个属性。 146 | 147 | 如果导航栏一开始是不透明的,由于后续操作而变透明,需要设置 `UIViewController#extendedLayoutIncludesOpaqueBars` 的值为 `YES`。 148 | 149 | ```objc 150 | - (void)viewDidLoad { 151 | [super viewDidLoad]; 152 | // 一开始导航栏为不透明 153 | self.hbd_barTintColor = UIColor.whiteColor; 154 | self.extendedLayoutIncludesOpaqueBars = YES; 155 | } 156 | 157 | - (void)handleScroll { 158 | // 由于用户操作而变透明 159 | self.hbd_barAlpha = 0.5; 160 | [self hbd_setNeedsUpdateNavigationBar]; 161 | } 162 | 163 | ``` 164 | 165 | 基本原则就是如果我们设置的背景是含有透明度的,那么页面就应该位于 NavigationBar 底下(under),否则位于 NavigationBar 下面(below). 166 | 167 | 如果我们的 NavigationBar 一开始是不透明的,但有可能因为用户操作而变透明,那么设置 `extendedLayoutIncludesOpaqueBars` 的值为 `YES`。 168 | 169 | 170 | #### 拦截返回事件 171 | 172 | 有时,我们需要在用户点击返回按钮或者侧滑返回时提醒用户,此时,可以重写以下方法,返回 NO 173 | 174 | ```objc 175 | 176 | - (BOOL)hbd_backInteractive { 177 | // show alert 178 | return NO; 179 | } 180 | 181 | ``` 182 | 183 | #### 隐藏状态栏 184 | 185 | 如果你需要隐藏状态栏,请配合 [HBDStatusBar](https://github.com/listenzz/HBDStatusBar) 一起使用 186 | 187 | #### 全屏返回 188 | 189 | 创建一个继承于 `HBDNavigationController` 的子类,具体参考 FSPNavigationController 190 | 191 | ```objc 192 | // FSPNavigationController.m 193 | @implementation FSPNavigationController 194 | 195 | - (void)viewDidLoad { 196 | [super viewDidLoad]; 197 | 198 | // 获取系统自带滑动手势的target对象 199 | id target = self.interactivePopGestureRecognizer.delegate; 200 | // 创建全屏滑动手势,调用系统自带滑动手势的 target 的 action 方法 201 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)]; 202 | // 设置手势代理,拦截手势触发 203 | pan.delegate = self.interactivePopGestureRecognizer.delegate; 204 | // 给导航控制器的view添加全屏滑动手势 205 | [self.view addGestureRecognizer:pan]; 206 | // 禁止使用系统自带的滑动手势 207 | self.interactivePopGestureRecognizer.enabled = NO; 208 | } 209 | 210 | @end 211 | ``` 212 | 213 | 214 | ## 感谢 215 | 216 | 在完善导航栏相关功能时,查看了 GitHub 上十多个相关项目,其中给我帮助最大的是 [YPNavigationBarTransition](https://github.com/yiplee/YPNavigationBarTransition),它为我解决不同背景之间如何平滑切换提供了非常有价值的参考。 217 | 218 | ## Requirements 219 | 220 | iOS 9+ 221 | 222 | ## Installation 223 | 224 | HBDNavigationBar is available through [CocoaPods](http://cocoapods.org). To install 225 | it, simply add the following line to your Podfile: 226 | 227 | ```ruby 228 | pod 'HBDNavigationBar', '~> 1.9.8' 229 | ``` 230 | 231 | ## License 232 | 233 | HBDNavigationBar is available under the MIT license. See the LICENSE file for more info. 234 | -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | # HBDNavigationBar 2 | 3 | A custom UINavigationBar for smooth switching between various states, including bar style, bar tint color, background image, background alpha, bar hidden, title text attributes, tint color, shadow hidden... 4 | 5 | ## Screenshots 6 | 7 | ### ShadowImage transition between present and absent 8 | 9 | ![shadow](./screenshot/shadow.gif) 10 | 11 | ### NavigationBar transition between present and absent 12 | 13 | It's diffrent from by calling `setNavigationBarHidden:animated:` 14 | 15 | ![hidden](./screenshot/hidden.gif) 16 | 17 | ### NavigationBar background alpha transition 18 | 19 | ![gradient](./screenshot/gradient.gif) 20 | 21 | ### NavigationBar transition between diffrent background 22 | 23 | ![background](./screenshot/background.gif) 24 | 25 | ## Usage 26 | 27 | These effects are the result of three classes working together: 28 | 29 | `HBDNavigationBar` inherits `UINavigationBar` 30 | 31 | `HBDNavigationController` inherits `UINavigationController` and internally uses `HBDNavigationBar` 32 | 33 | `UIViewController(HBD)` is a category with some configurable properties 34 | 35 | ```objc 36 | @property (nonatomic, assign) UIBarStyle hbd_barStyle; // The NavigationBar style, which determines the color of the status bar 37 | @property (nonatomic, strong) UIColor *hbd_barTintColor; // NavigationBar background color 38 | @property (nonatomic, strong) UIImage *hbd_barImage; // NavigationBar background image 39 | @property (nonatomic, strong) UIColor *hbd_tintColor; // NavigationBar button color 40 | @property (nonatomic, strong) NSDictionary *hbd_titleTextAttributes; // NavigationBar title attributes 41 | @property (nonatomic, assign) float hbd_barAlpha; // NavigationBar background alpha 42 | @property (nonatomic, assign) BOOL hbd_barHidden; // Whether to hide the NavigationBar 43 | @property (nonatomic, assign) BOOL hbd_barShadowHidden; // Whether to hide the shadowImage of the NavigationBar 44 | @property (nonatomic, assign) BOOL hbd_backInteractive; // Whether the UIViewController can responds to edge gesture, and can pop by click the back button of `UINavigationBar`. The default value is `YES` 45 | @property (nonatomic, assign) BOOL hbd_swipeBackEnabled; // Whether the UIViewController can responds to edge gesture, the default value is `YES` 46 | ``` 47 | 48 | Actually simple to use: 49 | 50 | Custom your NavigationBar style globally, just as using normal UINavigationBar. 51 | 52 | ```objc 53 | // AppDelegate.m 54 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 55 | 56 | [[UINavigationBar appearance] setTintColor:UIColor.blackColor]; 57 | // ... 58 | 59 | return YES; 60 | } 61 | ``` 62 | 63 | Use `HBDNavigationController` instead of `UINavigationController`. 64 | 65 | ```objc 66 | DemoViewController *vc = [[DemoViewController alloc] init]; 67 | self.window.rootViewController = [[HBDNavigationController alloc] initWithRootViewController:vc]; 68 | ``` 69 | 70 | If a UIViewController's NavigationBar style is different from global, tweak the style at its `viewDidLoad` using the properties in `UIViewController(HBD)`. It's declarative API, you only need to set the unique features of that UIViewController, no need to clean up. 71 | 72 | ```objc 73 | @implementation DemoViewController 74 | - (void)viewDidLoad { 75 | [super viewDidLoad]; 76 | // hide the NavigationBar just for this UIViewController 77 | self.hbd_barHidden = YES; 78 | } 79 | @end 80 | ``` 81 | 82 | Don't forget to set `HBDNavigationBar` in addition to setting `HBDNavigationController`, if you use storyboard. 83 | 84 | ![storyboard](./screenshot/storyboard.jpg) 85 | 86 | ### Caveat and Limitation 87 | 88 | #### hbd_barHidden 89 | 90 | `hbd_barHidden` doesn't really hide the NavigationBar, just make it transparent. Of course, the touch event can be pass through. Just because we don't really hide the NavigationBar, we can switch between the NavigationBar style smoothly and gracefully. 91 | 92 | #### Background algorithm 93 | 94 | `hbd_barTintColor` will be invalidated once the background image is set via `hbd_barImage`. 95 | 96 | The calculation rules for the background are as follows: 97 | 98 | 1. Whether `hbd_barImage` has a value, if it is, set it to background, otherwise the next step 99 | 2. Whether `hbd_barTintColor` has a value, if it is, set it to background, otherwise the next step 100 | 3. Whether `[[UINavigationBar appearance] backgroundImageForBarMetrics:UIBarMetricsDefault]` has a value, if it is, set it to background, otherwise the next step 101 | 4. Whether `[UINavigationBar appearance].barTintColor` has a value, if it is, set it to background, otherwise the next step 102 | 5. Calculate the default background color based on `NavigationBar#barStyle` and set it to background 103 | 104 | If you use an image to set the background and want transparency, use an image with transparency. 105 | 106 | If blur effect is required, the color set to `hbd_barTintColor` should have non-zero alpha component. Don't use `hbd_barAlpha` to adjust the blur effect, it is used to control the alpha of the NavigationBar background, dynamically. 107 | 108 | The image background is without blur effect. 109 | 110 | #### Aways translucent 111 | 112 | The value of the NavigationBar property `translucent` is always `YES`. You can not change it. It means that the UIViewController's view is always under the NavigationBar, which may bothering some guy. Our current solution to this problem is to define a base class: 113 | 114 | ```objc 115 | @interface HBDViewController : UIViewController 116 | 117 | @property (nonatomic, assign) BOOL hbd_extendedLayoutIncludesTopBar; 118 | 119 | @end 120 | 121 | BOOL hasAlpha(UIColor *color) { 122 | if (!color) { 123 | return YES; 124 | } 125 | CGFloat red = 0; 126 | CGFloat green= 0; 127 | CGFloat blue = 0; 128 | CGFloat alpha = 0; 129 | [color getRed:&red green:&green blue:&blue alpha:&alpha]; 130 | return alpha < 1.0; 131 | } 132 | 133 | @implementation HBDViewController 134 | 135 | - (void)viewDidLoad { 136 | [super viewDidLoad]; 137 | 138 | if (!(self.hbd_extendedLayoutIncludesTopBar || hasAlpha(self.hbd_barTintColor))) { 139 | self.edgesForExtendedLayout = UIRectEdgeNone; 140 | } 141 | } 142 | 143 | @end 144 | ``` 145 | 146 | The basic principle is that if the background has alpha, then the UIViewController's view should be under the NavigationBar, otherwise it will be below the NavigationBar. 147 | If our NavigationBar is opaque at first, but it may be transparent due to user actions, set the value of `hbd_extendedLayoutIncludesTopBar` to `YES`, remember to set it before `[super viewDidLoad]`. 148 | 149 | #### Intercept back event 150 | 151 | Sometimes, we need to intercept the back click event and back gesture. For that, you can override the following method to return `NO`: 152 | 153 | ```objc 154 | 155 | - (BOOL)hbd_backInteractive { 156 | // show alert 157 | return NO; 158 | } 159 | 160 | ``` 161 | 162 | #### About hiding statusBar 163 | 164 | If you need to hide the status bar, use this lib with [HBDStatusBar](https://github.com/listenzz/HBDStatusBar) 165 | 166 | ## Requirements 167 | 168 | iOS 8+ 169 | 170 | ## Installation 171 | 172 | HBDNavigationBar is available through [CocoaPods](http://cocoapods.org). To install 173 | it, simply add the following line to your Podfile: 174 | 175 | ```ruby 176 | pod 'HBDNavigationBar', '~> 1.5.0' 177 | ``` 178 | 179 | ## License 180 | 181 | HBDNavigationBar is available under the MIT license. See the LICENSE file for more info. 182 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /screenshot/alpha.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/alpha.gif -------------------------------------------------------------------------------- /screenshot/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/background.gif -------------------------------------------------------------------------------- /screenshot/gradient.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/gradient.gif -------------------------------------------------------------------------------- /screenshot/hidden.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/hidden.gif -------------------------------------------------------------------------------- /screenshot/juejin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/juejin.gif -------------------------------------------------------------------------------- /screenshot/shadow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/shadow.gif -------------------------------------------------------------------------------- /screenshot/storyboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/storyboard.jpg -------------------------------------------------------------------------------- /screenshot/weixin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/HBDNavigationBar/586be2911fd74e4d296cd1a92ce947fc1705a13f/screenshot/weixin.gif --------------------------------------------------------------------------------