├── .gitignore ├── LICENSE ├── LxNavigationController.podspec ├── LxNavigationController ├── LxNavigationController.h └── LxNavigationController.m ├── LxNavigationControllerDemo ├── LxNavigationControllerDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── LxNavigationControllerDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── README.md └── demo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /LxNavigationController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "LxNavigationController" 3 | s.version = "1.0.0" 4 | s.summary = "Add a powerful gesture you can pop view controller only if you sweep the screen from left the right" 5 | 6 | s.homepage = "https://github.com/DeveloperLx/LxNavigationController" 7 | s.license = 'Apache' 8 | s.authors = { 'DeveloperLx' => 'developerlx@yeah.com' } 9 | s.platform = :ios, "7.0" 10 | s.ios.deployment_target = "7.0" 11 | s.source = { :git => "https://github.com/DeveloperLx/LxNavigationController.git", :tag => s.version} 12 | s.source_files = 'LxNavigationController/LxNavigationController.*' 13 | s.requires_arc = true 14 | s.frameworks = 'Foundation', 'UIKit' 15 | end 16 | -------------------------------------------------------------------------------- /LxNavigationController/LxNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DeveloperLx 3 | // LxNavigationController.h 4 | // 5 | 6 | #import 7 | 8 | typedef NS_ENUM(NSInteger, LxNavigationControllerInteractionStopReason) { 9 | LxNavigationControllerInteractionStopReasonFinished, 10 | LxNavigationControllerInteractionStopReasonCancelled, 11 | LxNavigationControllerInteractionStopReasonFailed, 12 | }; 13 | 14 | @interface LxNavigationController : UINavigationController 15 | 16 | @property (nonatomic,assign) BOOL popGestureRecognizerEnable; 17 | @property (nonatomic,assign) BOOL recognizeOtherGestureSimultaneously; 18 | @property (nonatomic,readonly) BOOL isTranslating; 19 | @property (nonatomic,copy) void (^popGestureRecognizerBeginBlock)(); 20 | @property (nonatomic,copy) void (^popGestureRecognizerStopBlock)(LxNavigationControllerInteractionStopReason stopReason); 21 | 22 | @property (nonatomic,readonly) UINavigationController * rootViewController; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /LxNavigationController/LxNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DeveloperLx 3 | // LxNavigationController.m 4 | // 5 | 6 | #import "LxNavigationController.h" 7 | 8 | static NSTimeInterval const POP_ANIMATION_DURATION = 0.2; 9 | static CGFloat const MIN_VALID_PROPORTION = 0.42; 10 | 11 | @interface PopTransition : NSObject 12 | 13 | @end 14 | 15 | @implementation PopTransition 16 | 17 | - (NSTimeInterval)transitionDuration:(id)transitionContext 18 | { 19 | return POP_ANIMATION_DURATION; 20 | } 21 | 22 | - (void)animateTransition:(id)transitionContext 23 | { 24 | UIViewController * fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 25 | UIViewController * toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 26 | 27 | [transitionContext.containerView insertSubview:toViewController.view belowSubview:fromViewController.view]; 28 | 29 | CGRect toViewControllerViewFrame = toViewController.view.frame; 30 | toViewControllerViewFrame.origin.x = -toViewControllerViewFrame.size.width/2; 31 | toViewController.view.frame = toViewControllerViewFrame; 32 | toViewControllerViewFrame.origin.x = 0; 33 | 34 | toViewController.view.alpha = fromViewController.view.alpha - 0.2; 35 | 36 | [UIView animateWithDuration:POP_ANIMATION_DURATION animations:^{ 37 | fromViewController.view.frame = CGRectMake(fromViewController.view.frame.size.width, fromViewController.view.frame.origin.y, fromViewController.view.frame.size.width, fromViewController.view.frame.size.height); 38 | toViewController.view.frame = toViewControllerViewFrame; 39 | toViewController.view.alpha = 1; 40 | } completion:^(BOOL finished) { 41 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; 42 | }]; 43 | } 44 | 45 | @end 46 | 47 | 48 | #pragma mark - LxNavigationController 49 | 50 | @interface LxNavigationController () 51 | 52 | @end 53 | 54 | @implementation LxNavigationController 55 | { 56 | UIPanGestureRecognizer * _popGestureRecognizer; 57 | UIPercentDrivenInteractiveTransition * _interactivePopTransition; 58 | } 59 | @synthesize isTranslating = _isTranslating; 60 | 61 | - (instancetype)init 62 | { 63 | if (self = [super init]) { 64 | [self setup]; 65 | } 66 | return self; 67 | } 68 | 69 | - (instancetype)initWithCoder:(NSCoder *)aDecoder 70 | { 71 | if (self = [super initWithCoder:aDecoder]) { 72 | [self setup]; 73 | } 74 | return self; 75 | } 76 | 77 | - (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClass 78 | { 79 | if (self = [super initWithNavigationBarClass:navigationBarClass toolbarClass:toolbarClass]) { 80 | [self setup]; 81 | } 82 | return self; 83 | } 84 | 85 | - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 86 | { 87 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 88 | [self setup]; 89 | } 90 | return self; 91 | } 92 | 93 | - (void)setup 94 | { 95 | self.delegate = self; 96 | 97 | self.interactivePopGestureRecognizer.enabled = NO; 98 | _popGestureRecognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(popGestureRecognizerTriggerd:)]; 99 | _popGestureRecognizer.delegate = self; 100 | _popGestureRecognizer.cancelsTouchesInView = NO; 101 | _popGestureRecognizer.maximumNumberOfTouches = 1; 102 | [self.interactivePopGestureRecognizer.view addGestureRecognizer:_popGestureRecognizer]; 103 | } 104 | 105 | #pragma mark - UINavigationControllerDelegate 106 | 107 | - (id)navigationController:(UINavigationController *)navigationController 108 | interactionControllerForAnimationController:(id)animationController 109 | { 110 | if ([animationController isKindOfClass:[PopTransition class]]) { 111 | return _interactivePopTransition; 112 | } 113 | else { 114 | return nil; 115 | } 116 | } 117 | 118 | - (id)navigationController:(UINavigationController *)navigationController 119 | animationControllerForOperation:(UINavigationControllerOperation)operation 120 | fromViewController:(UIViewController *)fromVC 121 | toViewController:(UIViewController *)toVC 122 | { 123 | if (operation == UINavigationControllerOperationPop) { 124 | return [[PopTransition alloc]init]; 125 | } 126 | else { 127 | return nil; 128 | } 129 | } 130 | 131 | #pragma mark - gesture 132 | 133 | - (void)setPopGestureRecognizerEnable:(BOOL)popGestureRecognizerEnable 134 | { 135 | _popGestureRecognizer.enabled = popGestureRecognizerEnable; 136 | } 137 | 138 | - (BOOL)popGestureRecognizerEnable 139 | { 140 | return _popGestureRecognizer.enabled; 141 | } 142 | 143 | - (void)popGestureRecognizerTriggerd:(UIPanGestureRecognizer *)popPan 144 | { 145 | CGFloat progress = [popPan translationInView:popPan.view].x / popPan.view.bounds.size.width; 146 | 147 | progress = MIN(1.0, MAX(0.0, progress)); 148 | 149 | switch (popPan.state) { 150 | case UIGestureRecognizerStateBegan: 151 | { 152 | _isTranslating = YES; 153 | _interactivePopTransition = [[UIPercentDrivenInteractiveTransition alloc]init]; 154 | [self popViewControllerAnimated:YES]; 155 | if (self.popGestureRecognizerBeginBlock) { 156 | self.popGestureRecognizerBeginBlock(); 157 | } 158 | } 159 | break; 160 | case UIGestureRecognizerStateChanged: 161 | { 162 | [_interactivePopTransition updateInteractiveTransition:progress]; 163 | } 164 | break; 165 | case UIGestureRecognizerStateFailed: 166 | { 167 | _isTranslating = NO; 168 | if (self.popGestureRecognizerStopBlock) { 169 | self.popGestureRecognizerStopBlock(LxNavigationControllerInteractionStopReasonFailed); 170 | } 171 | } 172 | break; 173 | default: 174 | { 175 | if (progress > MIN_VALID_PROPORTION) { 176 | [_interactivePopTransition finishInteractiveTransition]; 177 | if (self.popGestureRecognizerStopBlock) { 178 | self.popGestureRecognizerStopBlock(LxNavigationControllerInteractionStopReasonFinished); 179 | } 180 | } 181 | else { 182 | [_interactivePopTransition cancelInteractiveTransition]; 183 | if (self.popGestureRecognizerStopBlock) { 184 | self.popGestureRecognizerStopBlock(LxNavigationControllerInteractionStopReasonCancelled); 185 | } 186 | } 187 | _interactivePopTransition = nil; 188 | _isTranslating = NO; 189 | } 190 | break; 191 | } 192 | } 193 | 194 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer 195 | { 196 | if (gestureRecognizer == _popGestureRecognizer) { 197 | CGPoint location = [gestureRecognizer locationInView:gestureRecognizer.view]; 198 | CGFloat translationX = [(UIPanGestureRecognizer *)gestureRecognizer translationInView:gestureRecognizer.view].x; 199 | if (location.x > gestureRecognizer.view.frame.size.width * MIN_VALID_PROPORTION || translationX < 0 || self.viewControllers.count < 2) { 200 | return NO; 201 | } 202 | else { 203 | return YES; 204 | } 205 | } 206 | else { 207 | return YES; 208 | } 209 | } 210 | 211 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer 212 | { 213 | if (gestureRecognizer == _popGestureRecognizer || otherGestureRecognizer == _popGestureRecognizer) { 214 | return self.recognizeOtherGestureSimultaneously; 215 | } 216 | else { 217 | return NO; 218 | } 219 | } 220 | 221 | #pragma mark - 222 | 223 | - (BOOL)isTranslating 224 | { 225 | return _isTranslating; 226 | } 227 | 228 | - (UIViewController *)rootViewController 229 | { 230 | return self.viewControllers.firstObject; 231 | } 232 | 233 | @end 234 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BFA8135C1ACE59E2004151D7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BFA8135B1ACE59E2004151D7 /* main.m */; }; 11 | BFA8135F1ACE59E2004151D7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BFA8135E1ACE59E2004151D7 /* AppDelegate.m */; }; 12 | BFA813621ACE59E2004151D7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BFA813611ACE59E2004151D7 /* ViewController.m */; }; 13 | BFA813651ACE59E2004151D7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFA813631ACE59E2004151D7 /* Main.storyboard */; }; 14 | BFA813671ACE59E2004151D7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BFA813661ACE59E2004151D7 /* Images.xcassets */; }; 15 | BFA8136A1ACE59E2004151D7 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = BFA813681ACE59E2004151D7 /* LaunchScreen.xib */; }; 16 | BFA813811ACE5A48004151D7 /* LxNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = BFA813801ACE5A48004151D7 /* LxNavigationController.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | BFA813561ACE59E2004151D7 /* LxNavigationControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LxNavigationControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | BFA8135A1ACE59E2004151D7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 22 | BFA8135B1ACE59E2004151D7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | BFA8135D1ACE59E2004151D7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | BFA8135E1ACE59E2004151D7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | BFA813601ACE59E2004151D7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | BFA813611ACE59E2004151D7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | BFA813641ACE59E2004151D7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | BFA813661ACE59E2004151D7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 29 | BFA813691ACE59E2004151D7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 30 | BFA8137F1ACE5A48004151D7 /* LxNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LxNavigationController.h; path = ../../LxNavigationController/LxNavigationController.h; sourceTree = ""; }; 31 | BFA813801ACE5A48004151D7 /* LxNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LxNavigationController.m; path = ../../LxNavigationController/LxNavigationController.m; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | BFA813531ACE59E2004151D7 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | BFA8134D1ACE59E2004151D7 = { 46 | isa = PBXGroup; 47 | children = ( 48 | BFA813581ACE59E2004151D7 /* LxNavigationControllerDemo */, 49 | BFA813571ACE59E2004151D7 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | BFA813571ACE59E2004151D7 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | BFA813561ACE59E2004151D7 /* LxNavigationControllerDemo.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | BFA813581ACE59E2004151D7 /* LxNavigationControllerDemo */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | BFA813821ACE5A4F004151D7 /* LxNavigationController */, 65 | BFA8135D1ACE59E2004151D7 /* AppDelegate.h */, 66 | BFA8135E1ACE59E2004151D7 /* AppDelegate.m */, 67 | BFA813601ACE59E2004151D7 /* ViewController.h */, 68 | BFA813611ACE59E2004151D7 /* ViewController.m */, 69 | BFA813591ACE59E2004151D7 /* Supporting Files */, 70 | ); 71 | path = LxNavigationControllerDemo; 72 | sourceTree = ""; 73 | }; 74 | BFA813591ACE59E2004151D7 /* Supporting Files */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | BFA813681ACE59E2004151D7 /* LaunchScreen.xib */, 78 | BFA813631ACE59E2004151D7 /* Main.storyboard */, 79 | BFA813661ACE59E2004151D7 /* Images.xcassets */, 80 | BFA8135A1ACE59E2004151D7 /* Info.plist */, 81 | BFA8135B1ACE59E2004151D7 /* main.m */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | BFA813821ACE5A4F004151D7 /* LxNavigationController */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | BFA8137F1ACE5A48004151D7 /* LxNavigationController.h */, 90 | BFA813801ACE5A48004151D7 /* LxNavigationController.m */, 91 | ); 92 | name = LxNavigationController; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | BFA813551ACE59E2004151D7 /* LxNavigationControllerDemo */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = BFA813791ACE59E2004151D7 /* Build configuration list for PBXNativeTarget "LxNavigationControllerDemo" */; 101 | buildPhases = ( 102 | BFA813521ACE59E2004151D7 /* Sources */, 103 | BFA813531ACE59E2004151D7 /* Frameworks */, 104 | BFA813541ACE59E2004151D7 /* Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = LxNavigationControllerDemo; 111 | productName = LxNavigationControllerDemo; 112 | productReference = BFA813561ACE59E2004151D7 /* LxNavigationControllerDemo.app */; 113 | productType = "com.apple.product-type.application"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | BFA8134E1ACE59E2004151D7 /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastUpgradeCheck = 0620; 122 | ORGANIZATIONNAME = etiantian; 123 | TargetAttributes = { 124 | BFA813551ACE59E2004151D7 = { 125 | CreatedOnToolsVersion = 6.2; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = BFA813511ACE59E2004151D7 /* Build configuration list for PBXProject "LxNavigationControllerDemo" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | Base, 136 | ); 137 | mainGroup = BFA8134D1ACE59E2004151D7; 138 | productRefGroup = BFA813571ACE59E2004151D7 /* Products */; 139 | projectDirPath = ""; 140 | projectRoot = ""; 141 | targets = ( 142 | BFA813551ACE59E2004151D7 /* LxNavigationControllerDemo */, 143 | ); 144 | }; 145 | /* End PBXProject section */ 146 | 147 | /* Begin PBXResourcesBuildPhase section */ 148 | BFA813541ACE59E2004151D7 /* Resources */ = { 149 | isa = PBXResourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | BFA813651ACE59E2004151D7 /* Main.storyboard in Resources */, 153 | BFA8136A1ACE59E2004151D7 /* LaunchScreen.xib in Resources */, 154 | BFA813671ACE59E2004151D7 /* Images.xcassets in Resources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXResourcesBuildPhase section */ 159 | 160 | /* Begin PBXSourcesBuildPhase section */ 161 | BFA813521ACE59E2004151D7 /* Sources */ = { 162 | isa = PBXSourcesBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | BFA813621ACE59E2004151D7 /* ViewController.m in Sources */, 166 | BFA8135F1ACE59E2004151D7 /* AppDelegate.m in Sources */, 167 | BFA8135C1ACE59E2004151D7 /* main.m in Sources */, 168 | BFA813811ACE5A48004151D7 /* LxNavigationController.m in Sources */, 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | }; 172 | /* End PBXSourcesBuildPhase section */ 173 | 174 | /* Begin PBXVariantGroup section */ 175 | BFA813631ACE59E2004151D7 /* Main.storyboard */ = { 176 | isa = PBXVariantGroup; 177 | children = ( 178 | BFA813641ACE59E2004151D7 /* Base */, 179 | ); 180 | name = Main.storyboard; 181 | sourceTree = ""; 182 | }; 183 | BFA813681ACE59E2004151D7 /* LaunchScreen.xib */ = { 184 | isa = PBXVariantGroup; 185 | children = ( 186 | BFA813691ACE59E2004151D7 /* Base */, 187 | ); 188 | name = LaunchScreen.xib; 189 | sourceTree = ""; 190 | }; 191 | /* End PBXVariantGroup section */ 192 | 193 | /* Begin XCBuildConfiguration section */ 194 | BFA813771ACE59E2004151D7 /* Debug */ = { 195 | isa = XCBuildConfiguration; 196 | buildSettings = { 197 | ALWAYS_SEARCH_USER_PATHS = NO; 198 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 199 | CLANG_CXX_LIBRARY = "libc++"; 200 | CLANG_ENABLE_MODULES = YES; 201 | CLANG_ENABLE_OBJC_ARC = YES; 202 | CLANG_WARN_BOOL_CONVERSION = YES; 203 | CLANG_WARN_CONSTANT_CONVERSION = YES; 204 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 205 | CLANG_WARN_EMPTY_BODY = YES; 206 | CLANG_WARN_ENUM_CONVERSION = YES; 207 | CLANG_WARN_INT_CONVERSION = YES; 208 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 209 | CLANG_WARN_UNREACHABLE_CODE = YES; 210 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 211 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 212 | COPY_PHASE_STRIP = NO; 213 | ENABLE_STRICT_OBJC_MSGSEND = YES; 214 | GCC_C_LANGUAGE_STANDARD = gnu99; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_OPTIMIZATION_LEVEL = 0; 217 | GCC_PREPROCESSOR_DEFINITIONS = ( 218 | "DEBUG=1", 219 | "$(inherited)", 220 | ); 221 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 224 | GCC_WARN_UNDECLARED_SELECTOR = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 226 | GCC_WARN_UNUSED_FUNCTION = YES; 227 | GCC_WARN_UNUSED_VARIABLE = YES; 228 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 229 | MTL_ENABLE_DEBUG_INFO = YES; 230 | ONLY_ACTIVE_ARCH = YES; 231 | SDKROOT = iphoneos; 232 | TARGETED_DEVICE_FAMILY = "1,2"; 233 | }; 234 | name = Debug; 235 | }; 236 | BFA813781ACE59E2004151D7 /* Release */ = { 237 | isa = XCBuildConfiguration; 238 | buildSettings = { 239 | ALWAYS_SEARCH_USER_PATHS = NO; 240 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 241 | CLANG_CXX_LIBRARY = "libc++"; 242 | CLANG_ENABLE_MODULES = YES; 243 | CLANG_ENABLE_OBJC_ARC = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_CONSTANT_CONVERSION = YES; 246 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 247 | CLANG_WARN_EMPTY_BODY = YES; 248 | CLANG_WARN_ENUM_CONVERSION = YES; 249 | CLANG_WARN_INT_CONVERSION = YES; 250 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 251 | CLANG_WARN_UNREACHABLE_CODE = YES; 252 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 253 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 254 | COPY_PHASE_STRIP = NO; 255 | ENABLE_NS_ASSERTIONS = NO; 256 | ENABLE_STRICT_OBJC_MSGSEND = YES; 257 | GCC_C_LANGUAGE_STANDARD = gnu99; 258 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 259 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 260 | GCC_WARN_UNDECLARED_SELECTOR = YES; 261 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 262 | GCC_WARN_UNUSED_FUNCTION = YES; 263 | GCC_WARN_UNUSED_VARIABLE = YES; 264 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 265 | MTL_ENABLE_DEBUG_INFO = NO; 266 | SDKROOT = iphoneos; 267 | TARGETED_DEVICE_FAMILY = "1,2"; 268 | VALIDATE_PRODUCT = YES; 269 | }; 270 | name = Release; 271 | }; 272 | BFA8137A1ACE59E2004151D7 /* Debug */ = { 273 | isa = XCBuildConfiguration; 274 | buildSettings = { 275 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 276 | INFOPLIST_FILE = LxNavigationControllerDemo/Info.plist; 277 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 278 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 279 | PRODUCT_NAME = "$(TARGET_NAME)"; 280 | }; 281 | name = Debug; 282 | }; 283 | BFA8137B1ACE59E2004151D7 /* Release */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 287 | INFOPLIST_FILE = LxNavigationControllerDemo/Info.plist; 288 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 289 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | }; 292 | name = Release; 293 | }; 294 | /* End XCBuildConfiguration section */ 295 | 296 | /* Begin XCConfigurationList section */ 297 | BFA813511ACE59E2004151D7 /* Build configuration list for PBXProject "LxNavigationControllerDemo" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | BFA813771ACE59E2004151D7 /* Debug */, 301 | BFA813781ACE59E2004151D7 /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | defaultConfigurationName = Release; 305 | }; 306 | BFA813791ACE59E2004151D7 /* Build configuration list for PBXNativeTarget "LxNavigationControllerDemo" */ = { 307 | isa = XCConfigurationList; 308 | buildConfigurations = ( 309 | BFA8137A1ACE59E2004151D7 /* Debug */, 310 | BFA8137B1ACE59E2004151D7 /* Release */, 311 | ); 312 | defaultConfigurationIsVisible = 0; 313 | defaultConfigurationName = Release; 314 | }; 315 | /* End XCConfigurationList section */ 316 | }; 317 | rootObject = BFA8134E1ACE59E2004151D7 /* Project object */; 318 | } 319 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // DeveloperLx 3 | // 4 | 5 | #import 6 | 7 | @interface AppDelegate : UIResponder 8 | 9 | @property (strong, nonatomic) UIWindow *window; 10 | 11 | 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // DeveloperLx 3 | // 4 | 5 | #import "AppDelegate.h" 6 | #import "ViewController.h" 7 | #import "LxNavigationController.h" 8 | 9 | @interface AppDelegate () 10 | 11 | @end 12 | 13 | @implementation AppDelegate 14 | 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 17 | 18 | ViewController * vc = [[ViewController alloc]init]; 19 | LxNavigationController * nc = [[LxNavigationController alloc]initWithRootViewController:vc]; 20 | self.window.rootViewController = nc; 21 | 22 | return YES; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/Base.lproj/Main.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 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/Images.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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.etiantian.$(PRODUCT_NAME:rfc1034identifier) 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 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DeveloperLx 3 | // 4 | 5 | #import 6 | 7 | @interface ViewController : UIViewController 8 | 9 | 10 | @end 11 | 12 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DeveloperLx 3 | // 4 | 5 | #import "ViewController.h" 6 | 7 | @interface ViewController () 8 | 9 | @end 10 | 11 | @implementation ViewController 12 | 13 | - (void)viewDidLoad { 14 | [super viewDidLoad]; 15 | 16 | self.edgesForExtendedLayout = UIRectEdgeNone; 17 | self.title = @"LxNavigationController"; 18 | self.view.backgroundColor = [UIColor colorWithRed:arc4random()%256/255.0 green:arc4random()%256/255.0 blue:arc4random()%256/255.0 alpha:1]; 19 | 20 | UIButton * pushButton = [UIButton buttonWithType:UIButtonTypeCustom]; 21 | pushButton.backgroundColor = [UIColor whiteColor]; 22 | [pushButton setTitle:@"Push" forState:UIControlStateNormal]; 23 | [pushButton setTitleColor:self.view.backgroundColor forState:UIControlStateNormal]; 24 | [pushButton addTarget:self action:@selector(pushButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; 25 | [self.view addSubview:pushButton]; 26 | 27 | pushButton.translatesAutoresizingMaskIntoConstraints = NO; 28 | 29 | NSArray * pushButtonConstraintsH = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-30-[pushButton]-30-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(pushButton)]; 30 | NSArray * pushButtonConstraintsV = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-90-[pushButton(==48)]" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(pushButton)]; 31 | 32 | [self.view addConstraints:pushButtonConstraintsH]; 33 | [self.view addConstraints:pushButtonConstraintsV]; 34 | } 35 | 36 | - (void)pushButtonClicked:(UIButton *)btn 37 | { 38 | ViewController * vc = [[ViewController alloc]init]; 39 | [self.navigationController pushViewController:vc animated:YES]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /LxNavigationControllerDemo/LxNavigationControllerDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LxNavigationControllerDemo 4 | // 5 | // Created by Jin on 15-4-3. 6 | // Copyright (c) 2015年 etiantian. 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LxNavigationController 2 | A convenient navigationController inherited from UINavigationController. LxNavigationController add a powerful gesture you can pop view controller only if you sweep the screen from left the right. 3 | 4 | * ![demo](demo.gif) 5 | 6 | Installation 7 | ------------ 8 | You only need drag LxNavigationController.h and LxNavigationController.m to your project. 9 | Podfile 10 | ------------ 11 | pod 'LxNavigationController', '~> 1.0.0' 12 | Support 13 | ------------ 14 | Minimum support iOS version: iOS 7.0 15 | Usage 16 | ---------- 17 | LxNavigationController * nc = [[LxNavigationController alloc]initWithRootViewController:YOUR_VIEW_CONTROLLER]; 18 | ...... 19 | [nc pushViewController:NEW_VIEW_CONTROLLER]; 20 | ...... 21 | License 22 | ----------- 23 | LxNavigationController is available under the Apache License 2.0. See the LICENSE file for more info. 24 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeveloperLx/LxNavigationController/78839562f6b48d477523746aadb18b5f795bbc65/demo.gif --------------------------------------------------------------------------------