├── LICENSE ├── README.md ├── ZFNavigationController ├── ZFNavigationBar.h ├── ZFNavigationBar.m ├── ZFNavigationController.h ├── ZFNavigationController.m └── image │ ├── button_back@2x.png │ └── button_back@3x.png └── ZFNavigationControllerDemo ├── ZFNavigationControllerDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── zhangfei.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── zhangfei.xcuserdatad │ └── xcschemes │ ├── ZFNavigationControllerDemo.xcscheme │ └── xcschememanagement.plist ├── ZFNavigationControllerDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Brand Assets.launchimage │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m ├── ZFNavigationController │ ├── ZFNavigationBar.h │ ├── ZFNavigationBar.m │ ├── ZFNavigationController.h │ ├── ZFNavigationController.m │ └── image │ │ ├── button_back@2x.png │ │ └── button_back@3x.png └── main.m ├── ZFNavigationControllerDemoTests ├── Info.plist └── ZFNavigationControllerDemoTests.m └── ZFNavigationControllerDemoUITests ├── Info.plist └── ZFNavigationControllerDemoUITests.m /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 张飞 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #ZFNavigationController 2 | ##简介 3 | 很喜欢天猫和网易新闻的导航控制器的pop效果,于是封装了一个相同的pop效果。将自定义的navigationBar作为了viewcontroller的属性。第一版封装得比较简单,后期再深度封装一下。当然我只是抛砖引玉,希望喜欢这个效果的朋友们拿去自己DIY吧! 4 | ##效果 5 | ![](http://ww2.sinaimg.cn/large/cfaa8811jw1ez0fikjqltg208s0fodl2.gif) 6 | ##使用方法 7 | >首先将ZFNavigationController文件夹拖入工程中,在AppDelegate中设置你的导航控制器。 8 | 9 | ``` Objective-C 10 | ViewController *viewVC = [[ViewController alloc] init]; 11 | ZFNavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewVC]; 12 | self.window.rootViewController = nav; 13 | ``` 14 | - 开启全屏返回手势 15 | 16 | ``` Objective-C 17 | nav.fullScreenPopGesture = YES; 18 | ``` 19 | - 设置viewcontroller的title 20 | 21 | ``` Objective-C 22 | self.title = @"首页"; 23 | ``` 24 | - viewcontroller隐藏navigationBar 25 | 26 | ``` Objective-C 27 | self.navigationBarHidden = YES; 28 | ``` 29 | 30 | >如果是storyboard,使用User Defined Runtime Attributes 31 | 32 | ![](http://ww1.sinaimg.cn/large/cfaa8811jw1ez0h12hrthj20pp0nyq5n.jpg) 33 | 34 | ![](http://ww2.sinaimg.cn/large/cfaa8811jw1ez0h165pfoj20po0nzdij.jpg) 35 | 36 | 博客地址:[小飞的技术博客](http://zhangfei.tk/2015/12/05/Runtime%E5%AE%9E%E6%88%98%E4%B9%8B%E5%AF%BC%E8%88%AA%E6%8E%A7%E5%88%B6%E5%99%A8%E9%82%A3%E4%BA%9B%E4%BA%8B/#more),欢迎star! 37 | ##License 38 | MIT 39 | 40 | -------------------------------------------------------------------------------- /ZFNavigationController/ZFNavigationBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZFNavigationBar.h 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZFNavigationBarDelegate; 12 | 13 | @interface ZFNavigationBar : UIView 14 | 15 | @property (nonatomic, weak) id delegate; 16 | @property (nonatomic, strong) UIView *barLine; 17 | @property (nonatomic, copy) NSString *title; 18 | @property (nonatomic, strong) UILabel *titleLable; 19 | @property (nonatomic, strong) UIButton *backItem; 20 | 21 | @end 22 | 23 | @protocol ZFNavigationBarDelegate 24 | 25 | - (void)didClickBackitem; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ZFNavigationController/ZFNavigationBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZFNavigationBar.m 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import "ZFNavigationBar.h" 10 | 11 | #define SCREENWIDTH ([UIScreen mainScreen].bounds.size.width) 12 | 13 | @interface ZFNavigationBar () 14 | @end 15 | 16 | @implementation ZFNavigationBar 17 | 18 | - (instancetype)initWithFrame:(CGRect)frame{ 19 | 20 | self = [super initWithFrame:frame]; 21 | 22 | if(self){ 23 | [self initializeUI]; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (instancetype)init{ 30 | return [self initWithFrame:CGRectZero]; 31 | } 32 | 33 | - (void)initializeUI{ 34 | self.frame = CGRectMake(0, 0, SCREENWIDTH, 64); 35 | self.backgroundColor = [UIColor colorWithWhite:0.961 alpha:1.000]; 36 | 37 | self.barLine = [UIView new]; 38 | self.barLine.frame = CGRectMake(0, 63, SCREENWIDTH, 1); 39 | self.barLine.backgroundColor = [UIColor colorWithWhite:0.639 alpha:1.000]; 40 | [self addSubview:self.barLine]; 41 | 42 | self.backItem = [UIButton buttonWithType:UIButtonTypeCustom]; 43 | self.backItem.frame = CGRectMake(0, 20, 30, 44); 44 | [self.backItem setImage:[UIImage imageNamed:@"button_back"] forState:UIControlStateNormal]; 45 | [self.backItem addTarget:self action:@selector(popViewController) forControlEvents:UIControlEventTouchUpInside]; 46 | [self addSubview:self.backItem]; 47 | 48 | CGFloat titleLableX = SCREENWIDTH *0.5 - 50; 49 | self.titleLable = [[UILabel alloc] init]; 50 | self.titleLable.frame = CGRectMake(titleLableX, 20, 100, 43); 51 | self.titleLable.text = self.title; 52 | self.titleLable.textAlignment = NSTextAlignmentCenter; 53 | self.titleLable.lineBreakMode = NSLineBreakByTruncatingTail; 54 | [self addSubview:self.titleLable]; 55 | 56 | } 57 | 58 | - (void)popViewController{ 59 | if (_delegate && [_delegate respondsToSelector:@selector(didClickBackitem)]) { 60 | [_delegate didClickBackitem]; 61 | }else{ 62 | NSLog(@"没有实现ZFNavigationBarDelegate协议!"); 63 | } 64 | } 65 | 66 | - (void)setTitle:(NSString *)title{ 67 | _title = title; 68 | 69 | if (!title) { 70 | _titleLable.text = @""; 71 | return; 72 | } 73 | if ([title isEqualToString:_titleLable.text]) { 74 | return; 75 | } 76 | if (!_titleLable) { 77 | _titleLable = [[UILabel alloc] init]; 78 | _titleLable.textAlignment = NSTextAlignmentCenter; 79 | _titleLable.lineBreakMode = NSLineBreakByTruncatingTail; 80 | } 81 | 82 | _titleLable.text = title; 83 | [self setNeedsDisplay]; 84 | } 85 | @end 86 | -------------------------------------------------------------------------------- /ZFNavigationController/ZFNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyNavigationController.h 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ZFNavigationController : UINavigationController 13 | 14 | @property (nonatomic, assign) BOOL fullScreenPopGesture; 15 | /** 16 | * 设置返回手势的范围,数值是距离页面左边的距离,默认是全屏。 17 | */ 18 | @property (nonatomic, assign) CGFloat maxAllowedInitialDistance; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ZFNavigationController/ZFNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MyNavigationController.m 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import "ZFNavigationController.h" 10 | #import "ZFNavigationBar.h" 11 | #import 12 | 13 | @interface UIViewController (ZFNavigationBar) 14 | 15 | @property (nonatomic, strong) ZFNavigationBar *navigationBar; 16 | @property (nonatomic, getter=isNavigationBar) BOOL navigationBarHidden; 17 | @property (nonatomic, copy) NSString *title; 18 | 19 | @end 20 | 21 | @implementation UIViewController (ZFNavigationBar) 22 | 23 | @dynamic navigationBar; 24 | @dynamic navigationBarHidden; 25 | @dynamic title; 26 | 27 | - (ZFNavigationBar *)navigationBar{ 28 | return objc_getAssociatedObject(self, _cmd); 29 | } 30 | - (void)setNavigationBar:(ZFNavigationBar *)navigationBar{ 31 | objc_setAssociatedObject(self, @selector(navigationBar), navigationBar, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 32 | } 33 | 34 | - (BOOL)isNavigationBar{ 35 | return [objc_getAssociatedObject(self, _cmd) boolValue]; 36 | } 37 | - (void)setNavigationBarHidden:(BOOL)navigationBarHidden{ 38 | objc_setAssociatedObject(self, @selector(isNavigationBar), @(navigationBarHidden), OBJC_ASSOCIATION_ASSIGN); 39 | } 40 | - (NSString *)title{ 41 | return objc_getAssociatedObject(self, _cmd); 42 | } 43 | - (void)setTitle:(NSString *)title{ 44 | objc_setAssociatedObject(self, @selector(title), title, OBJC_ASSOCIATION_COPY); 45 | } 46 | @end 47 | 48 | 49 | @interface ZFNavigationController () 50 | 51 | @property (nonatomic, strong) ZFNavigationBar *rootViewNavgationBar; 52 | 53 | @end 54 | 55 | @implementation ZFNavigationController 56 | 57 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController{ 58 | self = [super initWithRootViewController:rootViewController]; 59 | if (self) { 60 | 61 | } 62 | return self; 63 | } 64 | 65 | - (instancetype)init{ 66 | self = [super init]; 67 | if (self) { 68 | _maxAllowedInitialDistance = [UIScreen mainScreen].bounds.size.width; 69 | } 70 | return self; 71 | } 72 | 73 | - (void)loadView{ 74 | 75 | [super loadView]; 76 | self.navigationBar.hidden = YES; 77 | self.rootViewNavgationBar = [[ZFNavigationBar alloc] init]; 78 | self.rootViewNavgationBar.delegate = self; 79 | self.rootViewNavgationBar.title = self.topViewController.title; 80 | [self.topViewController.view addSubview:self.rootViewNavgationBar]; 81 | 82 | if (self.childViewControllers.count == 1) { 83 | self.rootViewNavgationBar.backItem.hidden = YES; 84 | } 85 | 86 | if (self.fullScreenPopGesture) { 87 | id target = self.interactivePopGestureRecognizer.delegate; 88 | SEL internalAction = NSSelectorFromString(@"handleNavigationTransition:"); 89 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:target action:internalAction]; 90 | panGesture.delegate = self; 91 | [self.view addGestureRecognizer:panGesture]; 92 | panGesture.maximumNumberOfTouches = 1; 93 | self.interactivePopGestureRecognizer.enabled = NO; 94 | } 95 | } 96 | 97 | - (void)viewDidLoad{ 98 | [super viewDidLoad]; 99 | } 100 | 101 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ 102 | ZFNavigationBar *naviBar = [[ZFNavigationBar alloc] init]; 103 | naviBar.delegate = self; 104 | [viewController.view addSubview:naviBar]; 105 | if (viewController.navigationBarHidden) { 106 | naviBar.hidden = YES; 107 | } 108 | naviBar.title = viewController.title; 109 | [super pushViewController:viewController animated:animated]; 110 | } 111 | 112 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated{ 113 | return [super popViewControllerAnimated:animated]; 114 | } 115 | 116 | - (void)didClickBackitem{ 117 | [self popViewControllerAnimated:YES]; 118 | } 119 | 120 | #pragma mark - Delegate 121 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{ 122 | CGPoint beginningLocation = [gestureRecognizer locationInView:gestureRecognizer.view]; 123 | CGFloat maxAllowedInitialDistance = self.maxAllowedInitialDistance; 124 | if (maxAllowedInitialDistance > 0 && beginningLocation.x > maxAllowedInitialDistance) { 125 | return NO; 126 | } 127 | if (self.childViewControllers.count == 1) { 128 | return NO; 129 | } 130 | if ([[self valueForKey:@"_isTransitioning"] boolValue]) { 131 | return NO; 132 | } 133 | return YES; 134 | } 135 | @end 136 | 137 | 138 | -------------------------------------------------------------------------------- /ZFNavigationController/image/button_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangfeidev/ZFNavigationController/4e906bc92aac8df01a223b007526505d930acc07/ZFNavigationController/image/button_back@2x.png -------------------------------------------------------------------------------- /ZFNavigationController/image/button_back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangfeidev/ZFNavigationController/4e906bc92aac8df01a223b007526505d930acc07/ZFNavigationController/image/button_back@3x.png -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 54199E811C1FE8E8000110E9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 54199E801C1FE8E8000110E9 /* main.m */; }; 11 | 54199E841C1FE8E8000110E9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 54199E831C1FE8E8000110E9 /* AppDelegate.m */; }; 12 | 54199E871C1FE8E8000110E9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54199E861C1FE8E8000110E9 /* ViewController.m */; }; 13 | 54199E8A1C1FE8E8000110E9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 54199E881C1FE8E8000110E9 /* Main.storyboard */; }; 14 | 54199E8C1C1FE8E8000110E9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54199E8B1C1FE8E8000110E9 /* Assets.xcassets */; }; 15 | 54199E8F1C1FE8E8000110E9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 54199E8D1C1FE8E8000110E9 /* LaunchScreen.storyboard */; }; 16 | 54199E9A1C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 54199E991C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.m */; }; 17 | 54199EA51C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 54199EA41C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.m */; }; 18 | 54199EBA1C1FE930000110E9 /* button_back@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 54199EB41C1FE930000110E9 /* button_back@2x.png */; }; 19 | 54199EBB1C1FE930000110E9 /* button_back@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 54199EB51C1FE930000110E9 /* button_back@3x.png */; }; 20 | 54199EBC1C1FE930000110E9 /* ZFNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 54199EB71C1FE930000110E9 /* ZFNavigationBar.m */; }; 21 | 54199EBD1C1FE930000110E9 /* ZFNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54199EB91C1FE930000110E9 /* ZFNavigationController.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 54199E961C1FE8E8000110E9 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 54199E741C1FE8E8000110E9 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 54199E7B1C1FE8E8000110E9; 30 | remoteInfo = ZFNavigationControllerDemo; 31 | }; 32 | 54199EA11C1FE8E8000110E9 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 54199E741C1FE8E8000110E9 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 54199E7B1C1FE8E8000110E9; 37 | remoteInfo = ZFNavigationControllerDemo; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 54199E7C1C1FE8E8000110E9 /* ZFNavigationControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZFNavigationControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 54199E801C1FE8E8000110E9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 54199E821C1FE8E8000110E9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 54199E831C1FE8E8000110E9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 54199E851C1FE8E8000110E9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 47 | 54199E861C1FE8E8000110E9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 48 | 54199E891C1FE8E8000110E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 54199E8B1C1FE8E8000110E9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | 54199E8E1C1FE8E8000110E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | 54199E901C1FE8E8000110E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 54199E951C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZFNavigationControllerDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 54199E991C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZFNavigationControllerDemoTests.m; sourceTree = ""; }; 54 | 54199E9B1C1FE8E8000110E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 54199EA01C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZFNavigationControllerDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 54199EA41C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZFNavigationControllerDemoUITests.m; sourceTree = ""; }; 57 | 54199EA61C1FE8E8000110E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 54199EB41C1FE930000110E9 /* button_back@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_back@2x.png"; sourceTree = ""; }; 59 | 54199EB51C1FE930000110E9 /* button_back@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_back@3x.png"; sourceTree = ""; }; 60 | 54199EB61C1FE930000110E9 /* ZFNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZFNavigationBar.h; sourceTree = ""; }; 61 | 54199EB71C1FE930000110E9 /* ZFNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZFNavigationBar.m; sourceTree = ""; }; 62 | 54199EB81C1FE930000110E9 /* ZFNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZFNavigationController.h; sourceTree = ""; }; 63 | 54199EB91C1FE930000110E9 /* ZFNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZFNavigationController.m; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | 54199E791C1FE8E8000110E9 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | 54199E921C1FE8E8000110E9 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | 54199E9D1C1FE8E8000110E9 /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 54199E731C1FE8E8000110E9 = { 92 | isa = PBXGroup; 93 | children = ( 94 | 54199E7E1C1FE8E8000110E9 /* ZFNavigationControllerDemo */, 95 | 54199E981C1FE8E8000110E9 /* ZFNavigationControllerDemoTests */, 96 | 54199EA31C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests */, 97 | 54199E7D1C1FE8E8000110E9 /* Products */, 98 | ); 99 | sourceTree = ""; 100 | }; 101 | 54199E7D1C1FE8E8000110E9 /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 54199E7C1C1FE8E8000110E9 /* ZFNavigationControllerDemo.app */, 105 | 54199E951C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.xctest */, 106 | 54199EA01C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.xctest */, 107 | ); 108 | name = Products; 109 | sourceTree = ""; 110 | }; 111 | 54199E7E1C1FE8E8000110E9 /* ZFNavigationControllerDemo */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 54199EB21C1FE930000110E9 /* ZFNavigationController */, 115 | 54199E821C1FE8E8000110E9 /* AppDelegate.h */, 116 | 54199E831C1FE8E8000110E9 /* AppDelegate.m */, 117 | 54199E851C1FE8E8000110E9 /* ViewController.h */, 118 | 54199E861C1FE8E8000110E9 /* ViewController.m */, 119 | 54199E881C1FE8E8000110E9 /* Main.storyboard */, 120 | 54199E8B1C1FE8E8000110E9 /* Assets.xcassets */, 121 | 54199E8D1C1FE8E8000110E9 /* LaunchScreen.storyboard */, 122 | 54199E901C1FE8E8000110E9 /* Info.plist */, 123 | 54199E7F1C1FE8E8000110E9 /* Supporting Files */, 124 | ); 125 | path = ZFNavigationControllerDemo; 126 | sourceTree = ""; 127 | }; 128 | 54199E7F1C1FE8E8000110E9 /* Supporting Files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 54199E801C1FE8E8000110E9 /* main.m */, 132 | ); 133 | name = "Supporting Files"; 134 | sourceTree = ""; 135 | }; 136 | 54199E981C1FE8E8000110E9 /* ZFNavigationControllerDemoTests */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 54199E991C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.m */, 140 | 54199E9B1C1FE8E8000110E9 /* Info.plist */, 141 | ); 142 | path = ZFNavigationControllerDemoTests; 143 | sourceTree = ""; 144 | }; 145 | 54199EA31C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 54199EA41C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.m */, 149 | 54199EA61C1FE8E8000110E9 /* Info.plist */, 150 | ); 151 | path = ZFNavigationControllerDemoUITests; 152 | sourceTree = ""; 153 | }; 154 | 54199EB21C1FE930000110E9 /* ZFNavigationController */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 54199EB31C1FE930000110E9 /* image */, 158 | 54199EB61C1FE930000110E9 /* ZFNavigationBar.h */, 159 | 54199EB71C1FE930000110E9 /* ZFNavigationBar.m */, 160 | 54199EB81C1FE930000110E9 /* ZFNavigationController.h */, 161 | 54199EB91C1FE930000110E9 /* ZFNavigationController.m */, 162 | ); 163 | path = ZFNavigationController; 164 | sourceTree = ""; 165 | }; 166 | 54199EB31C1FE930000110E9 /* image */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 54199EB41C1FE930000110E9 /* button_back@2x.png */, 170 | 54199EB51C1FE930000110E9 /* button_back@3x.png */, 171 | ); 172 | path = image; 173 | sourceTree = ""; 174 | }; 175 | /* End PBXGroup section */ 176 | 177 | /* Begin PBXNativeTarget section */ 178 | 54199E7B1C1FE8E8000110E9 /* ZFNavigationControllerDemo */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = 54199EA91C1FE8E8000110E9 /* Build configuration list for PBXNativeTarget "ZFNavigationControllerDemo" */; 181 | buildPhases = ( 182 | 54199E781C1FE8E8000110E9 /* Sources */, 183 | 54199E791C1FE8E8000110E9 /* Frameworks */, 184 | 54199E7A1C1FE8E8000110E9 /* Resources */, 185 | ); 186 | buildRules = ( 187 | ); 188 | dependencies = ( 189 | ); 190 | name = ZFNavigationControllerDemo; 191 | productName = ZFNavigationControllerDemo; 192 | productReference = 54199E7C1C1FE8E8000110E9 /* ZFNavigationControllerDemo.app */; 193 | productType = "com.apple.product-type.application"; 194 | }; 195 | 54199E941C1FE8E8000110E9 /* ZFNavigationControllerDemoTests */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = 54199EAC1C1FE8E8000110E9 /* Build configuration list for PBXNativeTarget "ZFNavigationControllerDemoTests" */; 198 | buildPhases = ( 199 | 54199E911C1FE8E8000110E9 /* Sources */, 200 | 54199E921C1FE8E8000110E9 /* Frameworks */, 201 | 54199E931C1FE8E8000110E9 /* Resources */, 202 | ); 203 | buildRules = ( 204 | ); 205 | dependencies = ( 206 | 54199E971C1FE8E8000110E9 /* PBXTargetDependency */, 207 | ); 208 | name = ZFNavigationControllerDemoTests; 209 | productName = ZFNavigationControllerDemoTests; 210 | productReference = 54199E951C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.xctest */; 211 | productType = "com.apple.product-type.bundle.unit-test"; 212 | }; 213 | 54199E9F1C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests */ = { 214 | isa = PBXNativeTarget; 215 | buildConfigurationList = 54199EAF1C1FE8E8000110E9 /* Build configuration list for PBXNativeTarget "ZFNavigationControllerDemoUITests" */; 216 | buildPhases = ( 217 | 54199E9C1C1FE8E8000110E9 /* Sources */, 218 | 54199E9D1C1FE8E8000110E9 /* Frameworks */, 219 | 54199E9E1C1FE8E8000110E9 /* Resources */, 220 | ); 221 | buildRules = ( 222 | ); 223 | dependencies = ( 224 | 54199EA21C1FE8E8000110E9 /* PBXTargetDependency */, 225 | ); 226 | name = ZFNavigationControllerDemoUITests; 227 | productName = ZFNavigationControllerDemoUITests; 228 | productReference = 54199EA01C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.xctest */; 229 | productType = "com.apple.product-type.bundle.ui-testing"; 230 | }; 231 | /* End PBXNativeTarget section */ 232 | 233 | /* Begin PBXProject section */ 234 | 54199E741C1FE8E8000110E9 /* Project object */ = { 235 | isa = PBXProject; 236 | attributes = { 237 | LastUpgradeCheck = 0710; 238 | ORGANIZATIONNAME = zhangfei; 239 | TargetAttributes = { 240 | 54199E7B1C1FE8E8000110E9 = { 241 | CreatedOnToolsVersion = 7.1; 242 | }; 243 | 54199E941C1FE8E8000110E9 = { 244 | CreatedOnToolsVersion = 7.1; 245 | DevelopmentTeam = 9K8799MPY3; 246 | TestTargetID = 54199E7B1C1FE8E8000110E9; 247 | }; 248 | 54199E9F1C1FE8E8000110E9 = { 249 | CreatedOnToolsVersion = 7.1; 250 | DevelopmentTeam = 9K8799MPY3; 251 | TestTargetID = 54199E7B1C1FE8E8000110E9; 252 | }; 253 | }; 254 | }; 255 | buildConfigurationList = 54199E771C1FE8E8000110E9 /* Build configuration list for PBXProject "ZFNavigationControllerDemo" */; 256 | compatibilityVersion = "Xcode 3.2"; 257 | developmentRegion = English; 258 | hasScannedForEncodings = 0; 259 | knownRegions = ( 260 | en, 261 | Base, 262 | ); 263 | mainGroup = 54199E731C1FE8E8000110E9; 264 | productRefGroup = 54199E7D1C1FE8E8000110E9 /* Products */; 265 | projectDirPath = ""; 266 | projectRoot = ""; 267 | targets = ( 268 | 54199E7B1C1FE8E8000110E9 /* ZFNavigationControllerDemo */, 269 | 54199E941C1FE8E8000110E9 /* ZFNavigationControllerDemoTests */, 270 | 54199E9F1C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests */, 271 | ); 272 | }; 273 | /* End PBXProject section */ 274 | 275 | /* Begin PBXResourcesBuildPhase section */ 276 | 54199E7A1C1FE8E8000110E9 /* Resources */ = { 277 | isa = PBXResourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 54199E8F1C1FE8E8000110E9 /* LaunchScreen.storyboard in Resources */, 281 | 54199E8C1C1FE8E8000110E9 /* Assets.xcassets in Resources */, 282 | 54199EBB1C1FE930000110E9 /* button_back@3x.png in Resources */, 283 | 54199E8A1C1FE8E8000110E9 /* Main.storyboard in Resources */, 284 | 54199EBA1C1FE930000110E9 /* button_back@2x.png in Resources */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | 54199E931C1FE8E8000110E9 /* Resources */ = { 289 | isa = PBXResourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | 54199E9E1C1FE8E8000110E9 /* Resources */ = { 296 | isa = PBXResourcesBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | /* End PBXResourcesBuildPhase section */ 303 | 304 | /* Begin PBXSourcesBuildPhase section */ 305 | 54199E781C1FE8E8000110E9 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 54199E871C1FE8E8000110E9 /* ViewController.m in Sources */, 310 | 54199EBD1C1FE930000110E9 /* ZFNavigationController.m in Sources */, 311 | 54199EBC1C1FE930000110E9 /* ZFNavigationBar.m in Sources */, 312 | 54199E841C1FE8E8000110E9 /* AppDelegate.m in Sources */, 313 | 54199E811C1FE8E8000110E9 /* main.m in Sources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | 54199E911C1FE8E8000110E9 /* Sources */ = { 318 | isa = PBXSourcesBuildPhase; 319 | buildActionMask = 2147483647; 320 | files = ( 321 | 54199E9A1C1FE8E8000110E9 /* ZFNavigationControllerDemoTests.m in Sources */, 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | }; 325 | 54199E9C1C1FE8E8000110E9 /* Sources */ = { 326 | isa = PBXSourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | 54199EA51C1FE8E8000110E9 /* ZFNavigationControllerDemoUITests.m in Sources */, 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | /* End PBXSourcesBuildPhase section */ 334 | 335 | /* Begin PBXTargetDependency section */ 336 | 54199E971C1FE8E8000110E9 /* PBXTargetDependency */ = { 337 | isa = PBXTargetDependency; 338 | target = 54199E7B1C1FE8E8000110E9 /* ZFNavigationControllerDemo */; 339 | targetProxy = 54199E961C1FE8E8000110E9 /* PBXContainerItemProxy */; 340 | }; 341 | 54199EA21C1FE8E8000110E9 /* PBXTargetDependency */ = { 342 | isa = PBXTargetDependency; 343 | target = 54199E7B1C1FE8E8000110E9 /* ZFNavigationControllerDemo */; 344 | targetProxy = 54199EA11C1FE8E8000110E9 /* PBXContainerItemProxy */; 345 | }; 346 | /* End PBXTargetDependency section */ 347 | 348 | /* Begin PBXVariantGroup section */ 349 | 54199E881C1FE8E8000110E9 /* Main.storyboard */ = { 350 | isa = PBXVariantGroup; 351 | children = ( 352 | 54199E891C1FE8E8000110E9 /* Base */, 353 | ); 354 | name = Main.storyboard; 355 | sourceTree = ""; 356 | }; 357 | 54199E8D1C1FE8E8000110E9 /* LaunchScreen.storyboard */ = { 358 | isa = PBXVariantGroup; 359 | children = ( 360 | 54199E8E1C1FE8E8000110E9 /* Base */, 361 | ); 362 | name = LaunchScreen.storyboard; 363 | sourceTree = ""; 364 | }; 365 | /* End PBXVariantGroup section */ 366 | 367 | /* Begin XCBuildConfiguration section */ 368 | 54199EA71C1FE8E8000110E9 /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ALWAYS_SEARCH_USER_PATHS = NO; 372 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 373 | CLANG_CXX_LIBRARY = "libc++"; 374 | CLANG_ENABLE_MODULES = YES; 375 | CLANG_ENABLE_OBJC_ARC = YES; 376 | CLANG_WARN_BOOL_CONVERSION = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 379 | CLANG_WARN_EMPTY_BODY = YES; 380 | CLANG_WARN_ENUM_CONVERSION = YES; 381 | CLANG_WARN_INT_CONVERSION = YES; 382 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = dwarf; 388 | ENABLE_STRICT_OBJC_MSGSEND = YES; 389 | ENABLE_TESTABILITY = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_DYNAMIC_NO_PIC = NO; 392 | GCC_NO_COMMON_BLOCKS = YES; 393 | GCC_OPTIMIZATION_LEVEL = 0; 394 | GCC_PREPROCESSOR_DEFINITIONS = ( 395 | "DEBUG=1", 396 | "$(inherited)", 397 | ); 398 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 399 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 400 | GCC_WARN_UNDECLARED_SELECTOR = YES; 401 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 402 | GCC_WARN_UNUSED_FUNCTION = YES; 403 | GCC_WARN_UNUSED_VARIABLE = YES; 404 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 405 | MTL_ENABLE_DEBUG_INFO = YES; 406 | ONLY_ACTIVE_ARCH = YES; 407 | SDKROOT = iphoneos; 408 | }; 409 | name = Debug; 410 | }; 411 | 54199EA81C1FE8E8000110E9 /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | ALWAYS_SEARCH_USER_PATHS = NO; 415 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 416 | CLANG_CXX_LIBRARY = "libc++"; 417 | CLANG_ENABLE_MODULES = YES; 418 | CLANG_ENABLE_OBJC_ARC = YES; 419 | CLANG_WARN_BOOL_CONVERSION = YES; 420 | CLANG_WARN_CONSTANT_CONVERSION = YES; 421 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 422 | CLANG_WARN_EMPTY_BODY = YES; 423 | CLANG_WARN_ENUM_CONVERSION = YES; 424 | CLANG_WARN_INT_CONVERSION = YES; 425 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 426 | CLANG_WARN_UNREACHABLE_CODE = YES; 427 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 428 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 429 | COPY_PHASE_STRIP = NO; 430 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 431 | ENABLE_NS_ASSERTIONS = NO; 432 | ENABLE_STRICT_OBJC_MSGSEND = YES; 433 | GCC_C_LANGUAGE_STANDARD = gnu99; 434 | GCC_NO_COMMON_BLOCKS = YES; 435 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 436 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 437 | GCC_WARN_UNDECLARED_SELECTOR = YES; 438 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 439 | GCC_WARN_UNUSED_FUNCTION = YES; 440 | GCC_WARN_UNUSED_VARIABLE = YES; 441 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 442 | MTL_ENABLE_DEBUG_INFO = NO; 443 | SDKROOT = iphoneos; 444 | VALIDATE_PRODUCT = YES; 445 | }; 446 | name = Release; 447 | }; 448 | 54199EAA1C1FE8E8000110E9 /* Debug */ = { 449 | isa = XCBuildConfiguration; 450 | buildSettings = { 451 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 452 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; 453 | CODE_SIGN_IDENTITY = "iPhone Developer"; 454 | INFOPLIST_FILE = ZFNavigationControllerDemo/Info.plist; 455 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | PRODUCT_BUNDLE_IDENTIFIER = tk.zhangfei.www.ZFNavigationControllerDemo; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | }; 460 | name = Debug; 461 | }; 462 | 54199EAB1C1FE8E8000110E9 /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 466 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; 467 | CODE_SIGN_IDENTITY = "iPhone Developer"; 468 | INFOPLIST_FILE = ZFNavigationControllerDemo/Info.plist; 469 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 471 | PRODUCT_BUNDLE_IDENTIFIER = tk.zhangfei.www.ZFNavigationControllerDemo; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | }; 474 | name = Release; 475 | }; 476 | 54199EAD1C1FE8E8000110E9 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | BUNDLE_LOADER = "$(TEST_HOST)"; 480 | INFOPLIST_FILE = ZFNavigationControllerDemoTests/Info.plist; 481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 482 | PRODUCT_BUNDLE_IDENTIFIER = tk.zhangfei.www.ZFNavigationControllerDemoTests; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZFNavigationControllerDemo.app/ZFNavigationControllerDemo"; 485 | }; 486 | name = Debug; 487 | }; 488 | 54199EAE1C1FE8E8000110E9 /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | BUNDLE_LOADER = "$(TEST_HOST)"; 492 | INFOPLIST_FILE = ZFNavigationControllerDemoTests/Info.plist; 493 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 494 | PRODUCT_BUNDLE_IDENTIFIER = tk.zhangfei.www.ZFNavigationControllerDemoTests; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZFNavigationControllerDemo.app/ZFNavigationControllerDemo"; 497 | }; 498 | name = Release; 499 | }; 500 | 54199EB01C1FE8E8000110E9 /* Debug */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | INFOPLIST_FILE = ZFNavigationControllerDemoUITests/Info.plist; 504 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 505 | PRODUCT_BUNDLE_IDENTIFIER = tk.zhangfei.www.ZFNavigationControllerDemoUITests; 506 | PRODUCT_NAME = "$(TARGET_NAME)"; 507 | TEST_TARGET_NAME = ZFNavigationControllerDemo; 508 | USES_XCTRUNNER = YES; 509 | }; 510 | name = Debug; 511 | }; 512 | 54199EB11C1FE8E8000110E9 /* Release */ = { 513 | isa = XCBuildConfiguration; 514 | buildSettings = { 515 | INFOPLIST_FILE = ZFNavigationControllerDemoUITests/Info.plist; 516 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 517 | PRODUCT_BUNDLE_IDENTIFIER = tk.zhangfei.www.ZFNavigationControllerDemoUITests; 518 | PRODUCT_NAME = "$(TARGET_NAME)"; 519 | TEST_TARGET_NAME = ZFNavigationControllerDemo; 520 | USES_XCTRUNNER = YES; 521 | }; 522 | name = Release; 523 | }; 524 | /* End XCBuildConfiguration section */ 525 | 526 | /* Begin XCConfigurationList section */ 527 | 54199E771C1FE8E8000110E9 /* Build configuration list for PBXProject "ZFNavigationControllerDemo" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 54199EA71C1FE8E8000110E9 /* Debug */, 531 | 54199EA81C1FE8E8000110E9 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | 54199EA91C1FE8E8000110E9 /* Build configuration list for PBXNativeTarget "ZFNavigationControllerDemo" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | 54199EAA1C1FE8E8000110E9 /* Debug */, 540 | 54199EAB1C1FE8E8000110E9 /* Release */, 541 | ); 542 | defaultConfigurationIsVisible = 0; 543 | defaultConfigurationName = Release; 544 | }; 545 | 54199EAC1C1FE8E8000110E9 /* Build configuration list for PBXNativeTarget "ZFNavigationControllerDemoTests" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | 54199EAD1C1FE8E8000110E9 /* Debug */, 549 | 54199EAE1C1FE8E8000110E9 /* Release */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | 54199EAF1C1FE8E8000110E9 /* Build configuration list for PBXNativeTarget "ZFNavigationControllerDemoUITests" */ = { 555 | isa = XCConfigurationList; 556 | buildConfigurations = ( 557 | 54199EB01C1FE8E8000110E9 /* Debug */, 558 | 54199EB11C1FE8E8000110E9 /* Release */, 559 | ); 560 | defaultConfigurationIsVisible = 0; 561 | defaultConfigurationName = Release; 562 | }; 563 | /* End XCConfigurationList section */ 564 | }; 565 | rootObject = 54199E741C1FE8E8000110E9 /* Project object */; 566 | } 567 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/zhangfei.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangfeidev/ZFNavigationController/4e906bc92aac8df01a223b007526505d930acc07/ZFNavigationControllerDemo/ZFNavigationControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/zhangfei.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo.xcodeproj/xcuserdata/zhangfei.xcuserdatad/xcschemes/ZFNavigationControllerDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo.xcodeproj/xcuserdata/zhangfei.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZFNavigationControllerDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 54199E7B1C1FE8E8000110E9 16 | 17 | primary 18 | 19 | 20 | 54199E941C1FE8E8000110E9 21 | 22 | primary 23 | 24 | 25 | 54199E9F1C1FE8E8000110E9 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ZFNavigationControllerDemo 4 | // 5 | // Created by zhangfei on 15/12/15. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ZFNavigationControllerDemo 4 | // 5 | // Created by zhangfei on 15/12/15. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/Assets.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "minimum-system-version" : "7.0", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "orientation" : "portrait", 11 | "idiom" : "iphone", 12 | "minimum-system-version" : "7.0", 13 | "subtype" : "retina4", 14 | "scale" : "2x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/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 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 28 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 74 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 120 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ZFNavigationControllerDemo 4 | // 5 | // Created by zhangfei on 15/12/15. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ZFNavigationControllerDemo 4 | // 5 | // Created by zhangfei on 15/12/15. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/ZFNavigationBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZFNavigationBar.h 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZFNavigationBarDelegate; 12 | 13 | @interface ZFNavigationBar : UIView 14 | 15 | @property (nonatomic, weak) id delegate; 16 | @property (nonatomic, strong) UIView *barLine; 17 | @property (nonatomic, copy) NSString *title; 18 | @property (nonatomic, strong) UILabel *titleLable; 19 | @property (nonatomic, strong) UIButton *backItem; 20 | 21 | @end 22 | 23 | @protocol ZFNavigationBarDelegate 24 | 25 | - (void)didClickBackitem; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/ZFNavigationBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZFNavigationBar.m 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import "ZFNavigationBar.h" 10 | 11 | #define SCREENWIDTH ([UIScreen mainScreen].bounds.size.width) 12 | 13 | @interface ZFNavigationBar () 14 | @end 15 | 16 | @implementation ZFNavigationBar 17 | 18 | - (instancetype)initWithFrame:(CGRect)frame{ 19 | 20 | self = [super initWithFrame:frame]; 21 | 22 | if(self){ 23 | [self initializeUI]; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (instancetype)init{ 30 | return [self initWithFrame:CGRectZero]; 31 | } 32 | 33 | - (void)initializeUI{ 34 | self.frame = CGRectMake(0, 0, SCREENWIDTH, 64); 35 | self.backgroundColor = [UIColor colorWithWhite:0.961 alpha:1.000]; 36 | 37 | self.barLine = [UIView new]; 38 | self.barLine.frame = CGRectMake(0, 63, SCREENWIDTH, 1); 39 | self.barLine.backgroundColor = [UIColor colorWithWhite:0.639 alpha:1.000]; 40 | [self addSubview:self.barLine]; 41 | 42 | self.backItem = [UIButton buttonWithType:UIButtonTypeCustom]; 43 | self.backItem.frame = CGRectMake(0, 20, 30, 44); 44 | [self.backItem setImage:[UIImage imageNamed:@"button_back"] forState:UIControlStateNormal]; 45 | [self.backItem addTarget:self action:@selector(popViewController) forControlEvents:UIControlEventTouchUpInside]; 46 | [self addSubview:self.backItem]; 47 | 48 | CGFloat titleLableX = SCREENWIDTH *0.5 - 50; 49 | self.titleLable = [[UILabel alloc] init]; 50 | self.titleLable.frame = CGRectMake(titleLableX, 20, 100, 43); 51 | self.titleLable.text = self.title; 52 | self.titleLable.textAlignment = NSTextAlignmentCenter; 53 | self.titleLable.lineBreakMode = NSLineBreakByTruncatingTail; 54 | [self addSubview:self.titleLable]; 55 | 56 | } 57 | 58 | - (void)popViewController{ 59 | if (_delegate && [_delegate respondsToSelector:@selector(didClickBackitem)]) { 60 | [_delegate didClickBackitem]; 61 | }else{ 62 | NSLog(@"没有实现ZFNavigationBarDelegate协议!"); 63 | } 64 | } 65 | 66 | - (void)setTitle:(NSString *)title{ 67 | _title = title; 68 | 69 | if (!title) { 70 | _titleLable.text = @""; 71 | return; 72 | } 73 | if ([title isEqualToString:_titleLable.text]) { 74 | return; 75 | } 76 | if (!_titleLable) { 77 | _titleLable = [[UILabel alloc] init]; 78 | _titleLable.textAlignment = NSTextAlignmentCenter; 79 | _titleLable.lineBreakMode = NSLineBreakByTruncatingTail; 80 | } 81 | 82 | _titleLable.text = title; 83 | [self setNeedsDisplay]; 84 | } 85 | @end 86 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/ZFNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyNavigationController.h 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ZFNavigationController : UINavigationController 13 | 14 | @property (nonatomic, assign) BOOL fullScreenPopGesture; 15 | /** 16 | * 设置返回手势的范围,数值是距离页面左边的距离,默认是全屏。 17 | */ 18 | @property (nonatomic, assign) CGFloat maxAllowedInitialDistance; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/ZFNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MyNavigationController.m 3 | // TestNavigationController 4 | // 5 | // Created by zhangfei on 15/11/27. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import "ZFNavigationController.h" 10 | #import "ZFNavigationBar.h" 11 | #import 12 | 13 | @interface UIViewController (ZFNavigationBar) 14 | 15 | @property (nonatomic, strong) ZFNavigationBar *navigationBar; 16 | @property (nonatomic, getter=isNavigationBar) BOOL navigationBarHidden; 17 | @property (nonatomic, copy) NSString *title; 18 | 19 | @end 20 | 21 | @implementation UIViewController (ZFNavigationBar) 22 | 23 | @dynamic navigationBar; 24 | @dynamic navigationBarHidden; 25 | @dynamic title; 26 | 27 | - (ZFNavigationBar *)navigationBar{ 28 | return objc_getAssociatedObject(self, _cmd); 29 | } 30 | - (void)setNavigationBar:(ZFNavigationBar *)navigationBar{ 31 | objc_setAssociatedObject(self, @selector(navigationBar), navigationBar, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 32 | } 33 | 34 | - (BOOL)isNavigationBar{ 35 | return [objc_getAssociatedObject(self, _cmd) boolValue]; 36 | } 37 | - (void)setNavigationBarHidden:(BOOL)navigationBarHidden{ 38 | objc_setAssociatedObject(self, @selector(isNavigationBar), @(navigationBarHidden), OBJC_ASSOCIATION_ASSIGN); 39 | } 40 | - (NSString *)title{ 41 | return objc_getAssociatedObject(self, _cmd); 42 | } 43 | - (void)setTitle:(NSString *)title{ 44 | objc_setAssociatedObject(self, @selector(title), title, OBJC_ASSOCIATION_COPY); 45 | } 46 | @end 47 | 48 | 49 | @interface ZFNavigationController () 50 | 51 | @property (nonatomic, strong) ZFNavigationBar *rootViewNavgationBar; 52 | 53 | @end 54 | 55 | @implementation ZFNavigationController 56 | 57 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController{ 58 | self = [super initWithRootViewController:rootViewController]; 59 | if (self) { 60 | 61 | } 62 | return self; 63 | } 64 | 65 | - (instancetype)init{ 66 | self = [super init]; 67 | if (self) { 68 | _maxAllowedInitialDistance = [UIScreen mainScreen].bounds.size.width; 69 | } 70 | return self; 71 | } 72 | 73 | - (void)loadView{ 74 | 75 | [super loadView]; 76 | self.navigationBar.hidden = YES; 77 | self.rootViewNavgationBar = [[ZFNavigationBar alloc] init]; 78 | self.rootViewNavgationBar.delegate = self; 79 | self.rootViewNavgationBar.title = self.topViewController.title; 80 | [self.topViewController.view addSubview:self.rootViewNavgationBar]; 81 | 82 | if (self.childViewControllers.count == 1) { 83 | self.rootViewNavgationBar.backItem.hidden = YES; 84 | } 85 | 86 | if (self.fullScreenPopGesture) { 87 | id target = self.interactivePopGestureRecognizer.delegate; 88 | SEL internalAction = NSSelectorFromString(@"handleNavigationTransition:"); 89 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:target action:internalAction]; 90 | panGesture.delegate = self; 91 | [self.view addGestureRecognizer:panGesture]; 92 | panGesture.maximumNumberOfTouches = 1; 93 | self.interactivePopGestureRecognizer.enabled = NO; 94 | } 95 | } 96 | 97 | - (void)viewDidLoad{ 98 | [super viewDidLoad]; 99 | } 100 | 101 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ 102 | ZFNavigationBar *naviBar = [[ZFNavigationBar alloc] init]; 103 | naviBar.delegate = self; 104 | [viewController.view addSubview:naviBar]; 105 | if (viewController.navigationBarHidden) { 106 | naviBar.hidden = YES; 107 | } 108 | naviBar.title = viewController.title; 109 | [super pushViewController:viewController animated:animated]; 110 | } 111 | 112 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated{ 113 | return [super popViewControllerAnimated:animated]; 114 | } 115 | 116 | - (void)didClickBackitem{ 117 | [self popViewControllerAnimated:YES]; 118 | } 119 | 120 | #pragma mark - Delegate 121 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{ 122 | CGPoint beginningLocation = [gestureRecognizer locationInView:gestureRecognizer.view]; 123 | CGFloat maxAllowedInitialDistance = self.maxAllowedInitialDistance; 124 | if (maxAllowedInitialDistance > 0 && beginningLocation.x > maxAllowedInitialDistance) { 125 | return NO; 126 | } 127 | if (self.childViewControllers.count == 1) { 128 | return NO; 129 | } 130 | if ([[self valueForKey:@"_isTransitioning"] boolValue]) { 131 | return NO; 132 | } 133 | return YES; 134 | } 135 | @end 136 | 137 | 138 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/image/button_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangfeidev/ZFNavigationController/4e906bc92aac8df01a223b007526505d930acc07/ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/image/button_back@2x.png -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/image/button_back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangfeidev/ZFNavigationController/4e906bc92aac8df01a223b007526505d930acc07/ZFNavigationControllerDemo/ZFNavigationControllerDemo/ZFNavigationController/image/button_back@3x.png -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ZFNavigationControllerDemo 4 | // 5 | // Created by zhangfei on 15/12/15. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemoTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemoTests/ZFNavigationControllerDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZFNavigationControllerDemoTests.m 3 | // ZFNavigationControllerDemoTests 4 | // 5 | // Created by zhangfei on 15/12/15. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZFNavigationControllerDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZFNavigationControllerDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemoUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ZFNavigationControllerDemo/ZFNavigationControllerDemoUITests/ZFNavigationControllerDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZFNavigationControllerDemoUITests.m 3 | // ZFNavigationControllerDemoUITests 4 | // 5 | // Created by zhangfei on 15/12/15. 6 | // Copyright © 2015年 zhangfei. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZFNavigationControllerDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZFNavigationControllerDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------