├── BLLandscapeDemo ├── BLLandscape │ ├── BLSubstituteObject.h │ ├── BLSubstituteObject.m │ ├── UIView+BLLandscape.h │ ├── UIView+BLLandscape.m │ ├── UIViewController+Landscape.h │ └── UIViewController+Landscape.m ├── BLLandscapeDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── NewPan.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── NewPan.xcuserdatad │ │ └── xcschemes │ │ ├── BLLandscapeDemo.xcscheme │ │ └── xcschememanagement.plist ├── BLLandscapeDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── NewPan.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── BLLandscapeDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── BLAnotherWindowViewController.h │ ├── BLAnotherWindowViewController.m │ ├── BLHomeViewController.h │ ├── BLHomeViewController.m │ ├── BLPlayViewController.h │ ├── BLPlayViewController.m │ ├── BLRecordViewController.h │ ├── BLRecordViewController.m │ ├── BLRootViewController.h │ ├── BLRootViewController.m │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── Info.plist │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Headers │ ├── Private │ │ ├── JPNavigationController │ │ │ ├── JPBaseAnimationTransition.h │ │ │ ├── JPNavigationBar.h │ │ │ ├── JPNavigationController.h │ │ │ ├── JPNavigationControllerCompat.h │ │ │ ├── JPNavigationControllerGestureRecognizer.h │ │ │ ├── JPNavigationControllerKit.h │ │ │ ├── JPNavigationControllerProtocol.h │ │ │ ├── JPNavigationControllerTransition.h │ │ │ ├── JPPushAnimationTransition.h │ │ │ ├── JPTransitionShadowView.h │ │ │ ├── JPWarpNavigationController.h │ │ │ ├── JPWarpViewController.h │ │ │ ├── UIColor+ImageGenerate.h │ │ │ ├── UINavigationController+FulllScreenPopPush.h │ │ │ ├── UIView+ScreenCapture.h │ │ │ └── UIViewController+ViewControllers.h │ │ └── JRSwizzle │ │ │ └── JRSwizzle.h │ └── Public │ │ ├── JPNavigationController │ │ ├── JPBaseAnimationTransition.h │ │ ├── JPNavigationBar.h │ │ ├── JPNavigationController.h │ │ ├── JPNavigationControllerCompat.h │ │ ├── JPNavigationControllerGestureRecognizer.h │ │ ├── JPNavigationControllerKit.h │ │ ├── JPNavigationControllerProtocol.h │ │ ├── JPNavigationControllerTransition.h │ │ ├── JPPushAnimationTransition.h │ │ ├── JPTransitionShadowView.h │ │ ├── JPWarpNavigationController.h │ │ ├── JPWarpViewController.h │ │ ├── UIColor+ImageGenerate.h │ │ ├── UINavigationController+FulllScreenPopPush.h │ │ ├── UIView+ScreenCapture.h │ │ └── UIViewController+ViewControllers.h │ │ └── JRSwizzle │ │ └── JRSwizzle.h │ ├── JPNavigationController │ ├── JPNavigationController │ │ ├── JPBaseAnimationTransition.h │ │ ├── JPBaseAnimationTransition.m │ │ ├── JPNavigationBar.h │ │ ├── JPNavigationBar.m │ │ ├── JPNavigationController.bundle │ │ │ ├── backImage@2x.png │ │ │ ├── backImage@3x.png │ │ │ ├── shadow@2x.png │ │ │ └── shadow@3x.png │ │ ├── JPNavigationController.h │ │ ├── JPNavigationController.m │ │ ├── JPNavigationControllerCompat.h │ │ ├── JPNavigationControllerGestureRecognizer.h │ │ ├── JPNavigationControllerGestureRecognizer.m │ │ ├── JPNavigationControllerKit.h │ │ ├── JPNavigationControllerProtocol.h │ │ ├── JPNavigationControllerTransition.h │ │ ├── JPNavigationControllerTransition.m │ │ ├── JPPushAnimationTransition.h │ │ ├── JPPushAnimationTransition.m │ │ ├── JPTransitionShadowView.h │ │ ├── JPTransitionShadowView.m │ │ ├── JPWarpNavigationController.h │ │ ├── JPWarpNavigationController.m │ │ ├── JPWarpViewController.h │ │ ├── JPWarpViewController.m │ │ ├── UIColor+ImageGenerate.h │ │ ├── UIColor+ImageGenerate.m │ │ ├── UINavigationController+FulllScreenPopPush.h │ │ ├── UIView+ScreenCapture.h │ │ ├── UIView+ScreenCapture.m │ │ ├── UIViewController+ViewControllers.h │ │ └── UIViewController+ViewControllers.m │ ├── LICENSE │ └── README.md │ ├── JRSwizzle │ ├── JRSwizzle.h │ ├── JRSwizzle.m │ └── README.markdown │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── NewPan.xcuserdatad │ │ └── xcschemes │ │ ├── JPNavigationController.xcscheme │ │ ├── JRSwizzle.xcscheme │ │ ├── Pods-BLLandscapeDemo.xcscheme │ │ └── xcschememanagement.plist │ └── Target Support Files │ ├── JPNavigationController │ ├── JPNavigationController-dummy.m │ ├── JPNavigationController-prefix.pch │ └── JPNavigationController.xcconfig │ ├── JRSwizzle │ ├── JRSwizzle-dummy.m │ ├── JRSwizzle-prefix.pch │ └── JRSwizzle.xcconfig │ └── Pods-BLLandscapeDemo │ ├── Pods-BLLandscapeDemo-acknowledgements.markdown │ ├── Pods-BLLandscapeDemo-acknowledgements.plist │ ├── Pods-BLLandscapeDemo-dummy.m │ ├── Pods-BLLandscapeDemo-frameworks.sh │ ├── Pods-BLLandscapeDemo-resources.sh │ ├── Pods-BLLandscapeDemo.debug.xcconfig │ └── Pods-BLLandscapeDemo.release.xcconfig └── README.md /BLLandscapeDemo/BLLandscape/BLSubstituteObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface BLSubstituteObject : NSObject 15 | 16 | /** 17 | * 要引用的对象. 18 | */ 19 | @property(nonatomic, weak) id anyObject; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscape/BLSubstituteObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "BLSubstituteObject.h" 13 | 14 | @implementation BLSubstituteObject 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscape/UIView+BLLandscape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | // 横竖屏动画执行完的回调. 15 | typedef void(^BLScreenEventsComplete)(void); 16 | // 横竖屏动画执行的回调. 17 | typedef void(^BLScreenEventsAnimations)(void); 18 | 19 | @interface UIView (BLLandscape) 20 | 21 | typedef NS_ENUM(NSInteger, BLLandscapeViewStatus) { 22 | BLLandscapeViewStatusPortrait = 0, 23 | BLLandscapeViewStatusLandscape, 24 | BLLandscapeViewStatusAnimating 25 | }; 26 | 27 | /** 28 | * 横竖屏状态. 29 | */ 30 | @property(nonatomic, readonly) BLLandscapeViewStatus viewStatus; 31 | 32 | /** 33 | * 横屏. 34 | * @watchout : 当前界面会被添加到窗口 Window 上. 35 | * 36 | * @param animated 是否需要动画. 37 | * @param animations 横屏动画执行过程中需要额外添加的动画代码. 38 | * @param complete 横屏动画执行完的回调. 39 | */ 40 | - (void)bl_landscapeAnimated:(BOOL)animated animations:(BLScreenEventsAnimations)animations complete:(BLScreenEventsComplete)complete; 41 | 42 | /** 43 | * 竖屏. 44 | * 45 | * @param animated 是否需要动画. 46 | * @param animations 竖屏动画执行过程中需要额外添加的动画代码. 47 | * @param complete 竖屏动画执行完的回调. 48 | */ 49 | - (void)bl_protraitAnimated:(BOOL)animated animations:(BLScreenEventsAnimations)animations complete:(BLScreenEventsComplete)complete; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscape/UIView+BLLandscape.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "UIView+BLLandscape.h" 13 | #import "BLSubstituteObject.h" 14 | #import 15 | 16 | @interface UIView () 17 | 18 | /** 19 | * 横竖屏状态. 20 | */ 21 | @property(nonatomic) BLLandscapeViewStatus viewStatus; 22 | 23 | /** 24 | * Frame of self before enter full screen. 25 | */ 26 | @property(nonatomic)NSValue *frame_beforeFullScreen; 27 | 28 | /** 29 | * 动画之前 self 在 superview 的索引. 30 | */ 31 | @property(nonatomic) NSInteger indexBeforeAnimation; 32 | 33 | @end 34 | 35 | @implementation UIView (BLLandscape) 36 | 37 | - (void)bl_landscapeAnimated:(BOOL)animated animations:(BLScreenEventsAnimations)animations complete:(BLScreenEventsComplete)complete{ 38 | if (self.viewStatus != BLLandscapeViewStatusPortrait) { 39 | return; 40 | } 41 | 42 | self.viewStatus = BLLandscapeViewStatusAnimating; 43 | 44 | self.parentViewBeforeFullScreenSubstitute.anyObject = self.superview; 45 | self.frame_beforeFullScreen = [NSValue valueWithCGRect:self.frame]; 46 | NSArray *subviews = self.superview.subviews; 47 | if (subviews.count == 1) { 48 | self.indexBeforeAnimation = 0; 49 | } 50 | else{ 51 | for (int i = 0; i < subviews.count; i++) { 52 | id object = subviews[i]; 53 | if (object == self) { 54 | self.indexBeforeAnimation = i; 55 | break; 56 | } 57 | } 58 | } 59 | 60 | CGRect rectInWindow = [self.superview convertRect:self.frame toView:nil]; 61 | [self removeFromSuperview]; 62 | self.frame = rectInWindow; 63 | [[UIApplication sharedApplication].keyWindow addSubview:self]; 64 | 65 | if (animated) { 66 | [UIView animateWithDuration:0.35 animations:^{ 67 | 68 | [self landscapeExecute]; 69 | if (animations) { 70 | animations(); 71 | } 72 | 73 | } completion:^(BOOL finished) { 74 | 75 | [self landscpeFinishedComplete:complete]; 76 | 77 | }]; 78 | } 79 | else{ 80 | [self landscapeExecute]; 81 | [self landscpeFinishedComplete:complete]; 82 | } 83 | 84 | self.viewStatus = BLLandscapeViewStatusLandscape; 85 | [self refreshStatusBarOrientation:UIInterfaceOrientationLandscapeRight]; 86 | } 87 | 88 | - (void)bl_protraitAnimated:(BOOL)animated animations:(BLScreenEventsAnimations)animations complete:(BLScreenEventsComplete)complete{ 89 | if (self.viewStatus != BLLandscapeViewStatusLandscape) { 90 | return; 91 | } 92 | 93 | self.viewStatus = BLLandscapeViewStatusAnimating; 94 | 95 | if (animated) { 96 | [UIView animateWithDuration:0.35 animations:^{ 97 | 98 | [self portraitExecute]; 99 | if (animations) { 100 | animations(); 101 | } 102 | 103 | } completion:^(BOOL finished) { 104 | 105 | [self portraitFinishedComplete:complete]; 106 | 107 | }]; 108 | } 109 | else{ 110 | [self portraitExecute]; 111 | [self portraitFinishedComplete:complete]; 112 | } 113 | 114 | self.viewStatus = BLLandscapeViewStatusPortrait; 115 | [self refreshStatusBarOrientation:UIInterfaceOrientationPortrait]; 116 | } 117 | 118 | 119 | #pragma mark - Private 120 | 121 | - (void)portraitFinishedComplete:(BLScreenEventsComplete)complete{ 122 | [self removeFromSuperview]; 123 | self.frame = [self.frame_beforeFullScreen CGRectValue]; 124 | if (self.parentViewBeforeFullScreenSubstitute.anyObject) { 125 | [(UIView *)self.parentViewBeforeFullScreenSubstitute.anyObject insertSubview:self atIndex:self.indexBeforeAnimation]; 126 | } 127 | 128 | if (complete) { 129 | complete(); 130 | } 131 | } 132 | 133 | - (void)portraitExecute{ 134 | CGRect frame = [self.parentViewBeforeFullScreenSubstitute.anyObject convertRect:[self.frame_beforeFullScreen CGRectValue] toView:nil]; 135 | self.transform = CGAffineTransformIdentity; 136 | self.frame = frame; 137 | } 138 | 139 | - (void)landscpeFinishedComplete:(BLScreenEventsComplete)complete{ 140 | if (complete) { 141 | complete(); 142 | } 143 | } 144 | 145 | - (void)landscapeExecute{ 146 | self.transform = CGAffineTransformMakeRotation(M_PI_2); 147 | CGRect bounds = CGRectMake(0, 0, CGRectGetHeight(self.superview.bounds), CGRectGetWidth(self.superview.bounds)); 148 | CGPoint center = CGPointMake(CGRectGetMidX(self.superview.bounds), CGRectGetMidY(self.superview.bounds)); 149 | self.bounds = bounds; 150 | self.center = center; 151 | } 152 | 153 | -(void)refreshStatusBarOrientation:(UIInterfaceOrientation)interfaceOrientation { 154 | #pragma clang diagnostic push 155 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 156 | [[UIApplication sharedApplication] setStatusBarOrientation:interfaceOrientation animated:YES]; 157 | #pragma clang diagnostic pop 158 | } 159 | 160 | -(void)setViewStatus:(BLLandscapeViewStatus)viewStatus{ 161 | objc_setAssociatedObject(self, @selector(viewStatus), @(viewStatus), OBJC_ASSOCIATION_ASSIGN); 162 | } 163 | 164 | -(BLLandscapeViewStatus)viewStatus{ 165 | return [objc_getAssociatedObject(self, _cmd) integerValue]; 166 | } 167 | 168 | - (BLSubstituteObject *)parentViewBeforeFullScreenSubstitute{ 169 | BLSubstituteObject *object = objc_getAssociatedObject(self, _cmd); 170 | if (!object) { 171 | object = [BLSubstituteObject new]; 172 | objc_setAssociatedObject(self, _cmd, object, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 173 | } 174 | return object; 175 | } 176 | 177 | -(void)setFrame_beforeFullScreen:(NSValue *)frame_beforeFullScreen{ 178 | objc_setAssociatedObject(self, @selector(frame_beforeFullScreen), frame_beforeFullScreen, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 179 | } 180 | 181 | -(NSValue *)frame_beforeFullScreen{ 182 | return objc_getAssociatedObject(self, _cmd); 183 | } 184 | 185 | - (void)setIndexBeforeAnimation:(NSInteger)indexBeforeAnimation{ 186 | objc_setAssociatedObject(self, @selector(indexBeforeAnimation), @(indexBeforeAnimation), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 187 | } 188 | 189 | - (NSInteger)indexBeforeAnimation{ 190 | return [objc_getAssociatedObject(self, _cmd) integerValue]; 191 | } 192 | 193 | @end 194 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscape/UIViewController+Landscape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface UIViewController (Landscape) 15 | 16 | /** 17 | * 是否需要横屏(默认 NO, 即当前 viewController 不支持横屏). 18 | */ 19 | @property(nonatomic) BOOL bl_shouldAutoLandscape; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscape/UIViewController+Landscape.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "UIViewController+Landscape.h" 13 | #import 14 | #import 15 | 16 | @implementation UIViewController (Landscape) 17 | 18 | + (void)load{ 19 | [self jr_swizzleMethod:@selector(shouldAutorotate) withMethod:@selector(bl_shouldAutorotate) error:nil]; 20 | [self jr_swizzleMethod:@selector(supportedInterfaceOrientations) withMethod:@selector(bl_supportedInterfaceOrientations) error:nil]; 21 | } 22 | 23 | - (BOOL)bl_shouldAutorotate{ // 是否支持旋转. 24 | if ([self isKindOfClass:NSClassFromString(@"BLRootViewController")]) { 25 | return self.childViewControllers.firstObject.shouldAutorotate; 26 | } 27 | 28 | if ([self isKindOfClass:NSClassFromString(@"JPWarpViewController")]) { 29 | return self.childViewControllers.firstObject.shouldAutorotate; 30 | } 31 | 32 | if ([self isKindOfClass:NSClassFromString(@"UITabBarController")]) { 33 | return ((UITabBarController *)self).selectedViewController.shouldAutorotate; 34 | } 35 | 36 | if ([self isKindOfClass:NSClassFromString(@"UINavigationController")]) { 37 | return ((UINavigationController *)self).viewControllers.lastObject.shouldAutorotate; 38 | } 39 | 40 | if ([self checkSelfNeedLandscape]) { 41 | return YES; 42 | } 43 | 44 | if (self.bl_shouldAutoLandscape) { 45 | return YES; 46 | } 47 | 48 | return NO; 49 | } 50 | 51 | - (UIInterfaceOrientationMask)bl_supportedInterfaceOrientations{ // 支持旋转的方向. 52 | if ([self isKindOfClass:NSClassFromString(@"BLRootViewController")]) { 53 | return [self.childViewControllers.firstObject supportedInterfaceOrientations]; 54 | } 55 | 56 | if ([self isKindOfClass:NSClassFromString(@"JPWarpViewController")]) { 57 | return [self.childViewControllers.firstObject supportedInterfaceOrientations]; 58 | } 59 | 60 | if ([self isKindOfClass:NSClassFromString(@"UITabBarController")]) { 61 | return [((UITabBarController *)self).selectedViewController supportedInterfaceOrientations]; 62 | } 63 | 64 | if ([self isKindOfClass:NSClassFromString(@"UINavigationController")]) { 65 | return [((UINavigationController *)self).viewControllers.lastObject supportedInterfaceOrientations]; 66 | } 67 | 68 | if ([self checkSelfNeedLandscape]) { 69 | return UIInterfaceOrientationMaskAllButUpsideDown; 70 | } 71 | 72 | if (self.bl_shouldAutoLandscape) { 73 | return UIInterfaceOrientationMaskAllButUpsideDown; 74 | } 75 | 76 | return UIInterfaceOrientationMaskPortrait; 77 | } 78 | 79 | - (void)setBl_shouldAutoLandscape:(BOOL)bl_shouldAutoLandscape{ 80 | objc_setAssociatedObject(self, @selector(bl_shouldAutoLandscape), @(bl_shouldAutoLandscape), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 81 | } 82 | 83 | - (BOOL)bl_shouldAutoLandscape{ 84 | return [objc_getAssociatedObject(self, _cmd) boolValue]; 85 | } 86 | 87 | - (BOOL)checkSelfNeedLandscape{ 88 | NSProcessInfo *processInfo = [NSProcessInfo processInfo]; 89 | NSOperatingSystemVersion operatingSytemVersion = processInfo.operatingSystemVersion; 90 | 91 | if (operatingSytemVersion.majorVersion == 8) { 92 | NSString *className = NSStringFromClass(self.class); 93 | if ([@[@"AVPlayerViewController", @"AVFullScreenViewController", @"AVFullScreenPlaybackControlsViewController" 94 | ] containsObject:className]) { 95 | return YES; 96 | } 97 | 98 | if ([self isKindOfClass:[UIViewController class]] && [self childViewControllers].count && [self.childViewControllers.firstObject isKindOfClass:NSClassFromString(@"AVPlayerViewController")]) { 99 | return YES; 100 | } 101 | } 102 | else if (operatingSytemVersion.majorVersion == 9){ 103 | NSString *className = NSStringFromClass(self.class); 104 | if ([@[@"WebFullScreenVideoRootViewController", @"AVPlayerViewController", @"AVFullScreenViewController" 105 | ] containsObject:className]) { 106 | return YES; 107 | } 108 | 109 | if ([self isKindOfClass:[UIViewController class]] && [self childViewControllers].count && [self.childViewControllers.firstObject isKindOfClass:NSClassFromString(@"AVPlayerViewController")]) { 110 | return YES; 111 | } 112 | } 113 | else if (operatingSytemVersion.majorVersion == 10){ 114 | if ([self isKindOfClass:NSClassFromString(@"AVFullScreenViewController")]) { 115 | return YES; 116 | } 117 | } 118 | 119 | return NO; 120 | } 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0434ED0525F41B645BC46F2A /* libPods-BLLandscapeDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69C924DF9A20EDA269D622A4 /* libPods-BLLandscapeDemo.a */; }; 11 | 480D38331F2447090015CC38 /* BLRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 480D38321F2447090015CC38 /* BLRootViewController.m */; }; 12 | 480D38361F2451850015CC38 /* BLAnotherWindowViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 480D38351F2451850015CC38 /* BLAnotherWindowViewController.m */; }; 13 | 481AB98E1F24797B004AB81E /* UIView+BLLandscape.m in Sources */ = {isa = PBXBuildFile; fileRef = 481AB98B1F24797B004AB81E /* UIView+BLLandscape.m */; }; 14 | 481AB98F1F24797B004AB81E /* UIViewController+Landscape.m in Sources */ = {isa = PBXBuildFile; fileRef = 481AB98D1F24797B004AB81E /* UIViewController+Landscape.m */; }; 15 | 481AB9931F2479C5004AB81E /* BLSubstituteObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 481AB9921F2479C5004AB81E /* BLSubstituteObject.m */; }; 16 | 487ADC161F239EF100D7FBBD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 487ADC151F239EF100D7FBBD /* main.m */; }; 17 | 487ADC191F239EF100D7FBBD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 487ADC181F239EF100D7FBBD /* AppDelegate.m */; }; 18 | 487ADC211F239EF100D7FBBD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 487ADC201F239EF100D7FBBD /* Assets.xcassets */; }; 19 | 487ADC241F239EF100D7FBBD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 487ADC221F239EF100D7FBBD /* LaunchScreen.storyboard */; }; 20 | 487ADC2D1F239F4900D7FBBD /* BLHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 487ADC2C1F239F4900D7FBBD /* BLHomeViewController.m */; }; 21 | 487ADC331F23A43300D7FBBD /* BLRecordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 487ADC321F23A43300D7FBBD /* BLRecordViewController.m */; }; 22 | 487ADC361F23A47A00D7FBBD /* BLPlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 487ADC351F23A47A00D7FBBD /* BLPlayViewController.m */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 0503BAA2BE4B0F3998F50C56 /* Pods-BLLandscapeDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BLLandscapeDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo.release.xcconfig"; sourceTree = ""; }; 27 | 480D38311F2447090015CC38 /* BLRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLRootViewController.h; sourceTree = ""; }; 28 | 480D38321F2447090015CC38 /* BLRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BLRootViewController.m; sourceTree = ""; }; 29 | 480D38341F2451850015CC38 /* BLAnotherWindowViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLAnotherWindowViewController.h; sourceTree = ""; }; 30 | 480D38351F2451850015CC38 /* BLAnotherWindowViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BLAnotherWindowViewController.m; sourceTree = ""; }; 31 | 481AB98A1F24797B004AB81E /* UIView+BLLandscape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+BLLandscape.h"; sourceTree = ""; }; 32 | 481AB98B1F24797B004AB81E /* UIView+BLLandscape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+BLLandscape.m"; sourceTree = ""; }; 33 | 481AB98C1F24797B004AB81E /* UIViewController+Landscape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Landscape.h"; sourceTree = ""; }; 34 | 481AB98D1F24797B004AB81E /* UIViewController+Landscape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Landscape.m"; sourceTree = ""; }; 35 | 481AB9911F2479C5004AB81E /* BLSubstituteObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLSubstituteObject.h; sourceTree = ""; }; 36 | 481AB9921F2479C5004AB81E /* BLSubstituteObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BLSubstituteObject.m; sourceTree = ""; }; 37 | 487ADC111F239EF100D7FBBD /* BLLandscapeDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BLLandscapeDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 487ADC151F239EF100D7FBBD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | 487ADC171F239EF100D7FBBD /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | 487ADC181F239EF100D7FBBD /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | 487ADC201F239EF100D7FBBD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | 487ADC231F239EF100D7FBBD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 43 | 487ADC251F239EF100D7FBBD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 487ADC2B1F239F4900D7FBBD /* BLHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLHomeViewController.h; sourceTree = ""; }; 45 | 487ADC2C1F239F4900D7FBBD /* BLHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BLHomeViewController.m; sourceTree = ""; }; 46 | 487ADC311F23A43300D7FBBD /* BLRecordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLRecordViewController.h; sourceTree = ""; }; 47 | 487ADC321F23A43300D7FBBD /* BLRecordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BLRecordViewController.m; sourceTree = ""; }; 48 | 487ADC341F23A47A00D7FBBD /* BLPlayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLPlayViewController.h; sourceTree = ""; }; 49 | 487ADC351F23A47A00D7FBBD /* BLPlayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BLPlayViewController.m; sourceTree = ""; }; 50 | 69C924DF9A20EDA269D622A4 /* libPods-BLLandscapeDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BLLandscapeDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 9F24F11249061E90D3EEF63E /* Pods-BLLandscapeDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BLLandscapeDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo.debug.xcconfig"; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 487ADC0E1F239EF100D7FBBD /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 0434ED0525F41B645BC46F2A /* libPods-BLLandscapeDemo.a in Frameworks */, 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | 481AB9891F24797B004AB81E /* BLLandscape */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 481AB9911F2479C5004AB81E /* BLSubstituteObject.h */, 70 | 481AB9921F2479C5004AB81E /* BLSubstituteObject.m */, 71 | 481AB98A1F24797B004AB81E /* UIView+BLLandscape.h */, 72 | 481AB98B1F24797B004AB81E /* UIView+BLLandscape.m */, 73 | 481AB98C1F24797B004AB81E /* UIViewController+Landscape.h */, 74 | 481AB98D1F24797B004AB81E /* UIViewController+Landscape.m */, 75 | ); 76 | path = BLLandscape; 77 | sourceTree = SOURCE_ROOT; 78 | }; 79 | 487ADC081F239EF100D7FBBD = { 80 | isa = PBXGroup; 81 | children = ( 82 | 487ADC131F239EF100D7FBBD /* BLLandscapeDemo */, 83 | 487ADC121F239EF100D7FBBD /* Products */, 84 | 5E3B5420CA9008DD31AD88C6 /* Pods */, 85 | CCAC74B55034CCA1A42AF545 /* Frameworks */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | 487ADC121F239EF100D7FBBD /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 487ADC111F239EF100D7FBBD /* BLLandscapeDemo.app */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | 487ADC131F239EF100D7FBBD /* BLLandscapeDemo */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 481AB9891F24797B004AB81E /* BLLandscape */, 101 | 487ADC171F239EF100D7FBBD /* AppDelegate.h */, 102 | 487ADC181F239EF100D7FBBD /* AppDelegate.m */, 103 | 480D38311F2447090015CC38 /* BLRootViewController.h */, 104 | 480D38321F2447090015CC38 /* BLRootViewController.m */, 105 | 480D38341F2451850015CC38 /* BLAnotherWindowViewController.h */, 106 | 480D38351F2451850015CC38 /* BLAnotherWindowViewController.m */, 107 | 487ADC2B1F239F4900D7FBBD /* BLHomeViewController.h */, 108 | 487ADC2C1F239F4900D7FBBD /* BLHomeViewController.m */, 109 | 487ADC311F23A43300D7FBBD /* BLRecordViewController.h */, 110 | 487ADC321F23A43300D7FBBD /* BLRecordViewController.m */, 111 | 487ADC341F23A47A00D7FBBD /* BLPlayViewController.h */, 112 | 487ADC351F23A47A00D7FBBD /* BLPlayViewController.m */, 113 | 487ADC201F239EF100D7FBBD /* Assets.xcassets */, 114 | 487ADC221F239EF100D7FBBD /* LaunchScreen.storyboard */, 115 | 487ADC251F239EF100D7FBBD /* Info.plist */, 116 | 487ADC141F239EF100D7FBBD /* Supporting Files */, 117 | ); 118 | path = BLLandscapeDemo; 119 | sourceTree = ""; 120 | }; 121 | 487ADC141F239EF100D7FBBD /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 487ADC151F239EF100D7FBBD /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 5E3B5420CA9008DD31AD88C6 /* Pods */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 9F24F11249061E90D3EEF63E /* Pods-BLLandscapeDemo.debug.xcconfig */, 133 | 0503BAA2BE4B0F3998F50C56 /* Pods-BLLandscapeDemo.release.xcconfig */, 134 | ); 135 | name = Pods; 136 | sourceTree = ""; 137 | }; 138 | CCAC74B55034CCA1A42AF545 /* Frameworks */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 69C924DF9A20EDA269D622A4 /* libPods-BLLandscapeDemo.a */, 142 | ); 143 | name = Frameworks; 144 | sourceTree = ""; 145 | }; 146 | /* End PBXGroup section */ 147 | 148 | /* Begin PBXNativeTarget section */ 149 | 487ADC101F239EF100D7FBBD /* BLLandscapeDemo */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = 487ADC281F239EF100D7FBBD /* Build configuration list for PBXNativeTarget "BLLandscapeDemo" */; 152 | buildPhases = ( 153 | D574DFBBB45142BA7CE1022D /* [CP] Check Pods Manifest.lock */, 154 | 487ADC0D1F239EF100D7FBBD /* Sources */, 155 | 487ADC0E1F239EF100D7FBBD /* Frameworks */, 156 | 487ADC0F1F239EF100D7FBBD /* Resources */, 157 | CED58F437025E43221DF6F1F /* [CP] Embed Pods Frameworks */, 158 | 3283428C67659F5600BDEBF4 /* [CP] Copy Pods Resources */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | ); 164 | name = BLLandscapeDemo; 165 | productName = BLLandscapeDemo; 166 | productReference = 487ADC111F239EF100D7FBBD /* BLLandscapeDemo.app */; 167 | productType = "com.apple.product-type.application"; 168 | }; 169 | /* End PBXNativeTarget section */ 170 | 171 | /* Begin PBXProject section */ 172 | 487ADC091F239EF100D7FBBD /* Project object */ = { 173 | isa = PBXProject; 174 | attributes = { 175 | LastUpgradeCheck = 0830; 176 | ORGANIZATIONNAME = "尹久盼"; 177 | TargetAttributes = { 178 | 487ADC101F239EF100D7FBBD = { 179 | CreatedOnToolsVersion = 8.3; 180 | DevelopmentTeam = TBX22VE2Q6; 181 | ProvisioningStyle = Automatic; 182 | }; 183 | }; 184 | }; 185 | buildConfigurationList = 487ADC0C1F239EF100D7FBBD /* Build configuration list for PBXProject "BLLandscapeDemo" */; 186 | compatibilityVersion = "Xcode 3.2"; 187 | developmentRegion = English; 188 | hasScannedForEncodings = 0; 189 | knownRegions = ( 190 | en, 191 | Base, 192 | ); 193 | mainGroup = 487ADC081F239EF100D7FBBD; 194 | productRefGroup = 487ADC121F239EF100D7FBBD /* Products */; 195 | projectDirPath = ""; 196 | projectRoot = ""; 197 | targets = ( 198 | 487ADC101F239EF100D7FBBD /* BLLandscapeDemo */, 199 | ); 200 | }; 201 | /* End PBXProject section */ 202 | 203 | /* Begin PBXResourcesBuildPhase section */ 204 | 487ADC0F1F239EF100D7FBBD /* Resources */ = { 205 | isa = PBXResourcesBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | 487ADC241F239EF100D7FBBD /* LaunchScreen.storyboard in Resources */, 209 | 487ADC211F239EF100D7FBBD /* Assets.xcassets in Resources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | /* End PBXResourcesBuildPhase section */ 214 | 215 | /* Begin PBXShellScriptBuildPhase section */ 216 | 3283428C67659F5600BDEBF4 /* [CP] Copy Pods Resources */ = { 217 | isa = PBXShellScriptBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | ); 221 | inputPaths = ( 222 | ); 223 | name = "[CP] Copy Pods Resources"; 224 | outputPaths = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | shellPath = /bin/sh; 228 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo-resources.sh\"\n"; 229 | showEnvVarsInLog = 0; 230 | }; 231 | CED58F437025E43221DF6F1F /* [CP] Embed Pods Frameworks */ = { 232 | isa = PBXShellScriptBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | ); 236 | inputPaths = ( 237 | ); 238 | name = "[CP] Embed Pods Frameworks"; 239 | outputPaths = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | shellPath = /bin/sh; 243 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo-frameworks.sh\"\n"; 244 | showEnvVarsInLog = 0; 245 | }; 246 | D574DFBBB45142BA7CE1022D /* [CP] Check Pods Manifest.lock */ = { 247 | isa = PBXShellScriptBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | inputPaths = ( 252 | ); 253 | name = "[CP] Check Pods Manifest.lock"; 254 | outputPaths = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | shellPath = /bin/sh; 258 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 259 | showEnvVarsInLog = 0; 260 | }; 261 | /* End PBXShellScriptBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | 487ADC0D1F239EF100D7FBBD /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 487ADC191F239EF100D7FBBD /* AppDelegate.m in Sources */, 269 | 481AB98F1F24797B004AB81E /* UIViewController+Landscape.m in Sources */, 270 | 480D38361F2451850015CC38 /* BLAnotherWindowViewController.m in Sources */, 271 | 480D38331F2447090015CC38 /* BLRootViewController.m in Sources */, 272 | 481AB9931F2479C5004AB81E /* BLSubstituteObject.m in Sources */, 273 | 487ADC161F239EF100D7FBBD /* main.m in Sources */, 274 | 487ADC2D1F239F4900D7FBBD /* BLHomeViewController.m in Sources */, 275 | 481AB98E1F24797B004AB81E /* UIView+BLLandscape.m in Sources */, 276 | 487ADC331F23A43300D7FBBD /* BLRecordViewController.m in Sources */, 277 | 487ADC361F23A47A00D7FBBD /* BLPlayViewController.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXSourcesBuildPhase section */ 282 | 283 | /* Begin PBXVariantGroup section */ 284 | 487ADC221F239EF100D7FBBD /* LaunchScreen.storyboard */ = { 285 | isa = PBXVariantGroup; 286 | children = ( 287 | 487ADC231F239EF100D7FBBD /* Base */, 288 | ); 289 | name = LaunchScreen.storyboard; 290 | sourceTree = ""; 291 | }; 292 | /* End PBXVariantGroup section */ 293 | 294 | /* Begin XCBuildConfiguration section */ 295 | 487ADC261F239EF100D7FBBD /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ALWAYS_SEARCH_USER_PATHS = NO; 299 | CLANG_ANALYZER_NONNULL = YES; 300 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 301 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 302 | CLANG_CXX_LIBRARY = "libc++"; 303 | CLANG_ENABLE_MODULES = YES; 304 | CLANG_ENABLE_OBJC_ARC = YES; 305 | CLANG_WARN_BOOL_CONVERSION = YES; 306 | CLANG_WARN_CONSTANT_CONVERSION = YES; 307 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 308 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 309 | CLANG_WARN_EMPTY_BODY = YES; 310 | CLANG_WARN_ENUM_CONVERSION = YES; 311 | CLANG_WARN_INFINITE_RECURSION = YES; 312 | CLANG_WARN_INT_CONVERSION = YES; 313 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 314 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 315 | CLANG_WARN_UNREACHABLE_CODE = YES; 316 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 317 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 318 | COPY_PHASE_STRIP = NO; 319 | DEBUG_INFORMATION_FORMAT = dwarf; 320 | ENABLE_STRICT_OBJC_MSGSEND = YES; 321 | ENABLE_TESTABILITY = YES; 322 | GCC_C_LANGUAGE_STANDARD = gnu99; 323 | GCC_DYNAMIC_NO_PIC = NO; 324 | GCC_NO_COMMON_BLOCKS = YES; 325 | GCC_OPTIMIZATION_LEVEL = 0; 326 | GCC_PREPROCESSOR_DEFINITIONS = ( 327 | "DEBUG=1", 328 | "$(inherited)", 329 | ); 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 337 | MTL_ENABLE_DEBUG_INFO = YES; 338 | ONLY_ACTIVE_ARCH = YES; 339 | SDKROOT = iphoneos; 340 | }; 341 | name = Debug; 342 | }; 343 | 487ADC271F239EF100D7FBBD /* Release */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | ALWAYS_SEARCH_USER_PATHS = NO; 347 | CLANG_ANALYZER_NONNULL = YES; 348 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 357 | CLANG_WARN_EMPTY_BODY = YES; 358 | CLANG_WARN_ENUM_CONVERSION = YES; 359 | CLANG_WARN_INFINITE_RECURSION = YES; 360 | CLANG_WARN_INT_CONVERSION = YES; 361 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 362 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 363 | CLANG_WARN_UNREACHABLE_CODE = YES; 364 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 365 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 366 | COPY_PHASE_STRIP = NO; 367 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 368 | ENABLE_NS_ASSERTIONS = NO; 369 | ENABLE_STRICT_OBJC_MSGSEND = YES; 370 | GCC_C_LANGUAGE_STANDARD = gnu99; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 379 | MTL_ENABLE_DEBUG_INFO = NO; 380 | SDKROOT = iphoneos; 381 | VALIDATE_PRODUCT = YES; 382 | }; 383 | name = Release; 384 | }; 385 | 487ADC291F239EF100D7FBBD /* Debug */ = { 386 | isa = XCBuildConfiguration; 387 | baseConfigurationReference = 9F24F11249061E90D3EEF63E /* Pods-BLLandscapeDemo.debug.xcconfig */; 388 | buildSettings = { 389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 390 | DEVELOPMENT_TEAM = TBX22VE2Q6; 391 | INFOPLIST_FILE = BLLandscapeDemo/Info.plist; 392 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 394 | PRODUCT_BUNDLE_IDENTIFIER = com.newpan.www; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | }; 397 | name = Debug; 398 | }; 399 | 487ADC2A1F239EF100D7FBBD /* Release */ = { 400 | isa = XCBuildConfiguration; 401 | baseConfigurationReference = 0503BAA2BE4B0F3998F50C56 /* Pods-BLLandscapeDemo.release.xcconfig */; 402 | buildSettings = { 403 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 404 | DEVELOPMENT_TEAM = TBX22VE2Q6; 405 | INFOPLIST_FILE = BLLandscapeDemo/Info.plist; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 408 | PRODUCT_BUNDLE_IDENTIFIER = com.newpan.www; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | }; 411 | name = Release; 412 | }; 413 | /* End XCBuildConfiguration section */ 414 | 415 | /* Begin XCConfigurationList section */ 416 | 487ADC0C1F239EF100D7FBBD /* Build configuration list for PBXProject "BLLandscapeDemo" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | 487ADC261F239EF100D7FBBD /* Debug */, 420 | 487ADC271F239EF100D7FBBD /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | 487ADC281F239EF100D7FBBD /* Build configuration list for PBXNativeTarget "BLLandscapeDemo" */ = { 426 | isa = XCConfigurationList; 427 | buildConfigurations = ( 428 | 487ADC291F239EF100D7FBBD /* Debug */, 429 | 487ADC2A1F239EF100D7FBBD /* Release */, 430 | ); 431 | defaultConfigurationIsVisible = 0; 432 | defaultConfigurationName = Release; 433 | }; 434 | /* End XCConfigurationList section */ 435 | }; 436 | rootObject = 487ADC091F239EF100D7FBBD /* Project object */; 437 | } 438 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcodeproj/project.xcworkspace/xcuserdata/NewPan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dito010/BLLandscape/0bea3c3878963e68e8fb74a60c2d5285060648ff/BLLandscapeDemo/BLLandscapeDemo.xcodeproj/project.xcworkspace/xcuserdata/NewPan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcodeproj/xcuserdata/NewPan.xcuserdatad/xcschemes/BLLandscapeDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcodeproj/xcuserdata/NewPan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BLLandscapeDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 487ADC101F239EF100D7FBBD 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcworkspace/xcuserdata/NewPan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dito010/BLLandscape/0bea3c3878963e68e8fb74a60c2d5285060648ff/BLLandscapeDemo/BLLandscapeDemo.xcworkspace/xcuserdata/NewPan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo.xcworkspace/xcuserdata/NewPan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface AppDelegate : UIResponder 15 | 16 | @property (strong, nonatomic) UIWindow *window; 17 | 18 | 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "AppDelegate.h" 13 | #import "BLHomeViewController.h" 14 | #import "BLRootViewController.h" 15 | #import 16 | 17 | @interface AppDelegate () 18 | 19 | @end 20 | 21 | @implementation AppDelegate 22 | 23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 24 | 25 | // 启动图片延时: 2 秒 26 | [NSThread sleepForTimeInterval:2]; 27 | 28 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 29 | BLHomeViewController *homeVc = [BLHomeViewController new]; 30 | JPNavigationController *nav = [[JPNavigationController alloc] initWithRootViewController:homeVc]; 31 | homeVc.title = @"BLLandscapeDemo"; 32 | BLRootViewController *rootViewController = [BLRootViewController new]; 33 | [rootViewController addChildViewController:nav]; 34 | 35 | self.window.rootViewController = rootViewController; 36 | [self.window makeKeyAndVisible]; 37 | 38 | return YES; 39 | } 40 | 41 | - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ 42 | return self.window.rootViewController.supportedInterfaceOrientations; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/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 | } -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLAnotherWindowViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface BLAnotherWindowViewController : UIViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLAnotherWindowViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "BLAnotherWindowViewController.h" 13 | 14 | @interface BLAnotherWindowViewController () 15 | 16 | @end 17 | 18 | @implementation BLAnotherWindowViewController 19 | 20 | - (BOOL)shouldAutorotate{ 21 | return YES; 22 | } 23 | 24 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations{ 25 | return UIInterfaceOrientationMaskAll; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLHomeViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface BLHomeViewController : UITableViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLHomeViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "BLHomeViewController.h" 13 | #import "BLRecordViewController.h" 14 | #import "BLPlayViewController.h" 15 | #import "BLAnotherWindowViewController.h" 16 | 17 | @interface BLHomeViewController () 18 | 19 | /** 20 | * window. 21 | */ 22 | @property(nonatomic, strong) UIWindow *anotherWindow; 23 | 24 | @end 25 | 26 | static NSString *kBLHomeViewControllerReuseID = @"com.ibeiliao.home.resue.id"; 27 | const CGFloat kBLHomeViewControllerRowHeight = 64.f; 28 | @implementation BLHomeViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | 33 | [self setup]; 34 | } 35 | 36 | -(void)viewDidAppear:(BOOL)animated{ 37 | [super viewDidAppear:animated]; 38 | 39 | self.anotherWindow.hidden = NO; 40 | } 41 | 42 | - (void)viewWillDisappear:(BOOL)animated{ 43 | [super viewWillDisappear:animated]; 44 | self.anotherWindow.hidden = YES; 45 | } 46 | 47 | 48 | #pragma mark - UITableViewDelegate 49 | 50 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 51 | return kBLHomeViewControllerRowHeight; 52 | } 53 | 54 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 55 | if (indexPath.row == 0) { 56 | BLRecordViewController *recordVc = [BLRecordViewController new]; 57 | [self presentViewController:recordVc animated:YES completion:nil]; 58 | } 59 | else if (indexPath.row == 1){ 60 | BLPlayViewController *playVc = [BLPlayViewController new]; 61 | [self.navigationController pushViewController:playVc animated:YES]; 62 | } 63 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 64 | } 65 | 66 | 67 | #pragma mark - UITableViewDataSource 68 | 69 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 70 | return 2; 71 | } 72 | 73 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 74 | 75 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kBLHomeViewControllerReuseID forIndexPath:indexPath]; 76 | if (indexPath.row == 0) { 77 | cell.textLabel.text = @"录制横屏"; 78 | } 79 | else if (indexPath.row == 1){ 80 | cell.textLabel.text = @"播放横屏"; 81 | } 82 | 83 | return cell; 84 | } 85 | 86 | - (void)switchValueChanged:(UISwitch *)aswitch{ 87 | if (aswitch.isOn) { 88 | BLAnotherWindowViewController *vc = [BLAnotherWindowViewController new]; 89 | self.anotherWindow.rootViewController = vc; 90 | [self.anotherWindow insertSubview:vc.view atIndex:0]; 91 | self.anotherWindow.alpha = 0; 92 | } 93 | else{ 94 | self.anotherWindow.rootViewController = nil; 95 | } 96 | } 97 | 98 | 99 | #pragma mark - Setup 100 | 101 | - (void)setup{ 102 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kBLHomeViewControllerReuseID]; 103 | self.tableView.delegate = self; 104 | self.tableView.dataSource = self; 105 | 106 | [self addWindow]; 107 | } 108 | 109 | - (void)addWindow{ 110 | self.anotherWindow = ({ 111 | UIWindow * window = [UIWindow new]; 112 | window.backgroundColor = [UIColor redColor]; 113 | window.frame = CGRectMake(self.view.bounds.size.width - 140.f, self.view.bounds.size.height - 200.f, 100.f, 100.f); 114 | 115 | window; 116 | }); 117 | 118 | UIView *backView = [UIView new]; 119 | backView.backgroundColor = [UIColor blueColor]; 120 | backView.frame = self.anotherWindow.bounds; 121 | [self.anotherWindow addSubview:backView]; 122 | 123 | UILabel *label = [UILabel new]; 124 | label.text = @"我是窗口"; 125 | label.textColor = [UIColor whiteColor]; 126 | [label sizeToFit]; 127 | label.frame = CGRectMake(15.f, 10.f, label.bounds.size.width, label.bounds.size.height); 128 | [backView addSubview:label]; 129 | 130 | UILabel *addRootVCLabel = [UILabel new]; 131 | addRootVCLabel.text = @"为窗口添加根控制器"; 132 | addRootVCLabel.textColor = [UIColor whiteColor]; 133 | [addRootVCLabel sizeToFit]; 134 | addRootVCLabel.font = [UIFont systemFontOfSize:10.f]; 135 | addRootVCLabel.frame = CGRectMake(5.f, 30.f, addRootVCLabel.bounds.size.width, addRootVCLabel.bounds.size.height); 136 | [backView addSubview:addRootVCLabel]; 137 | 138 | UISwitch *aSwitch = [UISwitch new]; 139 | [aSwitch sizeToFit]; 140 | aSwitch.frame = CGRectMake(15.f, 50.f, 40.f, 40.f); 141 | [backView addSubview:aSwitch]; 142 | [aSwitch addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged]; 143 | } 144 | 145 | @end 146 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLPlayViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface BLPlayViewController : UIViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLPlayViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "BLPlayViewController.h" 13 | #import "UIViewController+Landscape.h" 14 | 15 | @interface BLPlayViewController () 16 | 17 | /** 18 | * webView. 19 | */ 20 | @property(nonatomic, strong) UIWebView *webView; 21 | 22 | @end 23 | 24 | @implementation BLPlayViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | [self setup]; 30 | } 31 | 32 | 33 | - (void)viewDidLayoutSubviews{ 34 | [super viewDidLayoutSubviews]; 35 | 36 | self.webView.frame = self.view.bounds; 37 | } 38 | 39 | 40 | #pragma mark - UIWebViewDelegate 41 | 42 | - (void)webViewDidFinishLoad:(UIWebView *)webView{ 43 | NSString *result = [webView stringByEvaluatingJavaScriptFromString:@"if(document.getElementsByTagName('video').length>0)document.getElementsByTagName('video').length;"]; 44 | if (result.length && result.integerValue != 0) { 45 | self.bl_shouldAutoLandscape = YES; 46 | } 47 | } 48 | 49 | 50 | #pragma mark - Setup 51 | 52 | - (void)setup{ 53 | self.webView = ({ 54 | UIWebView *webView = [UIWebView new]; 55 | [self.view addSubview:webView]; 56 | webView.delegate = self; 57 | 58 | webView; 59 | }); 60 | 61 | self.title = @"网页中有视频"; 62 | 63 | // NSString *urlString = @"http://lavaweb-10015286.video.myqcloud.com/%E5%B0%BD%E6%83%85LAVA.mp4"; 64 | NSString *urlString = @"https://www.apple.com/cn/iphone/photography-how-to/"; 65 | [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]]; 66 | } 67 | 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLRecordViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface BLRecordViewController : UIViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLRecordViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "BLRecordViewController.h" 13 | #import 14 | #import "UIView+BLLandscape.h" 15 | 16 | @interface BLRecordViewController () 17 | 18 | /** 19 | * 要横屏的 view. 20 | */ 21 | @property(nonatomic, strong) UIView *previewView; 22 | 23 | /** 24 | * 开始横屏按钮. 25 | */ 26 | @property(nonatomic, strong) UIButton *landscapeButton; 27 | 28 | @end 29 | 30 | @implementation BLRecordViewController 31 | 32 | - (void)viewDidLoad { 33 | [super viewDidLoad]; 34 | 35 | [self setup]; 36 | } 37 | 38 | 39 | - (void)closeButtonDidClick{ 40 | [self dismissViewControllerAnimated:YES completion:nil]; 41 | } 42 | 43 | - (void)landscapeButtonDidClick{ 44 | if (self.previewView.viewStatus == BLLandscapeViewStatusPortrait) { 45 | 46 | [self.previewView bl_landscapeAnimated:YES animations:^{ 47 | 48 | self.landscapeButton.frame = CGRectMake(20.f, self.previewView.bounds.size.height - 80.f, self.previewView.bounds.size.width - 40.f, 50.f); 49 | [self.landscapeButton setTitle:@"回到竖屏" forState:UIControlStateNormal]; 50 | 51 | } complete:^{ 52 | 53 | }]; 54 | } 55 | else if (self.previewView.viewStatus == BLLandscapeViewStatusLandscape){ 56 | 57 | [self.previewView bl_protraitAnimated:YES animations:^{ 58 | 59 | self.landscapeButton.frame = CGRectMake(20.f, self.previewView.bounds.size.height - 80.f, self.previewView.bounds.size.width - 40.f, 50.f); 60 | [self.landscapeButton setTitle:@"开始横屏" forState:UIControlStateNormal]; 61 | 62 | } complete:^{ 63 | 64 | }]; 65 | } 66 | } 67 | 68 | 69 | #pragma mark - Setup 70 | 71 | - (void)setup{ 72 | self.view.backgroundColor = [UIColor blackColor]; 73 | self.previewView = ({ 74 | UIView *view = [UIView new]; 75 | view.frame = self.view.bounds; 76 | view.backgroundColor = [UIColor redColor]; 77 | [self.view addSubview:view]; 78 | 79 | view; 80 | }); 81 | 82 | self.landscapeButton = ({ 83 | UIButton *landscapeBtn = [UIButton new]; 84 | landscapeBtn.backgroundColor = self.view.tintColor; 85 | [landscapeBtn setTitle:@"开始横屏" forState:UIControlStateNormal]; 86 | [landscapeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 87 | [landscapeBtn addTarget:self action:@selector(landscapeButtonDidClick) forControlEvents:UIControlEventTouchUpInside]; 88 | [landscapeBtn sizeToFit]; 89 | landscapeBtn.frame = CGRectMake(20.f, self.previewView.bounds.size.height - 80.f, self.previewView.bounds.size.width - 40.f, 50.f); 90 | landscapeBtn.layer.cornerRadius = 4.f; 91 | [self.previewView addSubview:landscapeBtn]; 92 | 93 | landscapeBtn; 94 | }); 95 | 96 | UIButton *closeBtn = [UIButton new]; 97 | [closeBtn setTitle:@"关闭" forState:UIControlStateNormal]; 98 | [closeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 99 | [closeBtn addTarget:self action:@selector(closeButtonDidClick) forControlEvents:UIControlEventTouchUpInside]; 100 | [closeBtn sizeToFit]; 101 | closeBtn.frame = CGRectMake(self.view.bounds.size.width - 60.f, 30.f, closeBtn.bounds.size.width, closeBtn.bounds.size.height); 102 | [self.view addSubview:closeBtn]; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLRootViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @interface BLRootViewController : UIViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/BLRootViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the BLLandscape package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "BLRootViewController.h" 13 | 14 | @implementation BLRootViewController 15 | 16 | - (void)viewDidLoad{ 17 | [super viewDidLoad]; 18 | 19 | [self.view addSubview:self.childViewControllers.firstObject.view]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | NSCameraUsageDescription 29 | 摄像 30 | NSMicrophoneUsageDescription 31 | 麦克风 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /BLLandscapeDemo/BLLandscapeDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BLLandscapeDemo 4 | // 5 | // Created by 尹久盼 on 2017/7/22. 6 | // Copyright © 2017年 尹久盼. 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 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '8.0' 2 | 3 | target "BLLandscapeDemo" do 4 | 5 | pod 'JPNavigationController', '~> 2.0.1' 6 | pod 'JRSwizzle' 7 | 8 | end 9 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JPNavigationController (2.0.1) 3 | - JRSwizzle (1.0) 4 | 5 | DEPENDENCIES: 6 | - JPNavigationController (~> 2.0.1) 7 | - JRSwizzle 8 | 9 | SPEC CHECKSUMS: 10 | JPNavigationController: cdafaa66f238363ef34f8a11d559fd9f33dfff82 11 | JRSwizzle: dd5ead5d913a0f29e7f558200165849f006bb1e3 12 | 13 | PODFILE CHECKSUM: f6c7b5745834b0ea6522d4d12867bcb2e8a92b50 14 | 15 | COCOAPODS: 1.2.0 16 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPBaseAnimationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPBaseAnimationTransition.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPNavigationBar.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationBar.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPNavigationController.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationController.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPNavigationControllerCompat.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerCompat.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPNavigationControllerGestureRecognizer.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerGestureRecognizer.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPNavigationControllerKit.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerKit.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPNavigationControllerProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerProtocol.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPNavigationControllerTransition.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerTransition.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPPushAnimationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPPushAnimationTransition.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPTransitionShadowView.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPTransitionShadowView.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPWarpNavigationController.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPWarpNavigationController.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/JPWarpViewController.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPWarpViewController.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/UIColor+ImageGenerate.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UIColor+ImageGenerate.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/UINavigationController+FulllScreenPopPush.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UINavigationController+FulllScreenPopPush.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/UIView+ScreenCapture.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UIView+ScreenCapture.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JPNavigationController/UIViewController+ViewControllers.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UIViewController+ViewControllers.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Private/JRSwizzle/JRSwizzle.h: -------------------------------------------------------------------------------- 1 | ../../../JRSwizzle/JRSwizzle.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPBaseAnimationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPBaseAnimationTransition.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPNavigationBar.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationBar.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPNavigationController.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationController.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPNavigationControllerCompat.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerCompat.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPNavigationControllerGestureRecognizer.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerGestureRecognizer.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPNavigationControllerKit.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerKit.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPNavigationControllerProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerProtocol.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPNavigationControllerTransition.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPNavigationControllerTransition.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPPushAnimationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPPushAnimationTransition.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPTransitionShadowView.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPTransitionShadowView.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPWarpNavigationController.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPWarpNavigationController.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/JPWarpViewController.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/JPWarpViewController.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/UIColor+ImageGenerate.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UIColor+ImageGenerate.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/UINavigationController+FulllScreenPopPush.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UINavigationController+FulllScreenPopPush.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/UIView+ScreenCapture.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UIView+ScreenCapture.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JPNavigationController/UIViewController+ViewControllers.h: -------------------------------------------------------------------------------- 1 | ../../../JPNavigationController/JPNavigationController/UIViewController+ViewControllers.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Headers/Public/JRSwizzle/JRSwizzle.h: -------------------------------------------------------------------------------- 1 | ../../../JRSwizzle/JRSwizzle.h -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPBaseAnimationTransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | extern const CGFloat JPBaseAnimationTransitionInterlaceFactor; 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface JPBaseAnimationTransition : NSObject 19 | 20 | /** 21 | * Transition Duration. 22 | */ 23 | @property (nonatomic, assign, readonly) NSTimeInterval transitionDuration; 24 | 25 | /** 26 | * From view controller. 27 | */ 28 | @property (nonatomic, readonly, weak) UIViewController *fromViewController; 29 | 30 | /** 31 | * Target view controller. 32 | */ 33 | @property (nonatomic, readonly, weak) UIViewController *toViewController; 34 | 35 | /** 36 | * Container view. 37 | */ 38 | @property (nonatomic, readonly, weak) UIView *containerView; 39 | 40 | /** 41 | * Animate Transition. 42 | */ 43 | - (void)animateTransition; 44 | 45 | /** 46 | * Complete transition. 47 | */ 48 | - (void)transitionComplete; 49 | 50 | /** 51 | * Fetch tabbar if existed. 52 | */ 53 | - (UITabBar * _Nullable)fetchTabbar; 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPBaseAnimationTransition.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPBaseAnimationTransition.h" 13 | 14 | @interface JPBaseAnimationTransition() 15 | 16 | @property (nonatomic, weak) id transitionContext; 17 | 18 | @end 19 | 20 | const CGFloat JPBaseAnimationTransitionInterlaceFactor = 0.3f; 21 | @implementation JPBaseAnimationTransition 22 | 23 | - (instancetype)init { 24 | self = [super init]; 25 | if (self) { 26 | _transitionDuration = 0.35f; 27 | } 28 | return self; 29 | } 30 | 31 | - (NSTimeInterval)transitionDuration:(id )transitionContext { 32 | return _transitionDuration; 33 | } 34 | 35 | - (void)animateTransition:(id )transitionContext { 36 | _fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 37 | _toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 38 | _containerView = [transitionContext containerView]; 39 | _transitionContext = transitionContext; 40 | 41 | [self animateTransition]; 42 | } 43 | 44 | - (void)animateTransition{ 45 | } 46 | 47 | - (void)transitionComplete { 48 | [self.transitionContext completeTransition:!self.transitionContext.transitionWasCancelled]; 49 | } 50 | 51 | 52 | #pragma mark - Private 53 | 54 | - (UITabBar *)fetchTabbar{ 55 | UIViewController *rootVc = [UIApplication sharedApplication].keyWindow.rootViewController; 56 | UITabBarController *tabbarVc = [self fetchTabbarVcFromRootViewController:rootVc]; 57 | if (tabbarVc) { 58 | return tabbarVc.tabBar; 59 | } 60 | return nil; 61 | } 62 | 63 | - (UITabBarController *)fetchTabbarVcFromRootViewController:(UIViewController *)rootVc{ 64 | if ([rootVc isKindOfClass:[UITabBarController class]]) { 65 | return (UITabBarController *)rootVc; 66 | } 67 | else{ 68 | return [self fetchTabbarVcFromRootViewController:rootVc.childViewControllers.firstObject]; 69 | } 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | /** 13 | * This class is custom navigation bar. 14 | * Framework add the link container view on it, then the link view is out of its super class' range, this lead to link view cannot response user's touch events. we need handle this situation by override hitTest:withEvent: method. 15 | */ 16 | 17 | #import 18 | 19 | @interface JPLinkContainerView : UIView 20 | 21 | @end 22 | 23 | @interface JPNavigationBar : UINavigationBar 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationBar.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPNavigationBar.h" 13 | 14 | @implementation JPLinkContainerView 15 | 16 | @end 17 | 18 | @implementation JPNavigationBar 19 | 20 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{ 21 | 22 | __block JPLinkContainerView *linkView; 23 | [self.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 24 | 25 | if ([obj isKindOfClass:[JPLinkContainerView class]]) { 26 | linkView = (JPLinkContainerView *)obj; 27 | *stop = YES; 28 | } 29 | }]; 30 | 31 | // Link view response touch events when the touch point on link view. keep system action otherwise. 32 | 33 | CGPoint viewP = [self convertPoint:point toView:linkView]; 34 | if ([linkView pointInside:viewP withEvent:event]) { 35 | return [linkView hitTest:viewP withEvent:event]; 36 | } 37 | else{ 38 | return [super hitTest:point withEvent:event]; 39 | } 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/backImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dito010/BLLandscape/0bea3c3878963e68e8fb74a60c2d5285060648ff/BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/backImage@2x.png -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/backImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dito010/BLLandscape/0bea3c3878963e68e8fb74a60c2d5285060648ff/BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/backImage@3x.png -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/shadow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dito010/BLLandscape/0bea3c3878963e68e8fb74a60c2d5285060648ff/BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/shadow@2x.png -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/shadow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dito010/BLLandscape/0bea3c3878963e68e8fb74a60c2d5285060648ff/BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.bundle/shadow@3x.png -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @class JPNavigationController; 17 | 18 | /** 19 | * Just follow the JPNavigationControllerDelegate protocol and override the delegate method in this protocol, 20 | * use [self.navigationController pushViewController:aVc animated:YES] 21 | * if need push gesture transition animation when left slip. 22 | * You should preload the data of next viewController need to display for a good experience. 23 | */ 24 | @protocol JPNavigationControllerDelegate 25 | 26 | @optional 27 | 28 | /** 29 | * The delegate method need to override if need push gesture transition animation when left slip. 30 | * 31 | * @param navigationController the root navigation controller. 32 | */ 33 | -(void)navigationControllerDidPush:(JPNavigationController *)navigationController; 34 | 35 | /** 36 | * Ask the delegate should response right slip. 37 | * You may need intercept the pop gesture and, handle your events. open this link to know about this 38 | * https://github.com/newyjp/JPAnimation. 39 | * 40 | * @param navigationController the root navigation controller. 41 | * 42 | * @return the result of asking the delegate should framework response right slip gesture. 43 | */ 44 | -(BOOL)navigationControllerShouldStartPop:(JPNavigationController *)navigationController;; 45 | 46 | @end 47 | 48 | @interface JPNavigationController : UINavigationController 49 | 50 | @end 51 | 52 | NS_ASSUME_NONNULL_END 53 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPNavigationController.h" 13 | #import "UIViewController+ViewControllers.h" 14 | #import "JPWarpViewController.h" 15 | #import "UINavigationController+FulllScreenPopPush.h" 16 | #import "JPNavigationControllerProtocol.h" 17 | #import "JPNavigationControllerCompat.h" 18 | #import "JPWarpNavigationController.h" 19 | #import "JPNavigationControllerGestureRecognizer.h" 20 | #import "JPNavigationControllerTransition.h" 21 | 22 | @interface JPNavigationController () 23 | 24 | /** 25 | * Pan gesture. 26 | */ 27 | @property(nonatomic, strong) JPNavigationControllerGestureRecognizer *fullScreenPopGesture; 28 | 29 | /** 30 | * The biggest distance allow pop leave screen left slide in current root navigation controller. 31 | */ 32 | @property(nonatomic, assign) CGFloat interactivePopMaxAllowedInitialDistanceToLeftEdge; 33 | 34 | /** 35 | * Close or open pop gesture for all viewControllers in current root navigation controller. 36 | */ 37 | @property(nonatomic, assign) BOOL closePopForAllViewControllers; 38 | 39 | /** 40 | * System pop gesture target. 41 | */ 42 | @property(nonatomic, weak) id systemPopTarget; 43 | 44 | /** 45 | * Transition. 46 | */ 47 | @property(nonatomic, strong) JPNavigationControllerTransition *transition; 48 | 49 | @end 50 | 51 | @implementation JPNavigationController 52 | 53 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController{ 54 | NSAssert(rootViewController, @"The root view controller cannot be nil."); 55 | if (!rootViewController) { 56 | return nil; 57 | } 58 | 59 | // Initialize, you need care that here we push a warped view controller, @see JPWarpViewController. 60 | 61 | self = [super init]; 62 | if (self) { 63 | JPWarpViewController *warpedViewController = [[JPWarpViewController alloc]initWithRootViewController:rootViewController rootNavigationController:self]; 64 | self.viewControllers = @[warpedViewController]; 65 | 66 | _interactivePopMaxAllowedInitialDistanceToLeftEdge = JPScreenW; 67 | _closePopForAllViewControllers = NO; 68 | } 69 | return self; 70 | } 71 | 72 | - (void)viewDidLoad { 73 | [super viewDidLoad]; 74 | 75 | // Hide navigation bar of self. 76 | self.navigationBar.hidden = YES; 77 | 78 | 79 | // Add pan gesture(lazying load) and, add delegate to pan, close system interactivePopGestureRecognizer at the same time. 80 | if (![self.interactivePopGestureRecognizer.view.gestureRecognizers containsObject:self.fullScreenPopGesture]) { 81 | [self.interactivePopGestureRecognizer.view addGestureRecognizer:_fullScreenPopGesture]; 82 | NSArray *targets = [self.interactivePopGestureRecognizer valueForKey:@"targets"]; 83 | _systemPopTarget = [targets.firstObject valueForKey:@"target"]; 84 | self.interactivePopGestureRecognizer.enabled = NO; 85 | 86 | [_fullScreenPopGesture addTarget:self action:@selector(gestureDidTriggered:)]; 87 | } 88 | } 89 | 90 | - (UIViewController *)childViewControllerForStatusBarStyle{ 91 | return self.topViewController; 92 | } 93 | 94 | 95 | #pragma mark - UIGestureRecognizerDelegate 96 | 97 | - (BOOL)gestureRecognizerShouldBegin:(JPNavigationControllerGestureRecognizer *)gestureRecognizer{ 98 | CGPoint translation = [gestureRecognizer velocityInView:gestureRecognizer.view]; 99 | 100 | JPWarpViewController *warpVc = self.viewControllers.lastObject; 101 | if (!warpVc) { 102 | return NO; 103 | } 104 | JPWarpNavigationController *warpNav = warpVc.childViewControllers.firstObject; 105 | if (!warpNav) { 106 | return NO; 107 | } 108 | 109 | if (translation.x < 0) { 110 | 111 | // left slip, means push action. 112 | 113 | if (warpNav.navigationDelegate && [warpNav.navigationDelegate respondsToSelector:@selector(navigationControllerDidPush:)]) { 114 | [self addPushAction:gestureRecognizer]; 115 | 116 | return YES; 117 | } 118 | 119 | return NO; 120 | } 121 | else{ 122 | 123 | // right slip, means pop action. 124 | 125 | // Forbid pop when the start point beyond user setted range for pop. 126 | CGPoint beginningLocation = [gestureRecognizer locationInView:gestureRecognizer.view]; 127 | if (_interactivePopMaxAllowedInitialDistanceToLeftEdge >= 0 && beginningLocation.x > _interactivePopMaxAllowedInitialDistanceToLeftEdge) { 128 | return NO; 129 | } 130 | else{ 131 | // forbid pop when transitioning. 132 | if ([[self valueForKey:@"_isTransitioning"] boolValue]) { 133 | return NO; 134 | } 135 | 136 | // forbid pop when current viewController is root viewController. 137 | if (self.viewControllers.count == 1) { 138 | return NO; 139 | } 140 | 141 | // forbid pop when closed all viewControllers' pop gesture. 142 | if (_closePopForAllViewControllers) { 143 | return NO; 144 | } 145 | 146 | // Check current view controller is close pop or not. 147 | if (warpNav.closePopForCurrentViewController) { 148 | return NO; 149 | } 150 | 151 | // ask delegate. 152 | if (warpNav.navigationDelegate && [warpNav.navigationDelegate respondsToSelector:@selector(navigationControllerShouldStartPop:)]) { 153 | if (![warpNav.navigationDelegate navigationControllerShouldStartPop:self]) { 154 | return NO; 155 | } 156 | } 157 | 158 | // not use system pop action. 159 | if (warpNav.useCustomPopAnimationForCurrentViewController) { 160 | return YES; 161 | } 162 | 163 | // use system pop action. 164 | [self addSystemPopAction:gestureRecognizer]; 165 | } 166 | } 167 | 168 | return YES; 169 | } 170 | 171 | 172 | #pragma mark - Gesture 173 | 174 | - (void)gestureDidTriggered:(JPNavigationControllerGestureRecognizer *)gestureRecognizer{ 175 | 176 | if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { 177 | 178 | CGPoint translation = [gestureRecognizer velocityInView:gestureRecognizer.view]; 179 | if (translation.x < 0) { 180 | 181 | JPWarpViewController *warpVc = self.viewControllers.lastObject; 182 | 183 | if (!warpVc) { 184 | return; 185 | } 186 | JPWarpNavigationController *warpNav = warpVc.childViewControllers.firstObject; 187 | if (!warpNav) { 188 | return; 189 | } 190 | 191 | // ask delegate. 192 | if (warpNav.navigationDelegate && [warpNav.navigationDelegate respondsToSelector:@selector(navigationControllerDidPush:)]) { 193 | 194 | // handle pop transition animation by system. 195 | self.delegate = self.transition; 196 | 197 | [warpNav.navigationDelegate navigationControllerDidPush:self]; 198 | } 199 | } 200 | } 201 | else if (gestureRecognizer.state == UIGestureRecognizerStateEnded || gestureRecognizer.state == UIGestureRecognizerStateCancelled) { 202 | 203 | // reset root navigation controller delegate. 204 | // if not do this, some unexpected error will happen when tap back button. 205 | self.delegate = nil; 206 | 207 | // remove target. 208 | [self removeAllAction:gestureRecognizer]; 209 | 210 | } 211 | } 212 | 213 | 214 | #pragma mark - System Pop Gesture Target 215 | 216 | - (void)addSystemPopAction:(JPNavigationControllerGestureRecognizer *)gesture{ 217 | // handle pop transition animation by system. 218 | self.delegate = nil; 219 | 220 | // System pop action. 221 | SEL popSel = NSSelectorFromString(@"handleNavigationTransition:"); 222 | [gesture addTarget:_systemPopTarget action:popSel]; 223 | gesture.transitionType = JPNavigationControllerTransitionTypePopSystem; 224 | } 225 | 226 | 227 | #pragma mark - Push Gesture Target 228 | 229 | - (void)addPushAction:(JPNavigationControllerGestureRecognizer *)gesture{ 230 | // push action. 231 | [gesture addTarget:self.transition action:@selector(gestureDidTriggered:)]; 232 | gesture.transitionType = JPNavigationControllerTransitionTypePush; 233 | } 234 | 235 | 236 | #pragma mark - Remove Gesture Target 237 | 238 | - (void)removeAllAction:(JPNavigationControllerGestureRecognizer *)gesture{ 239 | switch (gesture.transitionType) { 240 | case JPNavigationControllerTransitionTypeNone: 241 | break; 242 | 243 | case JPNavigationControllerTransitionTypePush:{ 244 | [gesture removeTarget:self.transition action:@selector(gestureDidTriggered:)]; 245 | } 246 | break; 247 | 248 | case JPNavigationControllerTransitionTypePopSystem:{ 249 | SEL popSel = NSSelectorFromString(@"handleNavigationTransition:"); 250 | [gesture removeTarget:_systemPopTarget action:popSel]; 251 | } 252 | break; 253 | 254 | case JPNavigationControllerTransitionTypePop:{ 255 | } 256 | break; 257 | } 258 | } 259 | 260 | 261 | #pragma mark - Private 262 | 263 | - (JPNavigationControllerGestureRecognizer *)fullScreenPopGesture{ 264 | if (!_fullScreenPopGesture) { 265 | _fullScreenPopGesture = [JPNavigationControllerGestureRecognizer new]; 266 | _fullScreenPopGesture.maximumNumberOfTouches = 1; 267 | _fullScreenPopGesture.delegate = self; 268 | _fullScreenPopGesture.transitionType = JPNavigationControllerTransitionTypeNone; 269 | _fullScreenPopGesture.gestureType = JPNavigationControllerGestureRecognizerTypeWarp; 270 | } 271 | return _fullScreenPopGesture; 272 | } 273 | 274 | - (JPNavigationControllerTransition *)transition{ 275 | if (!_transition) { 276 | _transition = [[JPNavigationControllerTransition alloc] initWithNavigationContollerViewController:self]; 277 | } 278 | return _transition; 279 | } 280 | 281 | - (void)popToViewController:(NSDictionary *)arguments{ 282 | if (!arguments) { 283 | return; 284 | } 285 | 286 | NSString *targetClassString = arguments[@"targetClassString"]; 287 | JPNavigationContollerPopHandle handle = arguments[@"handle"]; 288 | BOOL animated = [arguments[@"animated"] boolValue]; 289 | 290 | NSMutableArray *viewControllersM = [NSMutableArray array]; 291 | 292 | // find all viewControllers in stack that class is given class. 293 | for (JPWarpViewController *vc in self.viewControllers) { 294 | Class targetClass = NSClassFromString(targetClassString); 295 | if ([vc.userViewController isKindOfClass:targetClass]) { 296 | [viewControllersM addObject:vc]; 297 | } 298 | } 299 | 300 | // if find viewController for given class. 301 | if (viewControllersM.count) { 302 | 303 | if (handle) { 304 | NSMutableArray *targetViewControllersM = [NSMutableArray array]; 305 | [viewControllersM enumerateObjectsUsingBlock:^(JPWarpViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 306 | 307 | [targetViewControllersM addObject:obj.userViewController]; 308 | 309 | }]; 310 | 311 | UIViewController *vc = handle([targetViewControllersM copy], nil); 312 | if (vc) { 313 | [self popToViewController:vc.jp_warpViewController animated:animated]; 314 | } 315 | } 316 | else{ 317 | 318 | JPWarpViewController *warpVc = viewControllersM.firstObject; 319 | [self popToViewController:warpVc animated:animated]; 320 | 321 | } 322 | } 323 | else{ 324 | // don't find viewController in stack for given class. 325 | 326 | if (handle) { 327 | NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"JPNavigationController don't find viewController in stack for >> %@ <<.", targetClassString] code:0 userInfo:nil]; 328 | handle(nil, error); 329 | } 330 | } 331 | } 332 | 333 | @end 334 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationControllerCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #ifndef JPNavigationControllerCompat_h 13 | #define JPNavigationControllerCompat_h 14 | 15 | #define JPScreenH [UIScreen mainScreen].bounds.size.height 16 | #define JPScreenW [UIScreen mainScreen].bounds.size.width 17 | 18 | 19 | typedef NS_ENUM(NSInteger, JPNavigationControllerTransitionType) { 20 | JPNavigationControllerTransitionTypeNone = 0, 21 | JPNavigationControllerTransitionTypePush = 1, 22 | JPNavigationControllerTransitionTypePop = 2, 23 | JPNavigationControllerTransitionTypePopSystem = 3, 24 | }; 25 | 26 | #endif /* JPNavigationControllerCompat_h */ 27 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationControllerGestureRecognizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | #import "JPNavigationControllerCompat.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | typedef NS_ENUM(NSInteger, JPNavigationControllerGestureRecognizerType) { 18 | JPNavigationControllerGestureRecognizerTypeRoot = 0, 19 | JPNavigationControllerGestureRecognizerTypeWarp = 1 20 | }; 21 | 22 | @interface JPNavigationControllerGestureRecognizer : UIPanGestureRecognizer 23 | 24 | /** 25 | * The current transition type. 26 | */ 27 | @property(nonatomic, assign) JPNavigationControllerTransitionType transitionType; 28 | 29 | /** 30 | * Gesture recognizer type. 31 | */ 32 | @property(nonatomic, assign) JPNavigationControllerGestureRecognizerType gestureType; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationControllerGestureRecognizer.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPNavigationControllerGestureRecognizer.h" 13 | 14 | @implementation JPNavigationControllerGestureRecognizer 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationControllerKit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #ifndef JPNavigationControllerKit_h 13 | #define JPNavigationControllerKit_h 14 | 15 | #import "JPNavigationController.h" 16 | #import "UIColor+ImageGenerate.h" 17 | #import "UINavigationController+FulllScreenPopPush.h" 18 | 19 | #endif /* JPNavigationControllerKit_h */ 20 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationControllerProtocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPNavigationController.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | // When use jp_popToViewControllerClass:handle:animated:, may some error happened, or may more than one viewControllers are the same class, developers will be notificated use this block if this situation happened. 17 | typedef UIViewController *_Nullable(^JPNavigationContollerPopHandle)(NSArray * _Nullable viewControllers, NSError * _Nullable error); 18 | 19 | @protocol JPNavigationControllerProtocol 20 | 21 | /** 22 | * The root navigation controller. 23 | * 24 | * @see JPNavigationController 25 | */ 26 | @property(nonatomic, readonly) JPNavigationController * jp_rootNavigationController; 27 | 28 | /** 29 | * The biggest distance allow pop leave screen left slide in current root navigation controller. 30 | * Full screen width by default, mean can call pop anywhere in screen. 31 | */ 32 | @property (nonatomic) CGFloat jp_interactivePopMaxAllowedInitialDistanceToLeftEdge; 33 | 34 | /** 35 | * Close or open pop gesture for current viewController in current root navigation controller. 36 | * NO by default. 37 | */ 38 | @property(nonatomic) BOOL jp_closePopForCurrentViewController; 39 | 40 | /** 41 | * Close or open pop gesture for all viewControllers in current root navigation controller. 42 | * NO by default. 43 | */ 44 | @property(nonatomic) BOOL jp_closePopForAllViewControllers; 45 | 46 | /** 47 | * Use custom pop animation for current viewController in current root navigation controller. 48 | * Default is NO. 49 | * 50 | * This property always be used in situations that the current viewController need to play video or audio by `AVPlayer`, or need to play `CoreAnimation`, because system have some bugs on this situations. 51 | * 52 | * @watchout: 53 | * If set this property as YES, framework will insert a image carptured from `toViewController` as background in current viewController, and make the view of current viewController to move drived by a binded `UIPanGestureRecognizer` when excute the pop animation actually. 54 | * So the -viewWillDisappear:, -viewDidDisappear:, -viewWillAppear:, -viewDidAppear: will never be called when excute custom pop animation. 55 | */ 56 | @property(nonatomic) BOOL jp_useCustomPopAnimationForCurrentViewController; 57 | 58 | /** 59 | * Link view height at screen bottom. 60 | */ 61 | @property(nonatomic)CGFloat jp_linkViewHeight; 62 | 63 | /** 64 | * Link view at screen bottom. 65 | * You just need pass your link view to this property, framework will display your link view automatically. 66 | * @warning if the viewController display in window currently is a `UITableViewController` class, frame will add a contentInset automatically to avoid the link view cover on `UITableViewController`. but if you add a `UITableView` on `UIViewController`, framework will do nothing for that, you may handle this by yourself. 67 | * 68 | * @see `JPWarpNavigationController`. 69 | */ 70 | @property(nonatomic)UIView * jp_linkView; 71 | 72 | /** 73 | * Register delegate to observer the delegate events. 74 | * 75 | * @param delegate A instance implementation `JPNavigationControllerDelegate` protocol. 76 | * 77 | * @see JPNavigationControllerDelegate. 78 | */ 79 | - (void)jp_registerNavigtionControllerDelegate:(id)delegate; 80 | 81 | /** 82 | * Pop to target view controller, you just need to pass in the class of target view controller. It's easy to use than system's popToViewController: animated: method. 83 | * 84 | * @param targetClassString The class of viewController need pop to, it should be pushed in root navigationController. 85 | * @param handle May some error happened, or may more than one viewControllers are the same class, developers will be notificated use this block if this situation happened. 86 | * Pass nil means that if existed many viewControllers for given class, framework will pop the first object in viewControllers array. 87 | * 88 | * First param viewControllers This method will find all the `UIViewController` instance in stack of root navigation controller for given class,so this array may have multi-elements. And all the viewControllers will ordered by the order of the instance in stack of root navigation controller. 89 | * 90 | * Secondary param error If not found a `UIViewController` instance in stack of root navigation controller for given class, error will have value. 91 | * 92 | * Return `UIViewController` Return the need to pop `UIViewController` instance. 93 | * 94 | * @param animated The flag of need animation or not. 95 | * 96 | * @code 97 | * 98 | * [self.navigationController jp_popToViewControllerClassString:@"JPNavigationControllerDemo_linkBar" handle:^UIViewController * _Nullable(NSArray * _Nullable viewControllers, NSError * _Nullable error) { 99 | * 100 | * if (!error) { 101 | * return viewControllers.firstObject; 102 | * } 103 | * else{ 104 | * NSLog(@"%@", error); 105 | * return nil; 106 | * } 107 | * 108 | * } animated:YES]; 109 | * 110 | * @endcode 111 | */ 112 | - (void)jp_popToViewControllerClassString:(NSString *_Nonnull)targetClassString handle:(JPNavigationContollerPopHandle _Nullable)handle animated:(BOOL)animated; 113 | 114 | @end 115 | 116 | NS_ASSUME_NONNULL_END 117 | 118 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationControllerTransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @class JPNavigationController, JPNavigationControllerTransition; 17 | 18 | @protocol JPNavigationControllerTransitionDelegate 19 | 20 | @optional 21 | //- (void) 22 | 23 | @end 24 | 25 | @interface JPNavigationControllerTransition : NSObject 26 | 27 | /** 28 | * Initialze Method. 29 | * 30 | * @param navigationController root navigation controller. 31 | * 32 | * @return a instance. 33 | */ 34 | - (instancetype)initWithNavigationContollerViewController:(JPNavigationController *)navigationController; 35 | 36 | /** 37 | * This method will be called when pan gesture be triggered. 38 | * 39 | * @param gestureRecognizer A instance of `UIPanGestureRecognizer`. 40 | */ 41 | - (void)gestureDidTriggered:(UIPanGestureRecognizer *)gestureRecognizer; 42 | 43 | @end 44 | 45 | NS_ASSUME_NONNULL_END 46 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPNavigationControllerTransition.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPNavigationControllerTransition.h" 13 | #import "JPNavigationController.h" 14 | #import "JPNavigationControllerCompat.h" 15 | #import "JPPushAnimationTransition.h" 16 | #import "JPNavigationControllerGestureRecognizer.h" 17 | 18 | @interface JPNavigationControllerTransition() 19 | 20 | /** 21 | * The root navigation controller. 22 | */ 23 | @property(nonatomic, weak) JPNavigationController *navigationController; 24 | 25 | /** 26 | * Percent Driven Interactive Transition. 27 | */ 28 | @property (nonatomic, strong) UIPercentDrivenInteractiveTransition *interactivePopTransition; 29 | 30 | /** 31 | * The current gesture is push or pop. 32 | */ 33 | @property(nonatomic, assign) JPNavigationControllerTransitionType transitionType; 34 | 35 | /** 36 | * Pop animation transition. 37 | */ 38 | @property(nonatomic, strong) JPPushAnimationTransition *pushAnimTransition; 39 | 40 | @end 41 | 42 | // The borderline value devcide is need push pop or not when gesture end. 43 | const CGFloat kJPNavigationControllerTransitionBorderlineDelta = 0.3; 44 | @implementation JPNavigationControllerTransition 45 | 46 | - (instancetype)initWithNavigationContollerViewController:(JPNavigationController *)navigationController{ 47 | self = [super init]; 48 | if (self) { 49 | _navigationController = navigationController; 50 | _transitionType = JPNavigationControllerTransitionTypeNone; 51 | } 52 | return self; 53 | } 54 | 55 | - (void)gestureDidTriggered:(JPNavigationControllerGestureRecognizer *)gestureRecognizer{ 56 | 57 | // Calculate the percent of the point origin-X / screen width, alloc UIPercentDrivenInteractiveTransition instance when push start, and check user is overrided the protocol method or not, if overrided, then start push and, set start percent = 0. 58 | // Refresh the slip percent when pan gesture changed. 59 | // Judge the slip percent is more than the JPPushBorderlineDelta when pan gesture end. 60 | 61 | CGFloat progress = [gestureRecognizer translationInView:gestureRecognizer.view].x / gestureRecognizer.view.bounds.size.width; 62 | 63 | if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { 64 | 65 | _transitionType = gestureRecognizer.transitionType; 66 | [self.interactivePopTransition updateInteractiveTransition:0]; 67 | 68 | } 69 | else if (gestureRecognizer.state == UIGestureRecognizerStateChanged) { 70 | 71 | if (_transitionType == JPNavigationControllerTransitionTypePush) { 72 | if (progress <= 0) { 73 | progress = fabs(progress); 74 | progress = MIN(1.0, MAX(0.0, progress)); 75 | } 76 | else{ 77 | progress = 0; 78 | } 79 | 80 | [self.interactivePopTransition updateInteractiveTransition:progress]; 81 | } 82 | 83 | } 84 | else if (gestureRecognizer.state == UIGestureRecognizerStateEnded || gestureRecognizer.state == UIGestureRecognizerStateCancelled) { 85 | 86 | if (fabs(progress) > kJPNavigationControllerTransitionBorderlineDelta) { 87 | [self.interactivePopTransition finishInteractiveTransition]; 88 | } 89 | else { 90 | [self.interactivePopTransition cancelInteractiveTransition]; 91 | } 92 | _transitionType = JPNavigationControllerTransitionTypeNone; 93 | } 94 | } 95 | 96 | 97 | #pragma mark - UINavigationControllerDelegate 98 | 99 | - (id)navigationController:(UINavigationController *)navigationControxller 100 | animationControllerForOperation:(UINavigationControllerOperation)operation 101 | fromViewController:(UIViewController *)fromVC 102 | toViewController:(UIViewController *)toVC { 103 | 104 | // return custom animation transition for given situtation. 105 | if (operation == UINavigationControllerOperationPush) { 106 | return self.pushAnimTransition; 107 | } 108 | 109 | return nil; 110 | } 111 | 112 | 113 | - (id)navigationController:(UINavigationController *)navigationController 114 | interactionControllerForAnimationController:(id)animationController { 115 | 116 | // If the animationController is custom instance, return interactivePopTransition to manage transition progress. 117 | if (self.interactivePopTransition) { 118 | return _interactivePopTransition; 119 | } 120 | 121 | return nil; 122 | } 123 | 124 | 125 | #pragma mark - Private 126 | 127 | - (UIPercentDrivenInteractiveTransition *)interactivePopTransition{ 128 | if (!_interactivePopTransition) { 129 | _interactivePopTransition = [[UIPercentDrivenInteractiveTransition alloc] init]; 130 | _interactivePopTransition.completionCurve = UIViewAnimationCurveEaseOut; 131 | } 132 | return _interactivePopTransition; 133 | } 134 | 135 | - (JPPushAnimationTransition *)pushAnimTransition{ 136 | if (!_pushAnimTransition) { 137 | _pushAnimTransition = [JPPushAnimationTransition new]; 138 | } 139 | return _pushAnimTransition; 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPPushAnimationTransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPBaseAnimationTransition.h" 13 | 14 | @interface JPPushAnimationTransition : JPBaseAnimationTransition 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPPushAnimationTransition.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPPushAnimationTransition.h" 13 | #import "JPNavigationControllerCompat.h" 14 | #import "UIView+ScreenCapture.h" 15 | #import "UIViewController+ViewControllers.h" 16 | #import "JPTransitionShadowView.h" 17 | #import "UIView+ScreenCapture.h" 18 | 19 | @interface JPPushAnimationTransition() 20 | 21 | /** 22 | * ImageView for toViewController to animate. 23 | */ 24 | @property(nonatomic, strong) JPTransitionShadowView *toShadowView_anim; 25 | 26 | /** 27 | * From ImageView for fromViewController to animate. 28 | */ 29 | @property(nonatomic, strong) UIImageView *fromImv_anim; 30 | 31 | @end 32 | 33 | @implementation JPPushAnimationTransition 34 | 35 | - (void)animateTransition{ 36 | BOOL tabbarIsHidden = self.toViewController.hidesBottomBarWhenPushed; 37 | 38 | if (tabbarIsHidden) { 39 | // hide tabbar. 40 | [self animateTransitionForHiddenTabbar]; 41 | } 42 | else{ 43 | [self animateTransitionForDisplayTabbar]; 44 | } 45 | } 46 | 47 | 48 | #pragma mark - Animation 49 | 50 | - (void)animateTransitionForHiddenTabbar{ 51 | 52 | UIImage *fromImg = [self.fromViewController.view.window jp_captureCurrentView]; 53 | self.fromImv_anim.image = fromImg; 54 | self.fromImv_anim.frame = CGRectMake(0, 0, JPScreenW, JPScreenH); 55 | [self.containerView addSubview:self.fromImv_anim]; 56 | 57 | CGRect toViewFrame = CGRectMake(JPScreenW - JPMixShadowViewShadowWidth, 0, JPScreenW + JPMixShadowViewShadowWidth, JPScreenH); 58 | self.toShadowView_anim.frame = toViewFrame; 59 | self.toViewController.view.frame = CGRectMake(JPMixShadowViewShadowWidth, 0, JPScreenW, JPScreenH); 60 | [self.toShadowView_anim addSubview:self.toViewController.view]; 61 | [self.containerView addSubview:self.toShadowView_anim]; 62 | 63 | // hide tabbar. 64 | UITabBar *tabbar = [self fetchTabbar]; 65 | if (tabbar) { 66 | tabbar.hidden = YES; 67 | } 68 | 69 | [UIView animateWithDuration:self.transitionDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 70 | 71 | CGRect fromViewFrame = self.fromImv_anim.frame; 72 | fromViewFrame.origin.x = -JPBaseAnimationTransitionInterlaceFactor * JPScreenW; 73 | self.fromImv_anim.frame = fromViewFrame; 74 | 75 | CGRect toViewframe = self.toShadowView_anim.frame; 76 | toViewframe.origin.x = -JPMixShadowViewShadowWidth; 77 | self.toShadowView_anim.frame = toViewframe; 78 | 79 | } completion:^(BOOL finished) { 80 | 81 | [self.toViewController.view removeFromSuperview]; 82 | self.toViewController.view.frame = CGRectMake(0, 0, JPScreenW, JPScreenH); 83 | [self.containerView addSubview:self.toViewController.view]; 84 | [self transitionComplete]; 85 | self.fromImv_anim.image = nil; 86 | [self.fromImv_anim removeFromSuperview]; 87 | [self.toShadowView_anim removeFromSuperview]; 88 | 89 | tabbar.hidden = NO; 90 | }]; 91 | } 92 | 93 | - (void)animateTransitionForDisplayTabbar{ 94 | 95 | self.fromViewController.view.frame = CGRectMake(0, 0, JPScreenW, JPScreenH); 96 | [self.containerView addSubview:self.fromViewController.view]; 97 | 98 | CGRect toViewFrame = CGRectMake(JPScreenW - JPMixShadowViewShadowWidth, 0, JPScreenW + JPMixShadowViewShadowWidth, JPScreenH); 99 | self.toShadowView_anim.frame = toViewFrame; 100 | self.toViewController.view.frame = CGRectMake(JPMixShadowViewShadowWidth, 0, JPScreenW, JPScreenH); 101 | [self.toShadowView_anim addSubview:self.toViewController.view]; 102 | [self.containerView addSubview:self.toShadowView_anim]; 103 | 104 | [UIView animateWithDuration:self.transitionDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 105 | 106 | CGRect fromViewFrame = self.fromViewController.view.frame; 107 | fromViewFrame.origin.x = -JPBaseAnimationTransitionInterlaceFactor * JPScreenW; 108 | self.fromViewController.view.frame = fromViewFrame; 109 | 110 | CGRect toViewframe = self.toShadowView_anim.frame; 111 | toViewframe.origin.x = -JPMixShadowViewShadowWidth; 112 | self.toShadowView_anim.frame = toViewframe; 113 | 114 | } completion:^(BOOL finished) { 115 | 116 | [self.toViewController.view removeFromSuperview]; 117 | self.toViewController.view.frame = CGRectMake(0, 0, JPScreenW, JPScreenH); 118 | [self.containerView addSubview:self.toViewController.view]; 119 | [self transitionComplete]; 120 | [self.toShadowView_anim removeFromSuperview]; 121 | 122 | }]; 123 | } 124 | 125 | 126 | #pragma mark - Private 127 | 128 | - (UIImageView *)fromImv_anim{ 129 | if (!_fromImv_anim) { 130 | _fromImv_anim = [UIImageView new]; 131 | } 132 | return _fromImv_anim; 133 | } 134 | 135 | - (JPTransitionShadowView *)toShadowView_anim{ 136 | if (!_toShadowView_anim) { 137 | _toShadowView_anim = [JPTransitionShadowView new]; 138 | } 139 | return _toShadowView_anim; 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPTransitionShadowView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | extern const CGFloat JPMixShadowViewShadowWidth; 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface JPTransitionShadowView : UIView 19 | 20 | /** 21 | * Shadow imageView. 22 | */ 23 | @property(nonatomic, strong, readonly, nullable) UIImageView *shadowImv; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPTransitionShadowView.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPTransitionShadowView.h" 13 | #import "JPNavigationControllerCompat.h" 14 | 15 | static NSString *const kJPNavigationControllerShadowImagePath = @"JPNavigationController.bundle/shadow"; 16 | const CGFloat JPMixShadowViewShadowWidth = 21.f; 17 | @implementation JPTransitionShadowView 18 | 19 | - (instancetype)init{ 20 | self = [super init]; 21 | if (self) { 22 | [self setup]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)layoutSubviews{ 28 | [super layoutSubviews]; 29 | 30 | _shadowImv.frame = CGRectMake(0, 0, JPScreenW + JPMixShadowViewShadowWidth, JPScreenH); 31 | } 32 | 33 | 34 | #pragma mark - Private 35 | 36 | - (void)setup{ 37 | self.backgroundColor = [UIColor clearColor]; 38 | 39 | _shadowImv = ({ 40 | UIImageView *imv = [UIImageView new]; 41 | [self addSubview:imv]; 42 | imv.image = [UIImage imageNamed:kJPNavigationControllerShadowImagePath]; 43 | 44 | imv; 45 | }); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPWarpNavigationController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @protocol JPNavigationControllerDelegate; 17 | 18 | @interface JPWarpNavigationController : UINavigationController 19 | 20 | /** 21 | * Close or open pop gesture for current viewController in current root navigation controller. 22 | * NO by default. 23 | */ 24 | @property(nonatomic, assign, readonly) BOOL closePopForCurrentViewController; 25 | 26 | /** 27 | * Use custom pop animation for current viewController in current root navigation controller. 28 | * Default is NO. 29 | */ 30 | @property(nonatomic, assign, readonly) BOOL useCustomPopAnimationForCurrentViewController; 31 | 32 | /** 33 | * Link view height at screen bottom. 34 | */ 35 | @property(nonatomic, assign, readonly)CGFloat linkViewHeight; 36 | 37 | /** 38 | * Link view at screen bottom. 39 | * You just need pass your link view to this property, framework will display your link view automatically. 40 | * @warning if the viewController display in window currently is a `UITableViewController` class, frame will add a contentInset automatically to avoid the link view cover on `UITableViewController`. but if you add a `UITableView` on `UIViewController`, framework will do nothing for that, you may handle this by yourself. 41 | */ 42 | @property(nonatomic, strong, readonly)UIView * linkView; 43 | 44 | /** 45 | * Delegate to observer delegate events. 46 | * 47 | * @see JPNavigationControllerDelegate. 48 | */ 49 | @property(nonatomic, weak, readonly) id navigationDelegate; 50 | 51 | @end 52 | 53 | NS_ASSUME_NONNULL_END 54 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPWarpNavigationController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPWarpNavigationController.h" 13 | #import "JPNavigationController.h" 14 | #import "UIViewController+ViewControllers.h" 15 | #import "JPWarpViewController.h" 16 | #import "UIColor+ImageGenerate.h" 17 | #import "UINavigationController+FulllScreenPopPush.h" 18 | #import "JPNavigationControllerCompat.h" 19 | #import "UIView+ScreenCapture.h" 20 | #import "JPNavigationBar.h" 21 | 22 | @interface JPWarpNavigationController () 23 | 24 | /** 25 | * The root navigation controller. 26 | */ 27 | @property(nonatomic, weak) JPNavigationController *rootNavigationController; 28 | 29 | /** 30 | * Link container view. 31 | */ 32 | @property(nonatomic, strong) JPLinkContainerView *linkContainerView; 33 | 34 | @end 35 | 36 | static NSString *const kJPWarpNavigationControllerBackImageName = @"JPNavigationController.bundle/backImage"; 37 | 38 | @implementation JPWarpNavigationController 39 | 40 | - (instancetype)init{ 41 | self = [super init]; 42 | if (self) { 43 | [self _setup]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)viewDidLoad { 49 | [super viewDidLoad]; 50 | 51 | // Replace system's NavigationBar with custom NavigationBar. 52 | JPNavigationBar *customNavBar = [[JPNavigationBar alloc]init]; 53 | [self setValue:customNavBar forKey:@"navigationBar"]; 54 | 55 | // default color for navigation bar. 56 | [self.navigationBar setBackgroundImage:[[UIColor whiteColor] jp_image] forBarMetrics:UIBarMetricsDefault]; 57 | } 58 | 59 | - (UIViewController *)childViewControllerForStatusBarStyle{ 60 | return self.topViewController; 61 | } 62 | 63 | 64 | #pragma mark - JPNavigationControllerProtocol 65 | 66 | - (JPNavigationController *)jp_rootNavigationController{ 67 | return self.rootNavigationController; 68 | } 69 | 70 | - (void)setJp_interactivePopMaxAllowedInitialDistanceToLeftEdge:(CGFloat)jp_interactivePopMaxAllowedInitialDistanceToLeftEdge{ 71 | CGFloat distance = jp_interactivePopMaxAllowedInitialDistanceToLeftEdge; 72 | distance = MAX(0, distance); 73 | distance = MIN(distance, [UIScreen mainScreen].bounds.size.width); 74 | if (!self.rootNavigationController) { 75 | return; 76 | } 77 | [self.rootNavigationController setValue:@(distance) forKey:@"interactivePopMaxAllowedInitialDistanceToLeftEdge"]; 78 | } 79 | 80 | - (CGFloat)jp_interactivePopMaxAllowedInitialDistanceToLeftEdge{ 81 | if (self.rootNavigationController) { 82 | return [[self.rootNavigationController valueForKey:@"interactivePopMaxAllowedInitialDistanceToLeftEdge"] floatValue]; 83 | } 84 | return JPScreenW; 85 | } 86 | 87 | - (void)setJp_closePopForCurrentViewController:(BOOL)jp_closePopForCurrentViewController{ 88 | [self willChangeValueForKey:@"closePopForCurrentViewController"]; 89 | _closePopForCurrentViewController = jp_closePopForCurrentViewController; 90 | [self didChangeValueForKey:@"closePopForCurrentViewController"]; 91 | } 92 | 93 | - (BOOL)jp_closePopForCurrentViewController{ 94 | return _closePopForCurrentViewController; 95 | } 96 | 97 | - (void)setJp_closePopForAllViewControllers:(BOOL)jp_closePopForAllViewControllers{ 98 | if (!self.rootNavigationController) { 99 | return; 100 | } 101 | [self.rootNavigationController setValue:@(jp_closePopForAllViewControllers) forKey:@"closePopForAllViewControllers"]; 102 | } 103 | 104 | - (BOOL)jp_closePopForAllViewControllers{ 105 | if (self.rootNavigationController) { 106 | return [[self.rootNavigationController valueForKey:@"closePopForAllViewControllers"] boolValue]; 107 | } 108 | return NO; 109 | } 110 | 111 | - (void)setJp_useCustomPopAnimationForCurrentViewController:(BOOL)jp_useCustomPopAnimationForCurrentViewController{ 112 | [self willChangeValueForKey:@"useCustomPopAnimationForCurrentViewController"]; 113 | _useCustomPopAnimationForCurrentViewController = jp_useCustomPopAnimationForCurrentViewController; 114 | 115 | if (jp_useCustomPopAnimationForCurrentViewController) { 116 | [self.userViewController.jp_warpViewController addPopGesture]; 117 | } 118 | else{ 119 | [self.userViewController.jp_warpViewController removePopGesture];; 120 | } 121 | 122 | [self didChangeValueForKey:@"useCustomPopAnimationForCurrentViewController"]; 123 | } 124 | 125 | - (BOOL)jp_useCustomPopAnimationForCurrentViewController{ 126 | return _useCustomPopAnimationForCurrentViewController; 127 | } 128 | 129 | - (void)jp_registerNavigtionControllerDelegate:(id)delegate{ 130 | [self willChangeValueForKey:@"navigationDelegate"]; 131 | _navigationDelegate = delegate; 132 | [self didChangeValueForKey:@"navigationDelegate"]; 133 | } 134 | 135 | - (void)jp_popToViewControllerClassString:(NSString *)targetClassString handle:(JPNavigationContollerPopHandle)handle animated:(BOOL)animated{ 136 | SEL sel = NSSelectorFromString(@"popToViewController:"); 137 | NSMutableDictionary *arguments = [@{} mutableCopy]; 138 | if (targetClassString) { 139 | arguments[@"targetClassString"] = targetClassString; 140 | } 141 | if (handle) { 142 | arguments[@"handle"] = handle; 143 | } 144 | arguments[@"animated"] = @(animated); 145 | #pragma clang diagnostic push 146 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 147 | [self.rootNavigationController performSelector:sel withObject:[arguments copy]]; 148 | #pragma clang diagnostic pop 149 | } 150 | 151 | - (void)setJp_linkView:(UIView *)jp_linkView{ 152 | [self willChangeValueForKey:@"linkView"]; 153 | _linkView = jp_linkView; 154 | [self addLinkView]; 155 | [self didChangeValueForKey:@"linkView"]; 156 | } 157 | 158 | - (UIView *)jp_linkView{ 159 | return _linkView; 160 | } 161 | 162 | - (void)setJp_linkViewHeight:(CGFloat)jp_linkViewHeight{ 163 | [self willChangeValueForKey:@"linkViewHeight"]; 164 | _linkViewHeight = jp_linkViewHeight; 165 | [self addLinkView]; 166 | [self didChangeValueForKey:@"linkViewHeight"]; 167 | } 168 | 169 | - (CGFloat)jp_linkViewHeight{ 170 | return _linkViewHeight; 171 | } 172 | 173 | 174 | #pragma mark - Link View 175 | 176 | - (void)addLinkView{ 177 | 178 | // If jp_linkViewHeight > 0, we think have a link view in bottom. 179 | // framework will check the viewController passed in by use is a class of `UITableViewController` or not, if YES, framework will add a contentInset for this viewController. 180 | 181 | UIViewController *childViewController = self.viewControllers.firstObject; 182 | if (self.linkViewHeight > 0 && self.linkView) { 183 | 184 | if (self.linkView.superview) { 185 | return; 186 | } 187 | 188 | self.linkView.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, self.linkViewHeight); 189 | [self.linkContainerView addSubview:self.linkView]; 190 | 191 | if ([childViewController isKindOfClass:[UITableViewController class]]) { 192 | UITableViewController *aVc = (UITableViewController *)self.viewControllers.firstObject; 193 | aVc.tableView.contentInset = UIEdgeInsetsMake(0, 0, self.linkViewHeight, 0); 194 | // for test 195 | // NSLog(@"avc%@", NSStringFromUIEdgeInsets(aVc.tableView.contentInset)); 196 | } 197 | } 198 | } 199 | 200 | 201 | #pragma mark - Override 202 | 203 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ 204 | 205 | // call -initWithRootViewController: first view controller push in stack. 206 | JPNavigationController *rootNavigationController = [self rootNavigationController]; 207 | if (!rootNavigationController) { 208 | [super pushViewController:viewController animated:animated]; 209 | return; 210 | } 211 | 212 | // call pushViewController:animated:. 213 | viewController.jp_rootNavigationController = rootNavigationController; 214 | 215 | UIImage *backImg = [[UIImage imageNamed:kJPWarpNavigationControllerBackImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 216 | viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:backImg style:UIBarButtonItemStylePlain target:self action:@selector(didTapBackButton)]; 217 | 218 | JPWarpViewController *warpViewController = [[JPWarpViewController alloc]initWithRootViewController:viewController rootNavigationController:_rootNavigationController]; 219 | 220 | // capture screen for custom pop if need. 221 | if (self.view.window) { 222 | viewController.jp_screenCaptureImg = [self.view.window jp_captureCurrentView]; 223 | } 224 | 225 | [rootNavigationController pushViewController:warpViewController animated:animated]; 226 | } 227 | 228 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated{ 229 | return [self.rootNavigationController popViewControllerAnimated:animated]; 230 | } 231 | 232 | - (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated{ 233 | JPWarpViewController *warpVc = viewController.jp_warpViewController; 234 | if (warpVc) { 235 | return [self.rootNavigationController popToViewController:warpVc animated:animated]; 236 | } 237 | return nil; 238 | } 239 | 240 | - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated{ 241 | return [self.rootNavigationController popToRootViewControllerAnimated:animated]; 242 | } 243 | 244 | - (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion{ 245 | [self.rootNavigationController presentViewController:viewControllerToPresent animated:flag completion:completion]; 246 | } 247 | 248 | - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion{ 249 | [self.rootNavigationController dismissViewControllerAnimated:flag completion:completion]; 250 | } 251 | 252 | 253 | #pragma mark - Private 254 | 255 | - (JPLinkContainerView *)linkContainerView{ 256 | if (!_linkContainerView) { 257 | _linkContainerView = [JPLinkContainerView new]; 258 | _linkContainerView.backgroundColor = [UIColor clearColor]; 259 | _linkContainerView.frame = CGRectMake(0, JPScreenH - self.linkViewHeight - 20.f, JPScreenW, self.linkViewHeight); 260 | [self.navigationBar addSubview:_linkContainerView]; 261 | } 262 | return _linkContainerView; 263 | } 264 | 265 | - (void)_setup{ 266 | _closePopForCurrentViewController = NO; 267 | _useCustomPopAnimationForCurrentViewController = NO; 268 | } 269 | 270 | - (void)didTapBackButton{ 271 | [self.rootNavigationController popViewControllerAnimated:YES]; 272 | } 273 | 274 | - (UIViewController *)userViewController{ 275 | return self.childViewControllers.firstObject; 276 | } 277 | 278 | @end 279 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPWarpViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | @class JPNavigationController; 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface JPWarpViewController : UIViewController 19 | 20 | /** 21 | * The view Controller user passed in(the view controller be pushed in navigationController's stack now). 22 | * Use for help find the viewController wanna pop to in method popToViewController:animated:. 23 | * 24 | * @see jp_rootNavigationController 25 | */ 26 | @property(nonatomic, weak, readonly) UIViewController *userViewController; 27 | 28 | /** 29 | * Initially method. 30 | * This method be used for warping the ViewController from user by UINavigationController, then warp the UINavigationController by UIViewController and pass the overall ViewController back. Wanna know more details please see http://www.jianshu.com/p/88bc827f0692. 31 | * 32 | * @param rootViewController The viewController need be warped. 33 | * @param rootNavigationController The root navigation controller, @see JPNavigationController. 34 | * 35 | * @return The viewController be warped. 36 | */ 37 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController rootNavigationController:(JPNavigationController *)rootNavigationController; 38 | 39 | /** 40 | * Use customize pop gesture need add pop gesture in current viewController. 41 | */ 42 | - (void)addPopGesture; 43 | 44 | /** 45 | * Remove pop gesture in current viewController. 46 | */ 47 | - (void)removePopGesture; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/JPWarpViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPWarpViewController.h" 13 | #import "JPWarpNavigationController.h" 14 | #import "UIViewController+ViewControllers.h" 15 | #import "JPNavigationController.h" 16 | #import "JPNavigationControllerCompat.h" 17 | #import "JPTransitionShadowView.h" 18 | #import "JPNavigationControllerGestureRecognizer.h" 19 | 20 | @interface JPWarpViewController () 21 | 22 | /** 23 | * The warped navigation controller by self. 24 | */ 25 | @property(nonatomic, strong) JPWarpNavigationController *warpedNavigationController; 26 | 27 | /** 28 | * User viewController. 29 | */ 30 | @property(nonatomic, weak) UIViewController *userViewController; 31 | 32 | /** 33 | * Pop gesture. 34 | */ 35 | @property(nonatomic, strong) JPNavigationControllerGestureRecognizer *panGesture; 36 | 37 | /** 38 | * The current gesture is push or pop. 39 | */ 40 | @property(nonatomic, assign) JPNavigationControllerTransitionType transitionType; 41 | 42 | /** 43 | * ImageView for toViewController. 44 | */ 45 | @property(nonatomic, strong) UIImageView *toImv_anim; 46 | 47 | /** 48 | * Shadow View. 49 | */ 50 | @property(nonatomic, strong) JPTransitionShadowView *shadowView; 51 | 52 | @end 53 | 54 | static NSValue *kJPWarpViewControllerTabbarRectValue; 55 | // The borderline value devcide is need push pop or not when gesture end. 56 | const CGFloat kJPWarpViewControllerTransitionBorderlineDelta = 0.4; 57 | const CGFloat kJPWarpViewControllerTransitionDuration = 0.25; 58 | const CGFloat kJPWarpViewControllerInterlaceFactor = 0.3; 59 | @implementation JPWarpViewController 60 | 61 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController rootNavigationController:(JPNavigationController *)rootNavigationController{ 62 | 63 | // Alloc warpNav as B, warp the viewController user passed by B, then warp the B by self become C. 64 | 65 | self = [super init]; 66 | if (self) { 67 | rootViewController.jp_warpViewController = self; 68 | 69 | JPWarpNavigationController *warpNav = [[JPWarpNavigationController alloc] initWithRootViewController:rootViewController]; 70 | [warpNav setValue:rootNavigationController forKey:@"rootNavigationController"]; 71 | [self addChildViewController:warpNav]; 72 | 73 | _userViewController = rootViewController; 74 | _warpedNavigationController = warpNav; 75 | } 76 | return self; 77 | } 78 | 79 | - (void)viewDidLoad { 80 | [super viewDidLoad]; 81 | 82 | self.view.backgroundColor = [UIColor whiteColor]; 83 | [self.view addSubview:_warpedNavigationController.view]; 84 | _transitionType = JPNavigationControllerTransitionTypeNone; 85 | } 86 | 87 | - (UIViewController *)childViewControllerForStatusBarStyle{ 88 | return self.childViewControllers.firstObject; 89 | } 90 | 91 | - (void)addPopGesture{ 92 | _panGesture = ({ 93 | JPNavigationControllerGestureRecognizer *panGesture = [[JPNavigationControllerGestureRecognizer alloc]initWithTarget:self action:@selector(gestureDidTriggered:)]; 94 | [self.view addGestureRecognizer:panGesture]; 95 | panGesture.maximumNumberOfTouches = 1; 96 | JPNavigationController *rootNav = _userViewController.jp_rootNavigationController; 97 | panGesture.delegate = rootNav; 98 | panGesture.gestureType = JPNavigationControllerGestureRecognizerTypeWarp; 99 | [panGesture addTarget:rootNav action:NSSelectorFromString(@"gestureDidTriggered:")]; 100 | 101 | panGesture; 102 | }); 103 | } 104 | 105 | - (void)removePopGesture{ 106 | _panGesture.delegate = nil; 107 | [_panGesture removeTarget:self action:@selector(gestureDidTriggered:)]; 108 | _panGesture = nil; 109 | } 110 | 111 | 112 | #pragma mark - Gesture 113 | 114 | - (void)gestureDidTriggered:(JPNavigationControllerGestureRecognizer *)gestureRecognizer{ 115 | 116 | // Calculate the percent of the point origin-X / screen width, alloc UIPercentDrivenInteractiveTransition instance when push start, and check user is overrided the protocol method or not, if overrided, then start push and, set start percent = 0. 117 | // Refresh the slip percent when pan gesture changed. 118 | // Judge the slip percent is more than the JPPushBorderlineDelta when pan gesture end. 119 | 120 | 121 | CGFloat progress = [gestureRecognizer translationInView:gestureRecognizer.view].x / gestureRecognizer.view.bounds.size.width; 122 | 123 | if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { 124 | _transitionType = JPNavigationControllerTransitionTypePop; 125 | 126 | // add animation imageView. 127 | self.toImv_anim.image = [_userViewController jp_screenCaptureImg]; 128 | self.toImv_anim.frame = CGRectMake(-kJPWarpViewControllerInterlaceFactor * JPScreenW, 0, JPScreenW, JPScreenH); 129 | [self.view.superview insertSubview:self.toImv_anim atIndex:0]; 130 | 131 | // add shadow view. 132 | self.shadowView.frame = CGRectMake(-JPMixShadowViewShadowWidth, 0, JPScreenW + JPMixShadowViewShadowWidth, JPScreenH); 133 | [self.view.superview insertSubview:self.shadowView aboveSubview:self.toImv_anim]; 134 | 135 | } 136 | else if (gestureRecognizer.state == UIGestureRecognizerStateChanged) { 137 | { 138 | 139 | if (_transitionType != JPNavigationControllerTransitionTypePop) { 140 | return; 141 | } 142 | 143 | if (progress < 0) { 144 | progress = 0; 145 | } 146 | progress = MIN(1.0, MAX(0.0, progress)); 147 | 148 | CGFloat tx_to = JPScreenW * kJPWarpViewControllerInterlaceFactor * progress; 149 | self.toImv_anim.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, tx_to, 0); 150 | CGFloat tx_from = JPScreenW * progress; 151 | self.view.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, tx_from, 0); 152 | self.shadowView.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, tx_from, 0); 153 | } 154 | } 155 | else if (gestureRecognizer.state == UIGestureRecognizerStateEnded || gestureRecognizer.state == UIGestureRecognizerStateCancelled) { 156 | 157 | if (_transitionType != JPNavigationControllerTransitionTypePop) { 158 | return; 159 | } 160 | 161 | NSTimeInterval duration; 162 | 163 | if (progress > kJPWarpViewControllerTransitionBorderlineDelta) { 164 | duration = kJPWarpViewControllerTransitionDuration; 165 | 166 | [UIView animateWithDuration:duration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 167 | 168 | CGFloat tx_to = JPScreenW * kJPWarpViewControllerInterlaceFactor; 169 | self.toImv_anim.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, tx_to, 0); 170 | CGFloat tx_from = JPScreenW; 171 | self.view.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, tx_from, 0); 172 | self.shadowView.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, tx_from, 0); 173 | 174 | } completion:^(BOOL finished) { 175 | 176 | [_userViewController.navigationController popViewControllerAnimated:NO]; 177 | self.toImv_anim.transform = CGAffineTransformIdentity; 178 | self.view.transform = CGAffineTransformIdentity; 179 | self.shadowView.transform = CGAffineTransformIdentity; 180 | [self.toImv_anim removeFromSuperview]; 181 | [self.shadowView removeFromSuperview]; 182 | 183 | }]; 184 | } 185 | else { 186 | duration = kJPWarpViewControllerTransitionDuration * progress; 187 | 188 | [UIView animateWithDuration:duration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 189 | 190 | self.toImv_anim.transform = CGAffineTransformIdentity; 191 | self.view.transform = CGAffineTransformIdentity; 192 | self.shadowView.transform = CGAffineTransformIdentity; 193 | 194 | } completion:^(BOOL finished) { 195 | 196 | [self.toImv_anim removeFromSuperview]; 197 | [self.shadowView removeFromSuperview]; 198 | 199 | }]; 200 | } 201 | 202 | _transitionType = JPNavigationControllerTransitionTypeNone; 203 | } 204 | } 205 | 206 | 207 | #pragma mark - Override 208 | 209 | - (BOOL)hidesBottomBarWhenPushed{ 210 | return _userViewController.hidesBottomBarWhenPushed; 211 | } 212 | 213 | 214 | #pragma mark - Private 215 | 216 | - (JPTransitionShadowView *)shadowView{ 217 | if (!_shadowView) { 218 | _shadowView = [JPTransitionShadowView new]; 219 | } 220 | return _shadowView; 221 | } 222 | 223 | - (UIImageView *)toImv_anim{ 224 | if (!_toImv_anim) { 225 | _toImv_anim = [UIImageView new]; 226 | } 227 | return _toImv_anim; 228 | } 229 | 230 | @end 231 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/UIColor+ImageGenerate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface UIColor (ImageGenerate) 17 | 18 | /** 19 | * Generate an image with the color instance. 20 | * 21 | * @return the generated image. 22 | */ 23 | - (UIImage *)jp_image; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/UIColor+ImageGenerate.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "UIColor+ImageGenerate.h" 13 | 14 | @implementation UIColor (ImageGenerate) 15 | 16 | - (UIImage *)jp_image{ 17 | CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); 18 | 19 | UIGraphicsBeginImageContext(rect.size); 20 | CGContextRef context = UIGraphicsGetCurrentContext(); 21 | CGContextSetFillColorWithColor(context, [self CGColor]); 22 | CGContextFillRect(context, rect); 23 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); 24 | 25 | UIGraphicsEndImageContext(); 26 | return theImage; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/UINavigationController+FulllScreenPopPush.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "JPNavigationControllerProtocol.h" 13 | 14 | @interface UINavigationController (FulllScreenPopPush) 15 | 16 | @end 17 | 18 | 19 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/UIView+ScreenCapture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface UIView (ScreenCapture) 17 | 18 | /** 19 | * Capture current view generate a image. 20 | * 21 | * @return a image of current view. 22 | */ 23 | - (UIImage *)jp_captureCurrentView; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/UIView+ScreenCapture.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "UIView+ScreenCapture.h" 13 | #import "JPNavigationControllerCompat.h" 14 | 15 | @implementation UIView (ScreenCapture) 16 | 17 | - (UIImage *)jp_captureCurrentView{ 18 | UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0); 19 | [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES]; 20 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 21 | UIGraphicsEndImageContext(); 22 | return image; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/UIViewController+ViewControllers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @class JPNavigationController, JPWarpViewController; 17 | 18 | @interface UIViewController (ViewControllers) 19 | 20 | /** 21 | * Root NavigationController. 22 | * 23 | * @see JPNavigationController. 24 | */ 25 | @property(nonatomic) JPNavigationController *jp_rootNavigationController; 26 | 27 | /** 28 | * Warp ViewController. 29 | * 30 | * @see JPWarpViewController. 31 | */ 32 | @property(nonatomic) JPWarpViewController *jp_warpViewController; 33 | 34 | /** 35 | * Screen capture image for last viewController. 36 | * 37 | * @see JPWarpNavigationController. 38 | */ 39 | @property(nonatomic) UIImage *jp_screenCaptureImg; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/JPNavigationController/UIViewController+ViewControllers.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JPNavigationController package. 3 | * (c) NewPan <13246884282@163.com> 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | * 8 | * Click https://github.com/newyjp 9 | * or http://www.jianshu.com/users/e2f2d779c022/latest_articles to contact me. 10 | */ 11 | 12 | #import "UIViewController+ViewControllers.h" 13 | #import 14 | 15 | static char kJPNavigationControllerRootNavigationKey; 16 | static char kJPNavigationControllerWarpViewControllerKey; 17 | static char kJPNavigationControllerScreenCaptureImageKey; 18 | 19 | @implementation UIViewController (ViewControllers) 20 | 21 | - (void)setJp_rootNavigationController:(JPNavigationController *)jp_rootNavigationController{ 22 | objc_setAssociatedObject(self, &kJPNavigationControllerRootNavigationKey, jp_rootNavigationController, OBJC_ASSOCIATION_ASSIGN); 23 | } 24 | 25 | - (JPNavigationController *)jp_rootNavigationController{ 26 | return objc_getAssociatedObject(self, &kJPNavigationControllerRootNavigationKey); 27 | } 28 | 29 | - (void)setJp_warpViewController:(JPWarpViewController *)jp_warpViewController{ 30 | objc_setAssociatedObject(self, &kJPNavigationControllerWarpViewControllerKey, jp_warpViewController, OBJC_ASSOCIATION_ASSIGN); 31 | } 32 | 33 | - (JPWarpViewController *)jp_warpViewController{ 34 | return objc_getAssociatedObject(self, &kJPNavigationControllerWarpViewControllerKey); 35 | } 36 | 37 | - (void)setJp_screenCaptureImg:(UIImage *)jp_screenCaptureImg{ 38 | objc_setAssociatedObject(self, &kJPNavigationControllerScreenCaptureImageKey, jp_screenCaptureImg, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 39 | } 40 | 41 | - (UIImage *)jp_screenCaptureImg{ 42 | return objc_getAssociatedObject(self, &kJPNavigationControllerScreenCaptureImageKey); 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 NewPan 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 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JPNavigationController/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | 5 |

