├── .DS_Store
├── Navi手势返回动画.gif
├── YRBackGestureDemo
├── YRBackGestureDemo
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── ViewController.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── YRBackGestureDemo-Prefix.pch
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── YRBackGestureDemo-Info.plist
│ ├── ViewController.m
│ └── AppDelegate.m
├── YRBackGestureDemoTests
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── YRBackGestureDemoTests-Info.plist
│ └── YRBackGestureDemoTests.m
├── .DS_Store
└── YRBackGestureDemo.xcodeproj
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── YueRuo.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── YRBackGestureDemo.xccheckout
│ ├── xcuserdata
│ └── YueRuo.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── YRBackGestureDemo.xcscheme
│ └── project.pbxproj
├── YRBackGesture
├── .DS_Store
├── UINavigationController+YRBackGesture.h
└── UINavigationController+YRBackGesture.m
├── README.md
└── LICENSE
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YueRuo/UINavigationController-YRBackGesture/HEAD/.DS_Store
--------------------------------------------------------------------------------
/Navi手势返回动画.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YueRuo/UINavigationController-YRBackGesture/HEAD/Navi手势返回动画.gif
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemoTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/YRBackGesture/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YueRuo/UINavigationController-YRBackGesture/HEAD/YRBackGesture/.DS_Store
--------------------------------------------------------------------------------
/YRBackGestureDemo/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YueRuo/UINavigationController-YRBackGesture/HEAD/YRBackGestureDemo/.DS_Store
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo.xcodeproj/project.xcworkspace/xcuserdata/YueRuo.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YueRuo/UINavigationController-YRBackGesture/HEAD/YRBackGestureDemo/YRBackGestureDemo.xcodeproj/project.xcworkspace/xcuserdata/YueRuo.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // YRBackGestureDemo
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 YueRuo. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // YRBackGestureDemo
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 YueRuo. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // YRBackGestureDemo
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 YueRuo. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "AppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/YRBackGestureDemo-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_3_0
10 | #warning "This project uses features only available in iOS SDK 3.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/YRBackGesture/UINavigationController+YRBackGesture.h:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationController+YRBackGesture.h
3 | // Mark
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 王晓宇. All rights reserved.
7 | //
8 |
9 | /*!
10 | * @class let NavigationController support slide to right to back to previous VC
11 | */
12 | #import
13 |
14 | #define BackGestureOffsetXToBack 80//>80 show pre vc
15 |
16 | @interface UINavigationController (YRBackGesture)
17 | /*!
18 | * @brief Default is NO;
19 | * @note need call this after ViewDidLoad otherwise not work;
20 | */
21 | @property (assign,nonatomic) BOOL enableBackGesture;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo.xcodeproj/xcuserdata/YueRuo.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | YRBackGestureDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 5F29EA67196BA556007335C3
16 |
17 | primary
18 |
19 |
20 | 5F29EA82196BA556007335C3
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemoTests/YRBackGestureDemoTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.yueruo.common.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemoTests/YRBackGestureDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // YRBackGestureDemoTests.m
3 | // YRBackGestureDemoTests
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 YueRuo. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YRBackGestureDemoTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation YRBackGestureDemoTests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | UINavigationController-YRBackGesture
2 | ====================================
3 |
4 | Custom slide to right gesture to show previous view controller , similar to iOS7 back gesture but work not only at left edge
5 |
6 | ####简单介绍
7 | iOS7之后,支持右滑返回手势,但是默认的右滑手势只能在左边线工作,且只能iOS7以上使用。
8 |
9 | 而目前很多APP的右滑返回都可以支持几乎全屏的操作,更加简单,比如网易新闻APP。
10 |
11 | 这里我做了个Category,`带视差效果`,`支持iOS4以上系统`
12 | 使用方式非常简单:
13 | 1. 导入头文件
14 | 2. 对NavigationController调用开启方法:
15 |
16 | [navi setEnableBackGesture:true];
17 |
18 | 具体效果可以看demo和底下的效果动画。
19 |
20 | ######PS:
21 | 这种右滑手势,目前网上有另外一种解决方案,采用Push前截屏保存页面快照的方式实现,缺点是如果前一个页面有动态效果则不能正常展现。个人不是很喜欢,毕竟有些前一个页面的动态效果可能还是需要在滑动过程中展现。
22 | 而本Category基于navi中的各个VC的view调用处理,能很好的展现前一个页面的动画,指示器等等。
23 | 当然缺点也有:不支持顶部的NavigationBar一起移动,不过个人一直都是使用自定义的顶部导航,因此无此问题。
24 | 另外,如支持iOS7以上,可以使用新的Transition实现该手势效果。
25 |
26 | 希望能对大家有所帮助。
27 |
28 | 
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 YueRuo
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.
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/YRBackGestureDemo-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | com.yueruo.common.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo.xcodeproj/project.xcworkspace/xcshareddata/YRBackGestureDemo.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 3D7C7E6C-B405-4828-BE33-3B6960A413D9
9 | IDESourceControlProjectName
10 | YRBackGestureDemo
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 81514E78-5472-4045-A728-0A8A718E182B
14 | ssh://github.com/YueRuo/UINavigationController-YRBackGesture.git
15 |
16 | IDESourceControlProjectPath
17 | YRBackGestureDemo/YRBackGestureDemo.xcodeproj/project.xcworkspace
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 81514E78-5472-4045-A728-0A8A718E182B
21 | ../../..
22 |
23 | IDESourceControlProjectURL
24 | ssh://github.com/YueRuo/UINavigationController-YRBackGesture.git
25 | IDESourceControlProjectVersion
26 | 110
27 | IDESourceControlProjectWCCIdentifier
28 | 81514E78-5472-4045-A728-0A8A718E182B
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 81514E78-5472-4045-A728-0A8A718E182B
36 | IDESourceControlWCCName
37 | YRBackGesture
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // YRBackGestureDemo
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 YueRuo. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
18 | {
19 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
20 | if (self) {
21 | // Custom initialization
22 | }
23 | return self;
24 | }
25 |
26 | - (void)viewDidLoad
27 | {
28 | [super viewDidLoad];
29 | // Do any additional setup after loading the view.
30 |
31 | CGFloat randomR=arc4random()%255/255.0f;
32 | CGFloat randomG=arc4random()%255/255.0f;
33 |
34 | UIButton *pushButton=[[UIButton alloc]initWithFrame:CGRectMake(20, 80, 120, 50)];
35 | [pushButton setBackgroundColor:[UIColor colorWithRed:randomR green:randomG blue:0.8 alpha:1]];
36 | [pushButton setTitle:@"Push" forState:UIControlStateNormal];
37 | [pushButton addTarget:self action:@selector(pushNewVC) forControlEvents:UIControlEventTouchUpInside];
38 | [self.view addSubview:pushButton];
39 |
40 | UIActivityIndicatorView *indicatorView=[[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(130, 200, 60, 60)];
41 | [indicatorView setBackgroundColor:[UIColor colorWithRed:randomR green:randomG blue:0.8 alpha:1]];
42 | [self.view addSubview:indicatorView];
43 | [indicatorView startAnimating];
44 |
45 | UILabel *tipsLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 170, 320, 30)];
46 | [tipsLabel setTextAlignment:NSTextAlignmentCenter];
47 | [tipsLabel setText:@"支持动态效果,指示器不停"];
48 | [self.view addSubview:tipsLabel];
49 | }
50 |
51 | - (void)didReceiveMemoryWarning
52 | {
53 | [super didReceiveMemoryWarning];
54 | // Dispose of any resources that can be recreated.
55 | }
56 |
57 | /*
58 | #pragma mark - Navigation
59 |
60 | // In a storyboard-based application, you will often want to do a little preparation before navigation
61 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
62 | {
63 | // Get the new view controller using [segue destinationViewController].
64 | // Pass the selected object to the new view controller.
65 | }
66 | */
67 |
68 | -(void)pushNewVC{
69 | ViewController *newViewController=[[ViewController alloc]initWithNibName:nil bundle:nil];
70 | CGFloat randomR=arc4random()%255/255.0f;
71 | CGFloat randomG=arc4random()%255/255.0f;
72 | [newViewController.view setBackgroundColor:[UIColor colorWithRed:randomR green:randomG blue:0.8 alpha:1]];
73 | [self.navigationController pushViewController:newViewController animated:true];
74 | }
75 |
76 | @end
77 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // YRBackGestureDemo
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 YueRuo. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "ViewController.h"
11 | #import "UINavigationController+YRBackGesture.h"
12 |
13 | @implementation AppDelegate
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16 | {
17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
18 | // Override point for customization after application launch.
19 | self.window.backgroundColor = [UIColor whiteColor];
20 |
21 | ViewController *viewController=[[ViewController alloc]initWithNibName:nil bundle:nil];
22 |
23 | UINavigationController *navigationController=[[UINavigationController alloc]initWithRootViewController:viewController];
24 | [navigationController setEnableBackGesture:true];//开启手势
25 |
26 | self.window.rootViewController=navigationController;
27 |
28 | [self.window makeKeyAndVisible];
29 | return YES;
30 | }
31 |
32 | - (void)applicationWillResignActive:(UIApplication *)application
33 | {
34 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
35 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
36 | }
37 |
38 | - (void)applicationDidEnterBackground:(UIApplication *)application
39 | {
40 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
42 | }
43 |
44 | - (void)applicationWillEnterForeground:(UIApplication *)application
45 | {
46 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
47 | }
48 |
49 | - (void)applicationDidBecomeActive:(UIApplication *)application
50 | {
51 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
52 | }
53 |
54 | - (void)applicationWillTerminate:(UIApplication *)application
55 | {
56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo.xcodeproj/xcuserdata/YueRuo.xcuserdatad/xcschemes/YRBackGestureDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/YRBackGesture/UINavigationController+YRBackGesture.m:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationController+YRBackGesture.m
3 | // Mark
4 | //
5 | // Created by 王晓宇 on 14-7-8.
6 | // Copyright (c) 2014年 王晓宇. All rights reserved.
7 | //
8 |
9 | #import "UINavigationController+YRBackGesture.h"
10 | #import
11 |
12 | static const char *assoKeyPanGesture="__yrakpanges";
13 | static const char *assoKeyStartPanPoint="__yrakstartp";
14 | static const char *assoKeyEnableGesture="__yrakenabg";
15 |
16 | @implementation UINavigationController (YRBackGesture)
17 | -(BOOL)enableBackGesture{
18 | NSNumber *enableGestureNum = objc_getAssociatedObject(self, assoKeyEnableGesture);
19 | if (enableGestureNum) {
20 | return [enableGestureNum boolValue];
21 | }
22 | return false;
23 | }
24 | -(void)setEnableBackGesture:(BOOL)enableBackGesture{
25 | NSNumber *enableGestureNum = [NSNumber numberWithBool:enableBackGesture];
26 | objc_setAssociatedObject(self, assoKeyEnableGesture, enableGestureNum, OBJC_ASSOCIATION_RETAIN);
27 | if (enableBackGesture) {
28 | [self.view addGestureRecognizer:[self panGestureRecognizer]];
29 | }else{
30 | [self.view removeGestureRecognizer:[self panGestureRecognizer]];
31 | }
32 | }
33 | -(UIPanGestureRecognizer *)panGestureRecognizer{
34 | UIPanGestureRecognizer *panGestureRecognizer = objc_getAssociatedObject(self, assoKeyPanGesture);
35 | if (!panGestureRecognizer) {
36 | panGestureRecognizer=[[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panToBack:)];
37 | [panGestureRecognizer setDelegate:self];
38 | objc_setAssociatedObject(self, assoKeyPanGesture, panGestureRecognizer, OBJC_ASSOCIATION_RETAIN);
39 | }
40 | return panGestureRecognizer;
41 | }
42 | -(void)setStartPanPoint:(CGPoint)point{
43 | NSValue *startPanPointValue = [NSValue valueWithCGPoint:point];
44 | objc_setAssociatedObject(self, assoKeyStartPanPoint, startPanPointValue, OBJC_ASSOCIATION_RETAIN);
45 | }
46 | -(CGPoint)startPanPoint{
47 | NSValue *startPanPointValue = objc_getAssociatedObject(self, assoKeyStartPanPoint);
48 | if (!startPanPointValue) {
49 | return CGPointZero;
50 | }
51 | return [startPanPointValue CGPointValue];
52 | }
53 |
54 | -(void)panToBack:(UIPanGestureRecognizer*)pan{
55 | UIView *currentView=self.topViewController.view;
56 | if (self.panGestureRecognizer.state==UIGestureRecognizerStateBegan) {
57 | [self setStartPanPoint:currentView.frame.origin];
58 | CGPoint velocity=[pan velocityInView:self.view];
59 | if(velocity.x!=0){
60 | [self willShowPreViewController];
61 | }
62 | return;
63 | }
64 | CGPoint currentPostion = [pan translationInView:self.view];
65 | CGFloat xoffset = [self startPanPoint].x + currentPostion.x;
66 | CGFloat yoffset = [self startPanPoint].y + currentPostion.y;
67 | if (xoffset>0) {//向右滑
68 | // if (true) {
69 | // xoffset = xoffset>self.view.frame.size.width?self.view.frame.size.width:xoffset;
70 | // }else{
71 | // xoffset = 0;
72 | // }
73 | }else if(xoffset<0){//向左滑
74 | if (currentView.frame.origin.x>0) {
75 | xoffset = xoffset<-self.view.frame.size.width?-self.view.frame.size.width:xoffset;
76 | }else{
77 | xoffset = 0;
78 | }
79 | }
80 | if (!CGPointEqualToPoint(CGPointMake(xoffset, yoffset), currentView.frame.origin)) {
81 |
82 | if (xoffset <= 0) {//修复滑动过程中快速左滑会出现偏移或闪屏的bug
83 | xoffset = 0;
84 | }
85 |
86 | [self layoutCurrentViewWithOffset:UIOffsetMake(xoffset, yoffset)];
87 | }
88 | if (self.panGestureRecognizer.state==UIGestureRecognizerStateEnded) {
89 | if (currentView.frame.origin.x==0) {
90 | }else{
91 | if (currentView.frame.origin.x1) {
104 | UIViewController *currentVC = [self topViewController];
105 | UIViewController *preVC = [self.viewControllers objectAtIndex:count-2];
106 | [currentVC.view.superview insertSubview:preVC.view belowSubview:currentVC.view];
107 | }
108 | }
109 | -(void)showPreViewController{
110 | NSInteger count = self.viewControllers.count;
111 | if (count>1) {
112 | UIView *currentView = self.topViewController.view;
113 | NSTimeInterval animatedTime = 0;
114 | animatedTime = ABS(self.view.frame.size.width - currentView.frame.origin.x) / self.view.frame.size.width * 0.35;
115 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
116 | [UIView animateWithDuration:animatedTime animations:^{
117 | [self layoutCurrentViewWithOffset:UIOffsetMake(self.view.frame.size.width, 0)];
118 | } completion:^(BOOL finished) {
119 | [self popViewControllerAnimated:false];
120 | }];
121 | }
122 | }
123 | -(void)hidePreViewController{
124 | NSInteger count = self.viewControllers.count;
125 | if (count>1) {
126 | UIViewController *preVC = [self.viewControllers objectAtIndex:count-2];
127 | UIView *currentView = self.topViewController.view;
128 | NSTimeInterval animatedTime = 0;
129 | animatedTime = ABS(self.view.frame.size.width - currentView.frame.origin.x) / self.view.frame.size.width * 0.35;
130 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
131 | [UIView animateWithDuration:animatedTime animations:^{
132 | [self layoutCurrentViewWithOffset:UIOffsetMake(0, 0)];
133 | } completion:^(BOOL finished) {
134 | [preVC.view removeFromSuperview];
135 | }];
136 | }
137 | }
138 |
139 | -(void)layoutCurrentViewWithOffset:(UIOffset)offset{
140 | NSInteger count = self.viewControllers.count;
141 | if (count>1) {
142 | UIViewController *currentVC = [self topViewController];
143 | UIViewController *preVC = [self.viewControllers objectAtIndex:count-2];
144 | [currentVC.view setFrame:CGRectMake(offset.horizontal, self.view.bounds.origin.y, self.view.frame.size.width, currentVC.view.frame.size.height)];
145 | [preVC.view setFrame:CGRectMake(offset.horizontal/2-self.view.frame.size.width/2, self.view.bounds.origin.y, self.view.frame.size.width, preVC.view.frame.size.height)];
146 | }
147 | }
148 |
149 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
150 | if (gestureRecognizer == self.panGestureRecognizer) {
151 | UIPanGestureRecognizer *panGesture = (UIPanGestureRecognizer*)gestureRecognizer;
152 | CGPoint translation = [panGesture translationInView:self.view];
153 | if ([panGesture velocityInView:self.view].x < 600 && ABS(translation.x)/ABS(translation.y)>1) {
154 | return true;
155 | }
156 | return false;
157 | }
158 | return true;
159 | }
160 |
161 | @end
162 |
--------------------------------------------------------------------------------
/YRBackGestureDemo/YRBackGestureDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 5F29EA6C196BA556007335C3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F29EA6B196BA556007335C3 /* Foundation.framework */; };
11 | 5F29EA6E196BA556007335C3 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F29EA6D196BA556007335C3 /* CoreGraphics.framework */; };
12 | 5F29EA70196BA556007335C3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F29EA6F196BA556007335C3 /* UIKit.framework */; };
13 | 5F29EA76196BA556007335C3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5F29EA74196BA556007335C3 /* InfoPlist.strings */; };
14 | 5F29EA78196BA556007335C3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F29EA77196BA556007335C3 /* main.m */; };
15 | 5F29EA7C196BA556007335C3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F29EA7B196BA556007335C3 /* AppDelegate.m */; };
16 | 5F29EA7E196BA556007335C3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5F29EA7D196BA556007335C3 /* Images.xcassets */; };
17 | 5F29EA85196BA556007335C3 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F29EA84196BA556007335C3 /* XCTest.framework */; };
18 | 5F29EA86196BA556007335C3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F29EA6B196BA556007335C3 /* Foundation.framework */; };
19 | 5F29EA87196BA556007335C3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F29EA6F196BA556007335C3 /* UIKit.framework */; };
20 | 5F29EA8F196BA556007335C3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5F29EA8D196BA556007335C3 /* InfoPlist.strings */; };
21 | 5F29EA91196BA556007335C3 /* YRBackGestureDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F29EA90196BA556007335C3 /* YRBackGestureDemoTests.m */; };
22 | 5F29EA9D196BA55F007335C3 /* UINavigationController+YRBackGesture.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F29EA9C196BA55F007335C3 /* UINavigationController+YRBackGesture.m */; };
23 | 5F29EAA0196BA57C007335C3 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F29EA9F196BA57C007335C3 /* ViewController.m */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXContainerItemProxy section */
27 | 5F29EA88196BA556007335C3 /* PBXContainerItemProxy */ = {
28 | isa = PBXContainerItemProxy;
29 | containerPortal = 5F29EA60196BA556007335C3 /* Project object */;
30 | proxyType = 1;
31 | remoteGlobalIDString = 5F29EA67196BA556007335C3;
32 | remoteInfo = YRBackGestureDemo;
33 | };
34 | /* End PBXContainerItemProxy section */
35 |
36 | /* Begin PBXFileReference section */
37 | 5F29EA68196BA556007335C3 /* YRBackGestureDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YRBackGestureDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
38 | 5F29EA6B196BA556007335C3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
39 | 5F29EA6D196BA556007335C3 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
40 | 5F29EA6F196BA556007335C3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
41 | 5F29EA73196BA556007335C3 /* YRBackGestureDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "YRBackGestureDemo-Info.plist"; sourceTree = ""; };
42 | 5F29EA75196BA556007335C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
43 | 5F29EA77196BA556007335C3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
44 | 5F29EA79196BA556007335C3 /* YRBackGestureDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YRBackGestureDemo-Prefix.pch"; sourceTree = ""; };
45 | 5F29EA7A196BA556007335C3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
46 | 5F29EA7B196BA556007335C3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
47 | 5F29EA7D196BA556007335C3 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
48 | 5F29EA83196BA556007335C3 /* YRBackGestureDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YRBackGestureDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
49 | 5F29EA84196BA556007335C3 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
50 | 5F29EA8C196BA556007335C3 /* YRBackGestureDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "YRBackGestureDemoTests-Info.plist"; sourceTree = ""; };
51 | 5F29EA8E196BA556007335C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
52 | 5F29EA90196BA556007335C3 /* YRBackGestureDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRBackGestureDemoTests.m; sourceTree = ""; };
53 | 5F29EA9B196BA55F007335C3 /* UINavigationController+YRBackGesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+YRBackGesture.h"; sourceTree = ""; };
54 | 5F29EA9C196BA55F007335C3 /* UINavigationController+YRBackGesture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+YRBackGesture.m"; sourceTree = ""; };
55 | 5F29EA9E196BA57C007335C3 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
56 | 5F29EA9F196BA57C007335C3 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
57 | /* End PBXFileReference section */
58 |
59 | /* Begin PBXFrameworksBuildPhase section */
60 | 5F29EA65196BA556007335C3 /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | 5F29EA6E196BA556007335C3 /* CoreGraphics.framework in Frameworks */,
65 | 5F29EA70196BA556007335C3 /* UIKit.framework in Frameworks */,
66 | 5F29EA6C196BA556007335C3 /* Foundation.framework in Frameworks */,
67 | );
68 | runOnlyForDeploymentPostprocessing = 0;
69 | };
70 | 5F29EA80196BA556007335C3 /* Frameworks */ = {
71 | isa = PBXFrameworksBuildPhase;
72 | buildActionMask = 2147483647;
73 | files = (
74 | 5F29EA85196BA556007335C3 /* XCTest.framework in Frameworks */,
75 | 5F29EA87196BA556007335C3 /* UIKit.framework in Frameworks */,
76 | 5F29EA86196BA556007335C3 /* Foundation.framework in Frameworks */,
77 | );
78 | runOnlyForDeploymentPostprocessing = 0;
79 | };
80 | /* End PBXFrameworksBuildPhase section */
81 |
82 | /* Begin PBXGroup section */
83 | 5F29EA5F196BA556007335C3 = {
84 | isa = PBXGroup;
85 | children = (
86 | 5F29EA71196BA556007335C3 /* YRBackGestureDemo */,
87 | 5F29EA8A196BA556007335C3 /* YRBackGestureDemoTests */,
88 | 5F29EA6A196BA556007335C3 /* Frameworks */,
89 | 5F29EA69196BA556007335C3 /* Products */,
90 | );
91 | sourceTree = "";
92 | };
93 | 5F29EA69196BA556007335C3 /* Products */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 5F29EA68196BA556007335C3 /* YRBackGestureDemo.app */,
97 | 5F29EA83196BA556007335C3 /* YRBackGestureDemoTests.xctest */,
98 | );
99 | name = Products;
100 | sourceTree = "";
101 | };
102 | 5F29EA6A196BA556007335C3 /* Frameworks */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 5F29EA6B196BA556007335C3 /* Foundation.framework */,
106 | 5F29EA6D196BA556007335C3 /* CoreGraphics.framework */,
107 | 5F29EA6F196BA556007335C3 /* UIKit.framework */,
108 | 5F29EA84196BA556007335C3 /* XCTest.framework */,
109 | );
110 | name = Frameworks;
111 | sourceTree = "";
112 | };
113 | 5F29EA71196BA556007335C3 /* YRBackGestureDemo */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 5F29EA9A196BA55F007335C3 /* YRBackGesture */,
117 | 5F29EA7A196BA556007335C3 /* AppDelegate.h */,
118 | 5F29EA7B196BA556007335C3 /* AppDelegate.m */,
119 | 5F29EA7D196BA556007335C3 /* Images.xcassets */,
120 | 5F29EA72196BA556007335C3 /* Supporting Files */,
121 | 5F29EA9E196BA57C007335C3 /* ViewController.h */,
122 | 5F29EA9F196BA57C007335C3 /* ViewController.m */,
123 | );
124 | path = YRBackGestureDemo;
125 | sourceTree = "";
126 | };
127 | 5F29EA72196BA556007335C3 /* Supporting Files */ = {
128 | isa = PBXGroup;
129 | children = (
130 | 5F29EA73196BA556007335C3 /* YRBackGestureDemo-Info.plist */,
131 | 5F29EA74196BA556007335C3 /* InfoPlist.strings */,
132 | 5F29EA77196BA556007335C3 /* main.m */,
133 | 5F29EA79196BA556007335C3 /* YRBackGestureDemo-Prefix.pch */,
134 | );
135 | name = "Supporting Files";
136 | sourceTree = "";
137 | };
138 | 5F29EA8A196BA556007335C3 /* YRBackGestureDemoTests */ = {
139 | isa = PBXGroup;
140 | children = (
141 | 5F29EA90196BA556007335C3 /* YRBackGestureDemoTests.m */,
142 | 5F29EA8B196BA556007335C3 /* Supporting Files */,
143 | );
144 | path = YRBackGestureDemoTests;
145 | sourceTree = "";
146 | };
147 | 5F29EA8B196BA556007335C3 /* Supporting Files */ = {
148 | isa = PBXGroup;
149 | children = (
150 | 5F29EA8C196BA556007335C3 /* YRBackGestureDemoTests-Info.plist */,
151 | 5F29EA8D196BA556007335C3 /* InfoPlist.strings */,
152 | );
153 | name = "Supporting Files";
154 | sourceTree = "";
155 | };
156 | 5F29EA9A196BA55F007335C3 /* YRBackGesture */ = {
157 | isa = PBXGroup;
158 | children = (
159 | 5F29EA9B196BA55F007335C3 /* UINavigationController+YRBackGesture.h */,
160 | 5F29EA9C196BA55F007335C3 /* UINavigationController+YRBackGesture.m */,
161 | );
162 | name = YRBackGesture;
163 | path = ../../YRBackGesture;
164 | sourceTree = "";
165 | };
166 | /* End PBXGroup section */
167 |
168 | /* Begin PBXNativeTarget section */
169 | 5F29EA67196BA556007335C3 /* YRBackGestureDemo */ = {
170 | isa = PBXNativeTarget;
171 | buildConfigurationList = 5F29EA94196BA556007335C3 /* Build configuration list for PBXNativeTarget "YRBackGestureDemo" */;
172 | buildPhases = (
173 | 5F29EA64196BA556007335C3 /* Sources */,
174 | 5F29EA65196BA556007335C3 /* Frameworks */,
175 | 5F29EA66196BA556007335C3 /* Resources */,
176 | );
177 | buildRules = (
178 | );
179 | dependencies = (
180 | );
181 | name = YRBackGestureDemo;
182 | productName = YRBackGestureDemo;
183 | productReference = 5F29EA68196BA556007335C3 /* YRBackGestureDemo.app */;
184 | productType = "com.apple.product-type.application";
185 | };
186 | 5F29EA82196BA556007335C3 /* YRBackGestureDemoTests */ = {
187 | isa = PBXNativeTarget;
188 | buildConfigurationList = 5F29EA97196BA556007335C3 /* Build configuration list for PBXNativeTarget "YRBackGestureDemoTests" */;
189 | buildPhases = (
190 | 5F29EA7F196BA556007335C3 /* Sources */,
191 | 5F29EA80196BA556007335C3 /* Frameworks */,
192 | 5F29EA81196BA556007335C3 /* Resources */,
193 | );
194 | buildRules = (
195 | );
196 | dependencies = (
197 | 5F29EA89196BA556007335C3 /* PBXTargetDependency */,
198 | );
199 | name = YRBackGestureDemoTests;
200 | productName = YRBackGestureDemoTests;
201 | productReference = 5F29EA83196BA556007335C3 /* YRBackGestureDemoTests.xctest */;
202 | productType = "com.apple.product-type.bundle.unit-test";
203 | };
204 | /* End PBXNativeTarget section */
205 |
206 | /* Begin PBXProject section */
207 | 5F29EA60196BA556007335C3 /* Project object */ = {
208 | isa = PBXProject;
209 | attributes = {
210 | LastUpgradeCheck = 0510;
211 | ORGANIZATIONNAME = YueRuo;
212 | TargetAttributes = {
213 | 5F29EA82196BA556007335C3 = {
214 | TestTargetID = 5F29EA67196BA556007335C3;
215 | };
216 | };
217 | };
218 | buildConfigurationList = 5F29EA63196BA556007335C3 /* Build configuration list for PBXProject "YRBackGestureDemo" */;
219 | compatibilityVersion = "Xcode 3.2";
220 | developmentRegion = English;
221 | hasScannedForEncodings = 0;
222 | knownRegions = (
223 | en,
224 | );
225 | mainGroup = 5F29EA5F196BA556007335C3;
226 | productRefGroup = 5F29EA69196BA556007335C3 /* Products */;
227 | projectDirPath = "";
228 | projectRoot = "";
229 | targets = (
230 | 5F29EA67196BA556007335C3 /* YRBackGestureDemo */,
231 | 5F29EA82196BA556007335C3 /* YRBackGestureDemoTests */,
232 | );
233 | };
234 | /* End PBXProject section */
235 |
236 | /* Begin PBXResourcesBuildPhase section */
237 | 5F29EA66196BA556007335C3 /* Resources */ = {
238 | isa = PBXResourcesBuildPhase;
239 | buildActionMask = 2147483647;
240 | files = (
241 | 5F29EA76196BA556007335C3 /* InfoPlist.strings in Resources */,
242 | 5F29EA7E196BA556007335C3 /* Images.xcassets in Resources */,
243 | );
244 | runOnlyForDeploymentPostprocessing = 0;
245 | };
246 | 5F29EA81196BA556007335C3 /* Resources */ = {
247 | isa = PBXResourcesBuildPhase;
248 | buildActionMask = 2147483647;
249 | files = (
250 | 5F29EA8F196BA556007335C3 /* InfoPlist.strings in Resources */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | /* End PBXResourcesBuildPhase section */
255 |
256 | /* Begin PBXSourcesBuildPhase section */
257 | 5F29EA64196BA556007335C3 /* Sources */ = {
258 | isa = PBXSourcesBuildPhase;
259 | buildActionMask = 2147483647;
260 | files = (
261 | 5F29EA9D196BA55F007335C3 /* UINavigationController+YRBackGesture.m in Sources */,
262 | 5F29EA7C196BA556007335C3 /* AppDelegate.m in Sources */,
263 | 5F29EAA0196BA57C007335C3 /* ViewController.m in Sources */,
264 | 5F29EA78196BA556007335C3 /* main.m in Sources */,
265 | );
266 | runOnlyForDeploymentPostprocessing = 0;
267 | };
268 | 5F29EA7F196BA556007335C3 /* Sources */ = {
269 | isa = PBXSourcesBuildPhase;
270 | buildActionMask = 2147483647;
271 | files = (
272 | 5F29EA91196BA556007335C3 /* YRBackGestureDemoTests.m in Sources */,
273 | );
274 | runOnlyForDeploymentPostprocessing = 0;
275 | };
276 | /* End PBXSourcesBuildPhase section */
277 |
278 | /* Begin PBXTargetDependency section */
279 | 5F29EA89196BA556007335C3 /* PBXTargetDependency */ = {
280 | isa = PBXTargetDependency;
281 | target = 5F29EA67196BA556007335C3 /* YRBackGestureDemo */;
282 | targetProxy = 5F29EA88196BA556007335C3 /* PBXContainerItemProxy */;
283 | };
284 | /* End PBXTargetDependency section */
285 |
286 | /* Begin PBXVariantGroup section */
287 | 5F29EA74196BA556007335C3 /* InfoPlist.strings */ = {
288 | isa = PBXVariantGroup;
289 | children = (
290 | 5F29EA75196BA556007335C3 /* en */,
291 | );
292 | name = InfoPlist.strings;
293 | sourceTree = "";
294 | };
295 | 5F29EA8D196BA556007335C3 /* InfoPlist.strings */ = {
296 | isa = PBXVariantGroup;
297 | children = (
298 | 5F29EA8E196BA556007335C3 /* en */,
299 | );
300 | name = InfoPlist.strings;
301 | sourceTree = "";
302 | };
303 | /* End PBXVariantGroup section */
304 |
305 | /* Begin XCBuildConfiguration section */
306 | 5F29EA92196BA556007335C3 /* Debug */ = {
307 | isa = XCBuildConfiguration;
308 | buildSettings = {
309 | ALWAYS_SEARCH_USER_PATHS = NO;
310 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
311 | CLANG_CXX_LIBRARY = "libc++";
312 | CLANG_ENABLE_MODULES = YES;
313 | CLANG_ENABLE_OBJC_ARC = YES;
314 | CLANG_WARN_BOOL_CONVERSION = YES;
315 | CLANG_WARN_CONSTANT_CONVERSION = YES;
316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
317 | CLANG_WARN_EMPTY_BODY = YES;
318 | CLANG_WARN_ENUM_CONVERSION = YES;
319 | CLANG_WARN_INT_CONVERSION = YES;
320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
321 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
322 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
323 | COPY_PHASE_STRIP = NO;
324 | GCC_C_LANGUAGE_STANDARD = gnu99;
325 | GCC_DYNAMIC_NO_PIC = NO;
326 | GCC_OPTIMIZATION_LEVEL = 0;
327 | GCC_PREPROCESSOR_DEFINITIONS = (
328 | "DEBUG=1",
329 | "$(inherited)",
330 | );
331 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
332 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
333 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
334 | GCC_WARN_UNDECLARED_SELECTOR = YES;
335 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
336 | GCC_WARN_UNUSED_FUNCTION = YES;
337 | GCC_WARN_UNUSED_VARIABLE = YES;
338 | IPHONEOS_DEPLOYMENT_TARGET = 7.1;
339 | ONLY_ACTIVE_ARCH = YES;
340 | SDKROOT = iphoneos;
341 | };
342 | name = Debug;
343 | };
344 | 5F29EA93196BA556007335C3 /* Release */ = {
345 | isa = XCBuildConfiguration;
346 | buildSettings = {
347 | ALWAYS_SEARCH_USER_PATHS = NO;
348 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
349 | CLANG_CXX_LIBRARY = "libc++";
350 | CLANG_ENABLE_MODULES = YES;
351 | CLANG_ENABLE_OBJC_ARC = YES;
352 | CLANG_WARN_BOOL_CONVERSION = YES;
353 | CLANG_WARN_CONSTANT_CONVERSION = YES;
354 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
355 | CLANG_WARN_EMPTY_BODY = YES;
356 | CLANG_WARN_ENUM_CONVERSION = YES;
357 | CLANG_WARN_INT_CONVERSION = YES;
358 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
361 | COPY_PHASE_STRIP = YES;
362 | ENABLE_NS_ASSERTIONS = NO;
363 | GCC_C_LANGUAGE_STANDARD = gnu99;
364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
365 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
366 | GCC_WARN_UNDECLARED_SELECTOR = YES;
367 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
368 | GCC_WARN_UNUSED_FUNCTION = YES;
369 | GCC_WARN_UNUSED_VARIABLE = YES;
370 | IPHONEOS_DEPLOYMENT_TARGET = 7.1;
371 | SDKROOT = iphoneos;
372 | VALIDATE_PRODUCT = YES;
373 | };
374 | name = Release;
375 | };
376 | 5F29EA95196BA556007335C3 /* Debug */ = {
377 | isa = XCBuildConfiguration;
378 | buildSettings = {
379 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
380 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
381 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
382 | GCC_PREFIX_HEADER = "YRBackGestureDemo/YRBackGestureDemo-Prefix.pch";
383 | INFOPLIST_FILE = "YRBackGestureDemo/YRBackGestureDemo-Info.plist";
384 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
385 | PRODUCT_NAME = "$(TARGET_NAME)";
386 | WRAPPER_EXTENSION = app;
387 | };
388 | name = Debug;
389 | };
390 | 5F29EA96196BA556007335C3 /* Release */ = {
391 | isa = XCBuildConfiguration;
392 | buildSettings = {
393 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
394 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
395 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
396 | GCC_PREFIX_HEADER = "YRBackGestureDemo/YRBackGestureDemo-Prefix.pch";
397 | INFOPLIST_FILE = "YRBackGestureDemo/YRBackGestureDemo-Info.plist";
398 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
399 | PRODUCT_NAME = "$(TARGET_NAME)";
400 | WRAPPER_EXTENSION = app;
401 | };
402 | name = Release;
403 | };
404 | 5F29EA98196BA556007335C3 /* Debug */ = {
405 | isa = XCBuildConfiguration;
406 | buildSettings = {
407 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/YRBackGestureDemo.app/YRBackGestureDemo";
408 | FRAMEWORK_SEARCH_PATHS = (
409 | "$(SDKROOT)/Developer/Library/Frameworks",
410 | "$(inherited)",
411 | "$(DEVELOPER_FRAMEWORKS_DIR)",
412 | );
413 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
414 | GCC_PREFIX_HEADER = "YRBackGestureDemo/YRBackGestureDemo-Prefix.pch";
415 | GCC_PREPROCESSOR_DEFINITIONS = (
416 | "DEBUG=1",
417 | "$(inherited)",
418 | );
419 | INFOPLIST_FILE = "YRBackGestureDemoTests/YRBackGestureDemoTests-Info.plist";
420 | PRODUCT_NAME = "$(TARGET_NAME)";
421 | TEST_HOST = "$(BUNDLE_LOADER)";
422 | WRAPPER_EXTENSION = xctest;
423 | };
424 | name = Debug;
425 | };
426 | 5F29EA99196BA556007335C3 /* Release */ = {
427 | isa = XCBuildConfiguration;
428 | buildSettings = {
429 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/YRBackGestureDemo.app/YRBackGestureDemo";
430 | FRAMEWORK_SEARCH_PATHS = (
431 | "$(SDKROOT)/Developer/Library/Frameworks",
432 | "$(inherited)",
433 | "$(DEVELOPER_FRAMEWORKS_DIR)",
434 | );
435 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
436 | GCC_PREFIX_HEADER = "YRBackGestureDemo/YRBackGestureDemo-Prefix.pch";
437 | INFOPLIST_FILE = "YRBackGestureDemoTests/YRBackGestureDemoTests-Info.plist";
438 | PRODUCT_NAME = "$(TARGET_NAME)";
439 | TEST_HOST = "$(BUNDLE_LOADER)";
440 | WRAPPER_EXTENSION = xctest;
441 | };
442 | name = Release;
443 | };
444 | /* End XCBuildConfiguration section */
445 |
446 | /* Begin XCConfigurationList section */
447 | 5F29EA63196BA556007335C3 /* Build configuration list for PBXProject "YRBackGestureDemo" */ = {
448 | isa = XCConfigurationList;
449 | buildConfigurations = (
450 | 5F29EA92196BA556007335C3 /* Debug */,
451 | 5F29EA93196BA556007335C3 /* Release */,
452 | );
453 | defaultConfigurationIsVisible = 0;
454 | defaultConfigurationName = Release;
455 | };
456 | 5F29EA94196BA556007335C3 /* Build configuration list for PBXNativeTarget "YRBackGestureDemo" */ = {
457 | isa = XCConfigurationList;
458 | buildConfigurations = (
459 | 5F29EA95196BA556007335C3 /* Debug */,
460 | 5F29EA96196BA556007335C3 /* Release */,
461 | );
462 | defaultConfigurationIsVisible = 0;
463 | };
464 | 5F29EA97196BA556007335C3 /* Build configuration list for PBXNativeTarget "YRBackGestureDemoTests" */ = {
465 | isa = XCConfigurationList;
466 | buildConfigurations = (
467 | 5F29EA98196BA556007335C3 /* Debug */,
468 | 5F29EA99196BA556007335C3 /* Release */,
469 | );
470 | defaultConfigurationIsVisible = 0;
471 | };
472 | /* End XCConfigurationList section */
473 | };
474 | rootObject = 5F29EA60196BA556007335C3 /* Project object */;
475 | }
476 |
--------------------------------------------------------------------------------