6 | 7 | [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/newyjp/JPNavigationController) [![pod](https://img.shields.io/badge/pod-2.0.0-green.svg)](https://github.com/newyjp/JPNavigationController) [![pod](https://img.shields.io/badge/platform-iOS-yellow.svg)](https://github.com/newyjp/JPNavigationController) [![pod](https://img.shields.io/badge/about%20me-NewPan-red.svg)](http://www.jianshu.com/users/e2f2d779c022/latest_articles) 8 | ![pod](https://img.shields.io/travis/rust-lang/rust/master.svg) 9 | 10 | This library provides an fullScreen pop and push gesture for UINavigationController with customize UINavigationBar for each single support and, smooth playing video use `AVPlayer` when perform pop gesture support. 11 | 12 |

13 | 14 |

15 | 16 | 17 | ## Features 18 | 19 | - [x] FullScreen pop gesture support 20 | - [x] FullScreen push gesture support 21 | - [x] Customize UINavigationBar for each single viewController support 22 | - [x] Add link view hovering in screen bottom support 23 | - [x] Customize pop and push gesture distance on the left side of the screen support 24 | - [x] Close pop gesture for single viewController support 25 | - [x] Close pop gesture for all viewController support 26 | - [x] Smooth playing video use `AVPlayer` when perform pop gesture support 27 | 28 | 29 | ## Requirements 30 | 31 | - iOS 8.0 or later 32 | - Xcode 8.0 or later 33 | 34 | 35 | ## Getting Started 36 | 37 | - Read the [[iOS]UINavigationController全屏 pop 之为每个控制器自定义 UINavigationBar](http://www.jianshu.com/p/88bc827f0692) 38 | - Read the [[iOS]UINavigationController全屏 pop 之为每个控制器添加底部联动视图](http://www.jianshu.com/p/3ed21414551a) 39 | - Read the [[iOS]UINavigationController全屏 pop 之为控制器添加左滑 push](http://www.jianshu.com/p/ff68b5e646fc) 40 | - Read the [[iOS]调和 pop 手势导致 AVPlayer 播放卡顿](http://www.jianshu.com/p/be02059b9e6a) 41 | - Try the example by downloading the project from Github 42 | 43 | 44 | ## Communication 45 | 46 | - If you **found a bug**, open an issue. 47 | - If you **have a feature request**, open an issue. 48 | - If you **want to contribute**, submit a pull request. 49 | 50 | 51 | ## Installation 52 | 53 | ## How To Use 54 | 55 | #### Initialize 56 | 57 | ```objective-c 58 | Objective-C: 59 | 60 | #import 61 | 62 | JPNavigationController *nav = [[JPNavigationController alloc]initWithRootViewController:YourVc]; 63 | ``` 64 | 65 | #### PushViewController 66 | 67 | ```objective-c 68 | Objective-C: 69 | 70 | [self.navigationController pushViewController:YourVc animated:YES]; 71 | ``` 72 | 73 | #### PopToViewController 74 | 75 | ```objective-c 76 | Objective-C: 77 | 78 | [self.navigationController popViewControllerAnimated:YES]; 79 | 80 | [self.navigationController popToRootViewControllerAnimated:YES]; 81 | 82 | 83 | // Pop to a given view controller. 84 | 85 | // Plan A: find the target view controller by youself, then pop it. 86 | JPNavigationControllerDemo_linkBar *vc = nil; 87 | NSArray *viewControllers = self.navigationController.jp_rootNavigationController.jp_viewControllers; 88 | for (UIViewController *c in viewControllers) { 89 | if ([c isKindOfClass:[JPNavigationControllerDemo_linkBar class]]) { 90 | vc = (JPNavigationControllerDemo_linkBar *)c; 91 |        break; 92 |    } 93 | } 94 | 95 | if (vc) { 96 | [self.navigationController popToViewController:vc animated:YES]; 97 | } 98 | 99 | 100 | // Plan B: use jp_popToViewControllerClassString:handle:animated:. 101 | [self.navigationController jp_popToViewControllerClassString:@"JPNavigationControllerDemo_linkBar" handle:^UIViewController * _Nullable(NSArray * _Nullable viewControllers, NSError * _Nullable error) { 102 | 103 | if (!error) { 104 | return viewControllers.firstObject; 105 | } 106 | else{ 107 | NSLog(@"%@", error); 108 | return nil; 109 | } 110 | 111 | } animated:YES]; 112 | ``` 113 | 114 | 115 | #### Custom UINavigationBar 116 | 117 | ```objective-c 118 | Objective-C: 119 | 120 | // Hide navigation bar. 121 | self.navigationController.navigationBarHidden = YES; 122 | 123 | // Customize UINavigationBar color 124 | [self.navigationController.navigationBar setBackgroundImage:aImage forBarMetrics:UIBarMetricsDefault]; 125 | 126 | ``` 127 | 128 | #### Add push gesture connect viewController 129 | 130 | ```objective-c 131 | Objective-C: 132 | 133 | // Become the delegate of JPNavigationControllerDelegate protocol and, implemented protocol method, then you own left-slip to push function. 134 | [self.navigationController jp_registerNavigtionControllerDelegate:self]; 135 | 136 | // Implementation protocol method 137 | - (void)navigationControllerDidPush:(JPNavigationController *)navigationController{ 138 | [self.navigationController pushViewController:YourVc animated:YES]; 139 | } 140 | ``` 141 | 142 | #### Add link view hovering in screen bottom 143 | 144 | ```objective-c 145 | Objective-C: 146 | 147 | // Return the link view in the be pushed viewController. 148 | - (void)viewDidLoad{ 149 | [super viewDidLoad]; 150 | 151 | YourVc.navigationController.jp_linkViewHeight = 44.0f; 152 | self.navigationController.jp_linkView = YourLinkView; 153 | } 154 | ``` 155 | 156 | 157 | #### Customize pop gesture distance 158 | 159 | ```objective-c 160 | Objective-C: 161 | 162 | self.navigationController.jp_interactivePopMaxAllowedInitialDistanceToLeftEdge = aValue; 163 | ``` 164 | 165 | #### Close pop gesture for single viewController 166 | 167 | ```objective-c 168 | Objective-C: 169 | 170 | self.navigationController.jp_closePopForAllViewController = YES; 171 | ``` 172 | 173 | 174 | #### Close pop gesture for all viewController 175 | 176 | ```objective-c 177 | Objective-C: 178 | 179 | self.navigationController.jp_closePopForAllViewController = YES; 180 | ``` 181 | 182 | #### Use custom pop animation when contain AVPlayer 183 | 184 | ```objective-c 185 | Objective-C: 186 | 187 | self.navigationController.jp_useCustomPopAnimationForCurrentViewController = YES; 188 | ``` 189 | 190 | Installation 191 | ------------ 192 | 193 | There are two ways to use JPNavigationController in your project: 194 | - using CocoaPods 195 | - by cloning the project into your repository 196 | 197 | ### Installation with CocoaPods 198 | 199 | [CocoaPods](http://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details. 200 | 201 | #### Podfile 202 | ``` 203 | platform :ios, '8.0' 204 | target “YourProjectName” do 205 | pod 'JPNavigationController', '~> 2.0.0' 206 | end 207 | ``` 208 | 209 | ## Licenses 210 | 211 | All source code is licensed under the [MIT License](https://github.com/newyjp/JPNavigationController/blob/master/LICENSE). 212 | 213 | 214 | 如果你在天朝 215 | ------------ 216 | 217 | 框架支持为 UINavigationController 提供全屏 pop 和 push 手势支持, 并且你可以为每个控制器自定义 UINavigationBar, 注意, 每个控制器的 UINavigationBar 是互不干扰的. 实现基于AOP思想, 不会侵入你的项目. 218 | 219 | ## 特性 220 | 221 | - [x] 全屏 pop 手势支持 222 | - [x] 全屏 push 到绑定的控制器支持 223 | - [x] 为每个控制器定制 UINavigationBar 支持(包括设置颜色和透明度) 224 | - [x] 为每个控制器添加底部联动视图支持 225 | - [x] 自定义 pop 手势范围支持(从屏幕最左侧开始计算宽度) 226 | - [x] 为单个控制器关闭 pop 手势支持 227 | - [x] 为所有控制器关闭 pop 手势支持 228 | - [x] 当当前控制器使用 `AVPlayer` 播放视频的时候, 使用自定义的 pop 动画以保证 `AVPlayer` 流畅播放. 229 | 230 | 231 | ## 组件要求 232 | 233 | - iOS 8.0 or later 234 | - Xcode 8.0 or later 235 | 236 | 237 | ## 了解实现思路和源码解析 238 | 239 | - 阅读我的简书文章 [[iOS]UINavigationController全屏 pop 之为每个控制器自定义UINavigationBar](http://www.jianshu.com/p/88bc827f0692) 240 | - 阅读我的简书文章 [[iOS]UINavigationController 全屏 pop 之为每个控制器添加底部联动视图](http://www.jianshu.com/p/3ed21414551a) 241 | - 阅读我的简书文章 [[iOS]UINavigationController全屏 pop 之为控制器添加左滑 push](http://www.jianshu.com/p/ff68b5e646fc) 242 | - 阅读我的简书文章 [[iOS]调和 pop 手势导致 AVPlayer 播放卡顿](http://www.jianshu.com/p/be02059b9e6a) 243 | 244 | - 下载我Github上的demo 245 | 246 | 247 | ## 联系 248 | 249 | - 如果你发现了bug, 请帮我提交issue 250 | - 如果你有好的建议, 请帮我提交issue 251 | - 如果你想贡献代码, 请提交请求 252 | 253 | 254 | ## 安装 255 | 256 | ## 具体使用 257 | 258 | #### 初始化 259 | 260 | ```objective-c 261 | Objective-C: 262 | 263 | #import 264 | 265 | JPNavigationController *nav = [[JPNavigationController alloc]initWithRootViewController:YourVc]; 266 | ``` 267 | 268 | #### PushViewController 269 | 270 | ```objective-c 271 | Objective-C: 272 | 273 | [self.navigationController pushViewController:YourVc animated:YES]; 274 | ``` 275 | 276 | #### PopToViewController 277 | 278 | ```objective-c 279 | Objective-C: 280 | 281 | [self.navigationController popViewControllerAnimated:YES]; 282 | 283 | [self.navigationController popToRootViewControllerAnimated:YES]; 284 | 285 | 286 | // 弹出到指定的控制器 287 | 288 | // 方案A: 找到目标控制器, pop 289 | JPNavigationControllerDemo_linkBar *vc = nil; 290 | NSArray *viewControllers = self.navigationController.jp_rootNavigationController.jp_viewControllers; 291 | for (UIViewController *c in viewControllers) { 292 | if ([c isKindOfClass:[JPNavigationControllerDemo_linkBar class]]) { 293 | vc = (JPNavigationControllerDemo_linkBar *)c; 294 |     break; 295 |    } 296 | } 297 | 298 | if (vc) { 299 | [self.navigationController popToViewController:vc animated:YES]; 300 | } 301 | 302 | 303 | // 方案 B: jp_popToViewControllerClassString:handle:animated:. 304 | [self.navigationController jp_popToViewControllerClassString:@"JPNavigationControllerDemo_linkBar" handle:^UIViewController * _Nullable(NSArray * _Nullable viewControllers, NSError * _Nullable error) { 305 | 306 | if (!error) { 307 | return viewControllers.firstObject; 308 | } 309 | else{ 310 | NSLog(@"%@", error); 311 | return nil; 312 | } 313 | 314 | } animated:YES]; 315 | ``` 316 | 317 | 318 | #### 自定义 UINavigationBar 319 | 320 | ```objective-c 321 | Objective-C: 322 | 323 | // 隐藏导航条. 324 | self.navigationController.navigationBarHidden = YES; 325 | 326 | // 自定义 UINavigationBar 颜色 327 | [self.navigationController.navigationBar setBackgroundImage:aImage forBarMetrics:UIBarMetricsDefault]; 328 | 329 | ``` 330 | 331 | #### 添加push手势绑定控制器 332 | 333 | ```objective-c 334 | Objective-C: 335 | 336 | // 成为JPNavigationControllerDelegate协议的代理, 实现协议方法即可拥有左滑push功能. 337 | [self.navigationController jp_registerNavigtionControllerDelegate:self]; 338 | 339 | // 实现协议方法 340 | - (void)jp_navigationControllerDidPushLeft{ 341 | [self.navigationController pushViewController:YourVc animated:YES]; 342 | } 343 | ``` 344 | 345 | #### 添加底部联动视图支持 346 | 347 | ```objective-c 348 | Objective-C: 349 | 350 | // 你只需要在 viewDidLoad: 方法里把你的联动视图传给框架, 框架会制动帮你显示. 351 | -(void)viewDidLoad{ 352 | [super viewDidLoad]; 353 | YourVc.navigationController.jp_linkViewHeight = 44.0f; 354 | self.navigationController.jp_linkView = YourLinkView; 355 | } 356 | ``` 357 | 358 | 359 | #### 自定义 pop 手势响应范围 360 | 361 | ```objective-c 362 | Objective-C: 363 | 364 | self.navigationController.jp_interactivePopMaxAllowedInitialDistanceToLeftEdge = aValue; 365 | ``` 366 | 367 | #### 禁用单个控制器 pop 手势 368 | 369 | ```objective-c 370 | Objective-C: 371 | 372 | self.navigationController.jp_closePopForAllViewController = YES; 373 | ``` 374 | 375 | 376 | #### 禁用所有控制器 pop 手势 377 | 378 | ```objective-c 379 | Objective-C: 380 | 381 | self.navigationController.jp_closePopForAllViewController = YES; 382 | ``` 383 | 384 | #### 因为界面中有 AVPLayer 在播放视频, 所以为了保证 pop 手势执行的过程中视频能正常播放, 使用自定义的 pop 动画 385 | ```objective-c 386 | Objective-C: 387 | 388 | self.navigationController.jp_useCustomPopAnimationForCurrentViewController = YES; 389 | ``` 390 | 391 | 集成到你的项目 392 | ------------ 393 | 394 | 两种选择把框架集成到你的项目: 395 | - 使用 CocoaPods 396 | - 下载我的demo, 把'JPNavigationController'文件夹拽到你的项目中 397 | 398 | ### 使用 CocoaPods 安装 399 | 400 | [CocoaPods](http://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details. 401 | 402 | #### Podfile 403 | ``` 404 | platform :ios, '8.0' 405 | target “YourProjectName” do 406 | pod 'JPNavigationController', '~> 2.0.0' 407 | end 408 | ``` 409 | 410 | ## 证书 411 | 412 | All source code is licensed under the [MIT License](https://github.com/newyjp/JPNavigationController/blob/master/LICENSE). 413 | 414 | 415 | 416 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JRSwizzle/JRSwizzle.h: -------------------------------------------------------------------------------- 1 | // JRSwizzle.h semver:1.0 2 | // Copyright (c) 2007-2011 Jonathan 'Wolf' Rentzsch: http://rentzsch.com 3 | // Some rights reserved: http://opensource.org/licenses/MIT 4 | // https://github.com/rentzsch/jrswizzle 5 | 6 | #import 7 | 8 | @interface NSObject (JRSwizzle) 9 | 10 | + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**)error_; 11 | + (BOOL)jr_swizzleClassMethod:(SEL)origSel_ withClassMethod:(SEL)altSel_ error:(NSError**)error_; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JRSwizzle/JRSwizzle.m: -------------------------------------------------------------------------------- 1 | // JRSwizzle.m semver:1.0 2 | // Copyright (c) 2007-2011 Jonathan 'Wolf' Rentzsch: http://rentzsch.com 3 | // Some rights reserved: http://opensource.org/licenses/MIT 4 | // https://github.com/rentzsch/jrswizzle 5 | 6 | #import "JRSwizzle.h" 7 | 8 | #if TARGET_OS_IPHONE 9 | #import 10 | #import 11 | #else 12 | #import 13 | #endif 14 | 15 | #define SetNSErrorFor(FUNC, ERROR_VAR, FORMAT,...) \ 16 | if (ERROR_VAR) { \ 17 | NSString *errStr = [NSString stringWithFormat:@"%s: " FORMAT,FUNC,##__VA_ARGS__]; \ 18 | *ERROR_VAR = [NSError errorWithDomain:@"NSCocoaErrorDomain" \ 19 | code:-1 \ 20 | userInfo:[NSDictionary dictionaryWithObject:errStr forKey:NSLocalizedDescriptionKey]]; \ 21 | } 22 | #define SetNSError(ERROR_VAR, FORMAT,...) SetNSErrorFor(__func__, ERROR_VAR, FORMAT, ##__VA_ARGS__) 23 | 24 | #if OBJC_API_VERSION >= 2 25 | #define GetClass(obj) object_getClass(obj) 26 | #else 27 | #define GetClass(obj) (obj ? obj->isa : Nil) 28 | #endif 29 | 30 | @implementation NSObject (JRSwizzle) 31 | 32 | + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**)error_ { 33 | #if OBJC_API_VERSION >= 2 34 | Method origMethod = class_getInstanceMethod(self, origSel_); 35 | if (!origMethod) { 36 | #if TARGET_OS_IPHONE 37 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self class]); 38 | #else 39 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); 40 | #endif 41 | return NO; 42 | } 43 | 44 | Method altMethod = class_getInstanceMethod(self, altSel_); 45 | if (!altMethod) { 46 | #if TARGET_OS_IPHONE 47 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self class]); 48 | #else 49 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); 50 | #endif 51 | return NO; 52 | } 53 | 54 | class_addMethod(self, 55 | origSel_, 56 | class_getMethodImplementation(self, origSel_), 57 | method_getTypeEncoding(origMethod)); 58 | class_addMethod(self, 59 | altSel_, 60 | class_getMethodImplementation(self, altSel_), 61 | method_getTypeEncoding(altMethod)); 62 | 63 | method_exchangeImplementations(class_getInstanceMethod(self, origSel_), class_getInstanceMethod(self, altSel_)); 64 | return YES; 65 | #else 66 | // Scan for non-inherited methods. 67 | Method directOriginalMethod = NULL, directAlternateMethod = NULL; 68 | 69 | void *iterator = NULL; 70 | struct objc_method_list *mlist = class_nextMethodList(self, &iterator); 71 | while (mlist) { 72 | int method_index = 0; 73 | for (; method_index < mlist->method_count; method_index++) { 74 | if (mlist->method_list[method_index].method_name == origSel_) { 75 | assert(!directOriginalMethod); 76 | directOriginalMethod = &mlist->method_list[method_index]; 77 | } 78 | if (mlist->method_list[method_index].method_name == altSel_) { 79 | assert(!directAlternateMethod); 80 | directAlternateMethod = &mlist->method_list[method_index]; 81 | } 82 | } 83 | mlist = class_nextMethodList(self, &iterator); 84 | } 85 | 86 | // If either method is inherited, copy it up to the target class to make it non-inherited. 87 | if (!directOriginalMethod || !directAlternateMethod) { 88 | Method inheritedOriginalMethod = NULL, inheritedAlternateMethod = NULL; 89 | if (!directOriginalMethod) { 90 | inheritedOriginalMethod = class_getInstanceMethod(self, origSel_); 91 | if (!inheritedOriginalMethod) { 92 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); 93 | return NO; 94 | } 95 | } 96 | if (!directAlternateMethod) { 97 | inheritedAlternateMethod = class_getInstanceMethod(self, altSel_); 98 | if (!inheritedAlternateMethod) { 99 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); 100 | return NO; 101 | } 102 | } 103 | 104 | int hoisted_method_count = !directOriginalMethod && !directAlternateMethod ? 2 : 1; 105 | struct objc_method_list *hoisted_method_list = malloc(sizeof(struct objc_method_list) + (sizeof(struct objc_method)*(hoisted_method_count-1))); 106 | hoisted_method_list->obsolete = NULL; // soothe valgrind - apparently ObjC runtime accesses this value and it shows as uninitialized in valgrind 107 | hoisted_method_list->method_count = hoisted_method_count; 108 | Method hoisted_method = hoisted_method_list->method_list; 109 | 110 | if (!directOriginalMethod) { 111 | bcopy(inheritedOriginalMethod, hoisted_method, sizeof(struct objc_method)); 112 | directOriginalMethod = hoisted_method++; 113 | } 114 | if (!directAlternateMethod) { 115 | bcopy(inheritedAlternateMethod, hoisted_method, sizeof(struct objc_method)); 116 | directAlternateMethod = hoisted_method; 117 | } 118 | class_addMethods(self, hoisted_method_list); 119 | } 120 | 121 | // Swizzle. 122 | IMP temp = directOriginalMethod->method_imp; 123 | directOriginalMethod->method_imp = directAlternateMethod->method_imp; 124 | directAlternateMethod->method_imp = temp; 125 | 126 | return YES; 127 | #endif 128 | } 129 | 130 | + (BOOL)jr_swizzleClassMethod:(SEL)origSel_ withClassMethod:(SEL)altSel_ error:(NSError**)error_ { 131 | return [GetClass((id)self) jr_swizzleMethod:origSel_ withMethod:altSel_ error:error_]; 132 | } 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/JRSwizzle/README.markdown: -------------------------------------------------------------------------------- 1 | # JRSwizzle 2 | 3 | ## Description 4 | 5 | JRSwizzle is source code package that offers a single, easy, correct+consistent interface for exchanging Objective-C method implementations ("method swizzling") across many versions of Mac OS X, iOS, Objective-C and runtime architectures. 6 | 7 | More succinctly: *JRSwizzle wants to be your one-stop-shop for all your method swizzling needs.* 8 | 9 | ## Download 10 | 11 | $ cd /path/to/top/of/your/project 12 | $ git submodule add git://github.com/rentzsch/jrswizzle.git JRSwizzle 13 | $ git submodule init && git submodule update 14 | 15 | # OPTIONAL: Execute the following commands if you want to explicitly peg 16 | # to a certain version. Otherwise `git submodule update` will keep you 17 | # current with HEAD. 18 | 19 | $ cd JRSwizzle 20 | $ git checkout v1.0 21 | 22 | ## Reasons for Existence 23 | 24 | * **Easy:** Just do this: `[SomeClass jr_swizzle:@selector(foo) withMethod:@selector(my_foo) error:&error];` Voila. 25 | * **Correct:** There's a subtle interaction between method swizzling and method inheritance. Following in Kevin Ballard's footsteps, this package Does The Right Thing. 26 | * **Compatible:** JRSwizzle should Just Work on any version of Mac OS X and iOS you care about. Here's the exhaustive compatibility list: 27 | * Mac OS X v10.3/ppc (Ballard implementation) 28 | * Mac OS X v10.4/ppc (Ballard implementation) 29 | * Mac OS X v10.4/i386 (Ballard implementation) 30 | * Mac OS X v10.5/ppc (method_exchangeImplementations+Ballard implementation) 31 | * Mac OS X v10.5/i386 (method_exchangeImplementations+Ballard implementation) 32 | * Mac OS X v10.5/ppc64 (method_exchangeImplementations+Ballard implementation) 33 | * Mac OS X v10.5/x86_64 (method_exchangeImplementations+Ballard implementation) 34 | * iOS 2.0+ (method_exchangeImplementations+Ballard implementation) 35 | * **Robust:** All parameters are checked and JRSwizzle returns an optional `NSError` with high-quality diagnostics. 36 | 37 | ## Support 38 | 39 | Please use [JRSwizzle's GitHub Issues tab](https://github.com/rentzsch/jrswizzle/issues) to [file bugs or feature requests](https://github.com/rentzsch/jrswizzle/issues/new). 40 | 41 | To contribute, please fork this project, make+commit your changes and then send me a pull request. 42 | 43 | ## Comparison 44 | 45 | There's at least four swizzling implementations floating around. Here's a comparison chart to help you make sense of how they relate to each other and why JRSwizzle exists. 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 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 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 |
ScenarioSwizzle TechnologyMethod ImplementationCorrect Behavior10.464-bit
1ClassicDirectYESYESNO
2ClassicInheritedNOYESNO
3BallardDirectYESYESNO
4BallardInheritedYESYESNO
5AppleDirectYESNOYES
6AppleInheritedNONOYES
7JRSwizzleDirectYESYESYES
8JRSwizzleInheritedYESYESYES
121 | 122 | * *Classic* is the canonical `MethodSwizzle()` implementation as described in [CocoaDev's MethodSwizzling page](http://www.cocoadev.com/index.pl?MethodSwizzling). 123 | * *Ballard* is [Kevin Ballard's improved implementation](http://kevin.sb.org/2006/12/30/method-swizzling-reimplemented/) which solves the inherited method problem. 124 | * *Apple* is 10.5's new `method_exchangeImplementations` API. 125 | * *JRSwizzle* is this package. 126 | 127 | ## License 128 | 129 | The source code is distributed under the nonviral [MIT License](http://opensource.org/licenses/mit-license.php). It's the simplest most permissive license available. 130 | 131 | ## Version History 132 | 133 | * **v1.0:** Mar 2 2012 134 | 135 | * [NEW] iOS Support. ([Anton Serebryakov](https://github.com/rentzsch/jrswizzle/commit/60ccb350a3577e55d00d3fdfee8b3c0390b8e852])) 136 | 137 | * [NEW] Class method swizzling. ([outis](https://github.com/rentzsch/jrswizzle/pull/1)) 138 | 139 | * **v1.0d1:** May 31 2009 140 | 141 | * [FIX] Soothe valgrind by nulling out `hoisted_method_list->obsolete`, which it apparently reads. ([Daniel Jalkut](http://github.com/rentzsch/jrswizzle/commit/2f677d063202b443ca7a1c46e8b67d67ea6fc88e)) 142 | 143 | * [FIX] Xcode 3.2 apparently now needs `ARCHS` set explicitly for 10.3 targets. ([rentzsch](http://github.com/rentzsch/jrswizzle/commit/4478faa40e4fdb322201da20f24d3996193ea48b)) 144 | 145 | * **v1.0d0:** Apr 09 2009 146 | 147 | * Moved to github. 148 | 149 | * **v1.0d0:** Dec 28 2007 150 | 151 | * Under development. -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JPNavigationController (2.0.1) 3 | - JRSwizzle (1.0) 4 | 5 | DEPENDENCIES: 6 | - JPNavigationController (~> 2.0.1) 7 | - JRSwizzle 8 | 9 | SPEC CHECKSUMS: 10 | JPNavigationController: cdafaa66f238363ef34f8a11d559fd9f33dfff82 11 | JRSwizzle: dd5ead5d913a0f29e7f558200165849f006bb1e3 12 | 13 | PODFILE CHECKSUM: f6c7b5745834b0ea6522d4d12867bcb2e8a92b50 14 | 15 | COCOAPODS: 1.2.0 16 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Pods.xcodeproj/xcuserdata/NewPan.xcuserdatad/xcschemes/JPNavigationController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Pods.xcodeproj/xcuserdata/NewPan.xcuserdatad/xcschemes/JRSwizzle.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Pods.xcodeproj/xcuserdata/NewPan.xcuserdatad/xcschemes/Pods-BLLandscapeDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Pods.xcodeproj/xcuserdata/NewPan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JPNavigationController.xcscheme 8 | 9 | isShown 10 | 11 | 12 | JRSwizzle.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-BLLandscapeDemo.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 0606AE1E7696CCFE3E1400A92489A474 26 | 27 | primary 28 | 29 | 30 | 37BC76CE3F2AB5AE4C6F1899C9B92908 31 | 32 | primary 33 | 34 | 35 | 915E8FEADDA0644106187EA8CE7B2E00 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/JPNavigationController/JPNavigationController-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_JPNavigationController : NSObject 3 | @end 4 | @implementation PodsDummy_JPNavigationController 5 | @end 6 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/JPNavigationController/JPNavigationController-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/JPNavigationController/JPNavigationController.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/JPNavigationController 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/JPNavigationController" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JPNavigationController" "${PODS_ROOT}/Headers/Public/JRSwizzle" 4 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JPNavigationController 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/JRSwizzle/JRSwizzle-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_JRSwizzle : NSObject 3 | @end 4 | @implementation PodsDummy_JRSwizzle 5 | @end 6 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/JRSwizzle/JRSwizzle-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/JRSwizzle/JRSwizzle.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/JRSwizzle 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/JRSwizzle" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JPNavigationController" "${PODS_ROOT}/Headers/Public/JRSwizzle" 4 | OTHER_LDFLAGS = -framework "Foundation" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JRSwizzle 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## JPNavigationController 5 | 6 | MIT License 7 | 8 | Copyright (c) 2016 NewPan 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2016 NewPan 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | License 40 | MIT 41 | Title 42 | JPNavigationController 43 | Type 44 | PSGroupSpecifier 45 | 46 | 47 | FooterText 48 | Generated by CocoaPods - https://cocoapods.org 49 | Title 50 | 51 | Type 52 | PSGroupSpecifier 53 | 54 | 55 | StringsTable 56 | Acknowledgements 57 | Title 58 | Acknowledgements 59 | 60 | 61 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BLLandscapeDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BLLandscapeDemo 5 | @end 6 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 63 | 64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 65 | code_sign_cmd="$code_sign_cmd &" 66 | fi 67 | echo "$code_sign_cmd" 68 | eval "$code_sign_cmd" 69 | fi 70 | } 71 | 72 | # Strip invalid architectures 73 | strip_invalid_archs() { 74 | binary="$1" 75 | # Get architectures for current file 76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 77 | stripped="" 78 | for arch in $archs; do 79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 80 | # Strip non-valid architectures in-place 81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 82 | stripped="$stripped $arch" 83 | fi 84 | done 85 | if [[ "$stripped" ]]; then 86 | echo "Stripped $binary of architectures:$stripped" 87 | fi 88 | } 89 | 90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 91 | wait 92 | fi 93 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | 3) 22 | TARGET_DEVICE_ARGS="--target-device tv" 23 | ;; 24 | *) 25 | TARGET_DEVICE_ARGS="--target-device mac" 26 | ;; 27 | esac 28 | 29 | install_resource() 30 | { 31 | if [[ "$1" = /* ]] ; then 32 | RESOURCE_PATH="$1" 33 | else 34 | RESOURCE_PATH="${PODS_ROOT}/$1" 35 | fi 36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 37 | cat << EOM 38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 39 | EOM 40 | exit 1 41 | fi 42 | case $RESOURCE_PATH in 43 | *.storyboard) 44 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 45 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 46 | ;; 47 | *.xib) 48 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 49 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 50 | ;; 51 | *.framework) 52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | ;; 57 | *.xcdatamodel) 58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 60 | ;; 61 | *.xcdatamodeld) 62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 64 | ;; 65 | *.xcmappingmodel) 66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 68 | ;; 69 | *.xcassets) 70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 72 | ;; 73 | *) 74 | echo "$RESOURCE_PATH" 75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 76 | ;; 77 | esac 78 | } 79 | if [[ "$CONFIGURATION" == "Debug" ]]; then 80 | install_resource "JPNavigationController/JPNavigationController/JPNavigationController.bundle" 81 | fi 82 | if [[ "$CONFIGURATION" == "Release" ]]; then 83 | install_resource "JPNavigationController/JPNavigationController/JPNavigationController.bundle" 84 | fi 85 | 86 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 89 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 90 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | fi 92 | rm -f "$RESOURCES_TO_COPY" 93 | 94 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 95 | then 96 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 97 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 98 | while read line; do 99 | if [[ $line != "${PODS_ROOT}*" ]]; then 100 | XCASSET_FILES+=("$line") 101 | fi 102 | done <<<"$OTHER_XCASSETS" 103 | 104 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 105 | fi 106 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JPNavigationController" "${PODS_ROOT}/Headers/Public/JRSwizzle" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/JPNavigationController" "$PODS_CONFIGURATION_BUILD_DIR/JRSwizzle" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/JPNavigationController" -isystem "${PODS_ROOT}/Headers/Public/JRSwizzle" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"JPNavigationController" -l"JRSwizzle" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /BLLandscapeDemo/Pods/Target Support Files/Pods-BLLandscapeDemo/Pods-BLLandscapeDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JPNavigationController" "${PODS_ROOT}/Headers/Public/JRSwizzle" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/JPNavigationController" "$PODS_CONFIGURATION_BUILD_DIR/JRSwizzle" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/JPNavigationController" -isystem "${PODS_ROOT}/Headers/Public/JRSwizzle" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"JPNavigationController" -l"JRSwizzle" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BLLandscape 2 | [iOS]终极横竖屏切换解决方案。 3 | 4 | ### 详见简书 [[iOS]终极横竖屏切换解决方案](http://www.jianshu.com/p/42bc210f574b) 5 | --------------------------------------------------------------------------------