├── LefeSlide.gif
├── CKLeftSlideDemo
├── CKLeftSlideDemo
│ ├── 菜单@3x.png
│ ├── leftImage.jpg
│ ├── mainImage.jpg
│ ├── LeftViewController.h
│ ├── MainViewController.h
│ ├── NextViewController.h
│ ├── main.m
│ ├── AppDelegate.h
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── NextViewController.m
│ ├── Info.plist
│ ├── Base.lproj
│ │ └── LaunchScreen.storyboard
│ ├── LeftViewController.m
│ ├── MainViewController.m
│ └── AppDelegate.m
└── CKLeftSlideDemo.xcodeproj
│ ├── xcuserdata
│ └── caike.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── CKLeftSlideDemo.xcscheme
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── caike.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ └── project.pbxproj
├── CKLeftSlide
├── CKLeftSlideViewController.h
└── CKLeftSlideViewController.m
├── README.md
└── .gitignore
/LefeSlide.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/90ck/CKLeftSlide/HEAD/LefeSlide.gif
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/菜单@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/90ck/CKLeftSlide/HEAD/CKLeftSlideDemo/CKLeftSlideDemo/菜单@3x.png
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/leftImage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/90ck/CKLeftSlide/HEAD/CKLeftSlideDemo/CKLeftSlideDemo/leftImage.jpg
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/mainImage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/90ck/CKLeftSlide/HEAD/CKLeftSlideDemo/CKLeftSlideDemo/mainImage.jpg
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo.xcodeproj/xcuserdata/caike.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo.xcodeproj/project.xcworkspace/xcuserdata/caike.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/90ck/CKLeftSlide/HEAD/CKLeftSlideDemo/CKLeftSlideDemo.xcodeproj/project.xcworkspace/xcuserdata/caike.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/LeftViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LeftViewController.h
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LeftViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/MainViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.h
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MainViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/NextViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // NextViewController.h
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NextViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. 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 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CKLeftSlideViewController.h"
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (nonatomic, strong)CKLeftSlideViewController *leftSlideVc;
17 |
18 | @end
19 |
20 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo.xcodeproj/xcuserdata/caike.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CKLeftSlideDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 675BC8691EE64C1A007BAD4D
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/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 | }
--------------------------------------------------------------------------------
/CKLeftSlide/CKLeftSlideViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CKLeftSlideViewController.h
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //菜单的显示区域占屏幕宽度的百分比
12 | static CGFloat MenuWidthScale = 0.75f;
13 | //遮罩层最高透明度
14 | static CGFloat MaxCoverAlpha = 0.2f;
15 |
16 | @interface CKLeftSlideViewController : UIViewController
17 |
18 | //左边视图控制器
19 | @property (nonatomic, strong) UIViewController *leftViewController;
20 |
21 | //右边视图控制器 一般为UINavigationController 或者 UITabBarController
22 | @property (nonatomic, strong) UIViewController *mainViewController;
23 |
24 |
25 | //初始化方法
26 | - (instancetype)initWithLeftVc:(UIViewController *)leftVc mainVc:(UIViewController *)mainVc;
27 |
28 |
29 | //打开菜单视图
30 | - (void)openLeftView;
31 |
32 | //关闭菜单视图
33 | - (void)closeLeftView;
34 | @end
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | #### 目的
4 |
5 | 最近看到快手的侧滑菜单,之前也没有自己写过,于是打算从零开始写一遍抽屉效果。
6 |
7 | #### 效果图
8 |
9 | 
10 |
11 | #### 使用
12 |
13 | 1.初始化
14 |
15 | ```objective-c
16 | //主控制器
17 | UINavigationController *main = [[UINavigationController alloc]initWithRootViewController:[MainViewController new]];
18 | //左侧菜单控制器
19 | LeftViewController *left = [[LeftViewController alloc]init];
20 | //创建抽屉控制器
21 | CKLeftSlideViewController *root = [[CKLeftSlideViewController alloc]initWithLeftVc:left mainVc:main];
22 | self.window.rootViewController = root;
23 | ```
24 |
25 | 2.打开菜单视图 ` -(void)openLeftView; `
26 |
27 | 3.关闭菜单视图 `-(void)closeLeftView;`
28 |
29 | 4.左侧视图中push操作
30 |
31 | ```objective-c
32 | //先获取到leftSlide控制器
33 | CKLeftSlideViewController *leftSlide = (CKLeftSlideViewController *)[((AppDelegate *)[UIApplication sharedApplication].delegate) leftSlideVc];
34 |
35 | //关闭菜单视图
36 | [leftSlide closeLeftView];
37 | //push新的控制器
38 | [leftSlide.navigationController pushViewController:[NextViewController new] animated:NO];
39 |
40 | ```
41 |
42 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/NextViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // NextViewController.m
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import "NextViewController.h"
10 |
11 | @interface NextViewController ()
12 |
13 | @end
14 |
15 | @implementation NextViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 |
21 | self.title = @"Next";
22 | self.view.backgroundColor = [UIColor orangeColor];
23 | }
24 |
25 | - (void)didReceiveMemoryWarning {
26 | [super didReceiveMemoryWarning];
27 | // Dispose of any resources that can be recreated.
28 | }
29 |
30 | /*
31 | #pragma mark - Navigation
32 |
33 | // In a storyboard-based application, you will often want to do a little preparation before navigation
34 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
35 | // Get the new view controller using [segue destinationViewController].
36 | // Pass the selected object to the new view controller.
37 | }
38 | */
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/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 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | # CocoaPods
32 | #
33 | # We recommend against adding the Pods directory to your .gitignore. However
34 | # you should judge for yourself, the pros and cons are mentioned at:
35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36 | #
37 | # Pods/
38 |
39 | # Carthage
40 | #
41 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
42 | # Carthage/Checkouts
43 |
44 | Carthage/Build
45 |
46 | # fastlane
47 | #
48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49 | # screenshots whenever they are needed.
50 | # For more information about the recommended setup visit:
51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
52 |
53 | fastlane/report.xml
54 | fastlane/Preview.html
55 | fastlane/screenshots
56 | fastlane/test_output
57 |
58 | # Code Injection
59 | #
60 | # After new code Injection tools there's a generated folder /iOSInjectionProject
61 | # https://github.com/johnno1962/injectionforxcode
62 |
63 | iOSInjectionProject/
64 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/LeftViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // LeftViewController.m
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import "LeftViewController.h"
10 | #import "AppDelegate.h"
11 | #import "CKLeftSlideViewController.h"
12 | #import "NextViewController.h"
13 | @interface LeftViewController ()
14 |
15 | @end
16 |
17 | @implementation LeftViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | // Do any additional setup after loading the view from its nib.
22 | self.view.backgroundColor = [UIColor orangeColor];
23 |
24 | UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame)*MenuWidthScale, CGRectGetHeight(self.view.frame))];
25 | imageView.image = [UIImage imageNamed:@"leftImage.jpg"];
26 | [self.view addSubview:imageView];
27 |
28 | [imageView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)]];
29 | imageView.userInteractionEnabled = YES;
30 | }
31 |
32 | - (void)tap:(UITapGestureRecognizer *)tap
33 | {
34 | CKLeftSlideViewController *leftSlide = (CKLeftSlideViewController *)[((AppDelegate *)[UIApplication sharedApplication].delegate) leftSlideVc];
35 | [leftSlide closeLeftView];
36 | [leftSlide.navigationController pushViewController:[NextViewController new] animated:NO];
37 |
38 | }
39 |
40 |
41 | - (void)viewDidAppear:(BOOL)animated
42 | {
43 | [super viewDidAppear:animated];
44 |
45 | }
46 |
47 | - (void)didReceiveMemoryWarning {
48 | [super didReceiveMemoryWarning];
49 | // Dispose of any resources that can be recreated.
50 | }
51 |
52 | /*
53 | #pragma mark - Navigation
54 |
55 | // In a storyboard-based application, you will often want to do a little preparation before navigation
56 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
57 | // Get the new view controller using [segue destinationViewController].
58 | // Pass the selected object to the new view controller.
59 | }
60 | */
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/MainViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.m
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import "MainViewController.h"
10 | #import "AppDelegate.h"
11 | #import "NextViewController.h"
12 | #import "CKLeftSlideViewController.h"
13 | @interface MainViewController ()
14 |
15 | @end
16 |
17 | @implementation MainViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | // Do any additional setup after loading the view.
22 | self.view.backgroundColor = [UIColor whiteColor];
23 | [self.navigationController.navigationBar setTranslucent:NO];
24 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"菜单"] style:UIBarButtonItemStylePlain target:self action:@selector(leftAction:)];
25 | self.title = @"首页";
26 | UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.view.bounds];
27 | imageView.image = [UIImage imageNamed:@"mainImage.jpg"];
28 | [self.view addSubview:imageView];
29 |
30 | [imageView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)]];
31 | imageView.userInteractionEnabled = YES;
32 | }
33 |
34 | - (void)leftAction:(UIButton *)sender
35 | {
36 | CKLeftSlideViewController *leftSlide = (CKLeftSlideViewController *)[((AppDelegate *)[UIApplication sharedApplication].delegate) leftSlideVc];
37 | [leftSlide openLeftView];
38 | }
39 |
40 | - (void)tap:(UITapGestureRecognizer *)tap
41 | {
42 | // CKLeftSlideViewController *leftSlide = (CKLeftSlideViewController *)[((AppDelegate *)[UIApplication sharedApplication].delegate) leftSlideVc];
43 | // [leftSlide closeLeftView];
44 | [self.navigationController pushViewController:[NextViewController new] animated:YES];
45 | }
46 |
47 |
48 | - (void)didReceiveMemoryWarning {
49 | [super didReceiveMemoryWarning];
50 | // Dispose of any resources that can be recreated.
51 | }
52 |
53 | /*
54 | #pragma mark - Navigation
55 |
56 | // In a storyboard-based application, you will often want to do a little preparation before navigation
57 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
58 | // Get the new view controller using [segue destinationViewController].
59 | // Pass the selected object to the new view controller.
60 | }
61 | */
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | #import "LeftViewController.h"
12 | #import "MainViewController.h"
13 | @interface AppDelegate ()
14 |
15 | @end
16 |
17 | @implementation AppDelegate
18 |
19 |
20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
21 | // Override point for customization after application launch.
22 | self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
23 |
24 | UINavigationController *main = [[UINavigationController alloc]initWithRootViewController:[MainViewController new]];
25 | CKLeftSlideViewController *root = [[CKLeftSlideViewController alloc]initWithLeftVc:[LeftViewController new] mainVc:main];
26 | self.leftSlideVc = root;
27 | self.window.rootViewController = root;
28 | [self.window makeKeyAndVisible];
29 | [[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
30 | return YES;
31 | }
32 |
33 |
34 | - (void)applicationWillResignActive:(UIApplication *)application {
35 | // 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.
36 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
37 | }
38 |
39 |
40 | - (void)applicationDidEnterBackground:(UIApplication *)application {
41 | // 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.
42 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
43 | }
44 |
45 |
46 | - (void)applicationWillEnterForeground:(UIApplication *)application {
47 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
48 | }
49 |
50 |
51 | - (void)applicationDidBecomeActive:(UIApplication *)application {
52 | // 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.
53 | }
54 |
55 |
56 | - (void)applicationWillTerminate:(UIApplication *)application {
57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
58 | }
59 |
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo.xcodeproj/xcuserdata/caike.xcuserdatad/xcschemes/CKLeftSlideDemo.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 |
--------------------------------------------------------------------------------
/CKLeftSlide/CKLeftSlideViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CKLeftSlideViewController.m
3 | // CKLeftSlideDemo
4 | //
5 | // Created by ck on 2017/6/6.
6 | // Copyright © 2017年 caike. All rights reserved.
7 | //
8 |
9 | #import "CKLeftSlideViewController.h"
10 |
11 |
12 |
13 |
14 | @interface CKLeftSlideViewController ()
15 | {
16 | //记录起始位置
17 | CGPoint _originalPoint;
18 | }
19 |
20 | /** 蒙版 */
21 | @property (nonatomic, strong) UIView *coverView;
22 |
23 | /** 左侧菜单视图宽度 */
24 | @property (nonatomic, assign) CGFloat menuWidth;
25 |
26 | /** 留白宽度 */
27 | @property (nonatomic, assign) CGFloat emptyWidth;
28 |
29 | @end
30 |
31 | @implementation CKLeftSlideViewController
32 |
33 | - (instancetype)initWithLeftVc:(UIViewController *)leftVc mainVc:(UIViewController *)mainVc
34 | {
35 | if (self = [super init]) {
36 | [self addChildViewController:leftVc];
37 | [self addChildViewController:mainVc];
38 | self.leftViewController = leftVc;
39 | self.mainViewController = mainVc;
40 | self.view.backgroundColor = [UIColor whiteColor];
41 | [self.view addSubview:self.leftViewController.view];
42 | [self.view addSubview:self.mainViewController.view];
43 |
44 | }
45 | return self;
46 | }
47 |
48 | - (void)viewDidAppear:(BOOL)animated
49 | {
50 | [super viewDidAppear:animated];
51 | self.leftViewController.view.frame = self.view.frame;
52 | self.mainViewController.view.frame = self.view.frame;
53 | [self updateLeftViewFrame];
54 | }
55 |
56 | - (void)viewDidLoad {
57 | [super viewDidLoad];
58 | // Do any additional setup after loading the view.
59 |
60 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(handlePan:)];
61 | pan.delegate = self;
62 | [self.mainViewController.view addGestureRecognizer:pan];
63 |
64 | self.coverView = [[UIView alloc]initWithFrame:self.view.bounds];
65 | self.coverView.backgroundColor = [UIColor blackColor];
66 | self.coverView.alpha = 0;
67 | self.coverView.hidden = YES;
68 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTap:)];
69 | [self.coverView addGestureRecognizer:tap];
70 |
71 | [self.mainViewController.view addSubview:self.coverView];
72 | }
73 |
74 |
75 | #pragma mark PanDelegate
76 | //设置拖拽响应范围、设置Navigation子视图不可拖拽
77 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
78 | {
79 | //设置Navigation子视图不可拖拽
80 | if ([self.mainViewController isKindOfClass:[UINavigationController class]]) {
81 | UINavigationController *navigationController = (UINavigationController *)self.mainViewController;
82 | if (navigationController.viewControllers.count > 1 && navigationController.interactivePopGestureRecognizer.enabled) {
83 | return NO;
84 | }
85 | }
86 | //如果Tabbar的当前视图是UINavigationController,设置UINavigationController子视图不可拖拽
87 | if ([self.mainViewController isKindOfClass:[UITabBarController class]]) {
88 | UITabBarController *tabbarController = (UITabBarController*)self.mainViewController;
89 | UINavigationController *navigationController = tabbarController.selectedViewController;
90 | if ([navigationController isKindOfClass:[UINavigationController class]]) {
91 | if (navigationController.viewControllers.count > 1 && navigationController.interactivePopGestureRecognizer.enabled) {
92 | return NO;
93 | }
94 | }
95 | }
96 | //设置拖拽响应范围
97 | // if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
98 | // //拖拽响应范围是距离边界是空白位置宽度
99 | // CGFloat actionWidth = self.emptyWidth;
100 | // CGPoint point = [touch locationInView:gestureRecognizer.view];
101 | // if (point.x <= actionWidth || point.x > self.view.bounds.size.width - actionWidth) {
102 | // return YES;
103 | // } else {
104 | // return NO;
105 | // }
106 | // }
107 | return YES;
108 | }
109 |
110 |
111 | //滑动手势
112 | - (void)handlePan:(UIPanGestureRecognizer *)pan
113 | {
114 | switch (pan.state) {
115 | case UIGestureRecognizerStateBegan:
116 | //记录起始点
117 | _originalPoint = CGPointMake(CGRectGetMinX(self.mainViewController.view.frame),CGRectGetMidY(self.mainViewController.view.frame));
118 | break;
119 | case UIGestureRecognizerStateChanged:
120 | {
121 | CGPoint point = [pan translationInView:self.view];
122 | CGFloat x = _originalPoint.x + point.x;
123 |
124 | //最左侧边界x = 0
125 | x = x > 0 ? x : 0;
126 | //最右侧边界x = self.menuWidth
127 | x = x < self.menuWidth ? x : self.menuWidth;
128 |
129 | self.mainViewController.view.center = CGPointMake(x + CGRectGetWidth(self.mainViewController.view.frame)/2, CGRectGetMidY(self.mainViewController.view.frame));
130 | [self updateLeftViewFrame];
131 |
132 |
133 | //更新遮罩层的透明度
134 | self.coverView.hidden = NO;
135 | self.coverView.alpha = CGRectGetMinX(self.mainViewController.view.frame)/self.menuWidth * MaxCoverAlpha;
136 |
137 | }
138 | break;
139 | case UIGestureRecognizerStateEnded:
140 | {
141 | if (CGRectGetMinX(self.mainViewController.view.frame) <= self.menuWidth/2) {
142 | [self closeLeftView];
143 | }
144 | else{
145 | [self openLeftView];
146 | }
147 | }
148 | break;
149 | default:
150 | break;
151 | }
152 | }
153 |
154 | //tap手势
155 | - (void)handleTap:(UITapGestureRecognizer *)tap
156 | {
157 | [self closeLeftView];
158 | }
159 |
160 | //打开菜单视图
161 | - (void)openLeftView
162 | {
163 | self.coverView.hidden = NO;
164 | [UIView animateWithDuration:0.25 animations:^{
165 | self.mainViewController.view.center = CGPointMake(self.view.frame.size.width/2 + self.menuWidth, CGRectGetMidY(self.mainViewController.view.frame));
166 | [self updateLeftViewFrame];
167 | self.coverView.alpha = MaxCoverAlpha;
168 | } completion:^(BOOL finished) {
169 |
170 | }];
171 | }
172 |
173 | //关闭菜单视图
174 | - (void)closeLeftView
175 | {
176 |
177 | [UIView animateWithDuration:0.25 animations:^{
178 | self.mainViewController.view.center = CGPointMake(self.view.frame.size.width/2, CGRectGetMidY(self.mainViewController.view.frame));
179 | [self updateLeftViewFrame];
180 | self.coverView.alpha = 0;
181 | } completion:^(BOOL finished) {
182 | self.coverView.hidden = YES;
183 | }];
184 |
185 | }
186 |
187 | //更新左侧菜单位置
188 | - (void)updateLeftViewFrame
189 | {
190 | self.leftViewController.view.center = CGPointMake((CGRectGetMinX(self.mainViewController.view.frame) + self.emptyWidth)/2, CGRectGetMidY(self.mainViewController.view.frame));
191 | }
192 |
193 | //菜单宽度
194 | - (CGFloat)menuWidth
195 | {
196 | return self.view.bounds.size.width * MenuWidthScale;
197 | }
198 |
199 | //空白宽度
200 | - (CGFloat)emptyWidth
201 | {
202 | return self.view.bounds.size.width * (1-MenuWidthScale);
203 | }
204 |
205 | - (void)didReceiveMemoryWarning {
206 | [super didReceiveMemoryWarning];
207 | // Dispose of any resources that can be recreated.
208 | }
209 |
210 |
211 | //重写导航控制器get方法
212 | - (UINavigationController *)navigationController
213 | {
214 | if ([self.mainViewController isKindOfClass:[UINavigationController class]]) {
215 | return (UINavigationController *)self.mainViewController;
216 | }
217 | else if ([self.mainViewController isKindOfClass:[UITabBarController class]]) {
218 | UITabBarController *tabVc = (UITabBarController *)self.mainViewController;
219 | if ([tabVc.selectedViewController isKindOfClass:[UINavigationController class]]) {
220 | return tabVc.selectedViewController;
221 | }
222 | return nil;
223 | }
224 | return nil;
225 | }
226 |
227 |
228 | /*
229 | #pragma mark - Navigation
230 |
231 | // In a storyboard-based application, you will often want to do a little preparation before navigation
232 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
233 | // Get the new view controller using [segue destinationViewController].
234 | // Pass the selected object to the new view controller.
235 | }
236 | */
237 |
238 | @end
239 |
--------------------------------------------------------------------------------
/CKLeftSlideDemo/CKLeftSlideDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 675760611EE7996000ABE50A /* leftImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 675760601EE7996000ABE50A /* leftImage.jpg */; };
11 | 675760631EE7A6C800ABE50A /* 菜单@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 675760621EE7A6C800ABE50A /* 菜单@3x.png */; };
12 | 675760651EE7A84100ABE50A /* mainImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 675760641EE7A84100ABE50A /* mainImage.jpg */; };
13 | 675BC86F1EE64C1A007BAD4D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 675BC86E1EE64C1A007BAD4D /* main.m */; };
14 | 675BC8721EE64C1A007BAD4D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 675BC8711EE64C1A007BAD4D /* AppDelegate.m */; };
15 | 675BC87A1EE64C1A007BAD4D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 675BC8791EE64C1A007BAD4D /* Assets.xcassets */; };
16 | 675BC87D1EE64C1A007BAD4D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 675BC87B1EE64C1A007BAD4D /* LaunchScreen.storyboard */; };
17 | 675BC8871EE64C82007BAD4D /* CKLeftSlideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 675BC8861EE64C82007BAD4D /* CKLeftSlideViewController.m */; };
18 | 675BC88A1EE64F0E007BAD4D /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 675BC8891EE64F0E007BAD4D /* MainViewController.m */; };
19 | 675BC8901EE6A9C6007BAD4D /* NextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 675BC88F1EE6A9C6007BAD4D /* NextViewController.m */; };
20 | 675BC8961EE6AEE2007BAD4D /* LeftViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 675BC8941EE6AEE2007BAD4D /* LeftViewController.m */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXFileReference section */
24 | 675760601EE7996000ABE50A /* leftImage.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = leftImage.jpg; sourceTree = ""; };
25 | 675760621EE7A6C800ABE50A /* 菜单@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "菜单@3x.png"; sourceTree = ""; };
26 | 675760641EE7A84100ABE50A /* mainImage.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = mainImage.jpg; sourceTree = ""; };
27 | 675BC86A1EE64C1A007BAD4D /* CKLeftSlideDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CKLeftSlideDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
28 | 675BC86E1EE64C1A007BAD4D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
29 | 675BC8701EE64C1A007BAD4D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
30 | 675BC8711EE64C1A007BAD4D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
31 | 675BC8791EE64C1A007BAD4D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
32 | 675BC87C1EE64C1A007BAD4D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
33 | 675BC87E1EE64C1A007BAD4D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | 675BC8851EE64C82007BAD4D /* CKLeftSlideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKLeftSlideViewController.h; sourceTree = ""; };
35 | 675BC8861EE64C82007BAD4D /* CKLeftSlideViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CKLeftSlideViewController.m; sourceTree = ""; };
36 | 675BC8881EE64F0E007BAD4D /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; };
37 | 675BC8891EE64F0E007BAD4D /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; };
38 | 675BC88E1EE6A9C6007BAD4D /* NextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NextViewController.h; sourceTree = ""; };
39 | 675BC88F1EE6A9C6007BAD4D /* NextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NextViewController.m; sourceTree = ""; };
40 | 675BC8931EE6AEE2007BAD4D /* LeftViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftViewController.h; sourceTree = ""; };
41 | 675BC8941EE6AEE2007BAD4D /* LeftViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftViewController.m; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 675BC8671EE64C1A007BAD4D /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | );
50 | runOnlyForDeploymentPostprocessing = 0;
51 | };
52 | /* End PBXFrameworksBuildPhase section */
53 |
54 | /* Begin PBXGroup section */
55 | 675BC8611EE64C1A007BAD4D = {
56 | isa = PBXGroup;
57 | children = (
58 | 675BC86C1EE64C1A007BAD4D /* CKLeftSlideDemo */,
59 | 675BC86B1EE64C1A007BAD4D /* Products */,
60 | );
61 | sourceTree = "";
62 | };
63 | 675BC86B1EE64C1A007BAD4D /* Products */ = {
64 | isa = PBXGroup;
65 | children = (
66 | 675BC86A1EE64C1A007BAD4D /* CKLeftSlideDemo.app */,
67 | );
68 | name = Products;
69 | sourceTree = "";
70 | };
71 | 675BC86C1EE64C1A007BAD4D /* CKLeftSlideDemo */ = {
72 | isa = PBXGroup;
73 | children = (
74 | 675BC8841EE64C3B007BAD4D /* CKLeftSlide */,
75 | 675BC8701EE64C1A007BAD4D /* AppDelegate.h */,
76 | 675BC8711EE64C1A007BAD4D /* AppDelegate.m */,
77 | 675BC8881EE64F0E007BAD4D /* MainViewController.h */,
78 | 675BC8891EE64F0E007BAD4D /* MainViewController.m */,
79 | 675BC8931EE6AEE2007BAD4D /* LeftViewController.h */,
80 | 675BC8941EE6AEE2007BAD4D /* LeftViewController.m */,
81 | 675BC88E1EE6A9C6007BAD4D /* NextViewController.h */,
82 | 675BC88F1EE6A9C6007BAD4D /* NextViewController.m */,
83 | 675BC8791EE64C1A007BAD4D /* Assets.xcassets */,
84 | 675BC87B1EE64C1A007BAD4D /* LaunchScreen.storyboard */,
85 | 675BC87E1EE64C1A007BAD4D /* Info.plist */,
86 | 675BC86D1EE64C1A007BAD4D /* Supporting Files */,
87 | );
88 | path = CKLeftSlideDemo;
89 | sourceTree = "";
90 | };
91 | 675BC86D1EE64C1A007BAD4D /* Supporting Files */ = {
92 | isa = PBXGroup;
93 | children = (
94 | 675BC86E1EE64C1A007BAD4D /* main.m */,
95 | 675BC89B1EE6B2B3007BAD4D /* images */,
96 | );
97 | name = "Supporting Files";
98 | sourceTree = "";
99 | };
100 | 675BC8841EE64C3B007BAD4D /* CKLeftSlide */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 675BC8851EE64C82007BAD4D /* CKLeftSlideViewController.h */,
104 | 675BC8861EE64C82007BAD4D /* CKLeftSlideViewController.m */,
105 | );
106 | name = CKLeftSlide;
107 | path = ../../CKLeftSlide;
108 | sourceTree = "";
109 | };
110 | 675BC89B1EE6B2B3007BAD4D /* images */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 675760601EE7996000ABE50A /* leftImage.jpg */,
114 | 675760641EE7A84100ABE50A /* mainImage.jpg */,
115 | 675760621EE7A6C800ABE50A /* 菜单@3x.png */,
116 | );
117 | name = images;
118 | sourceTree = "";
119 | };
120 | /* End PBXGroup section */
121 |
122 | /* Begin PBXNativeTarget section */
123 | 675BC8691EE64C1A007BAD4D /* CKLeftSlideDemo */ = {
124 | isa = PBXNativeTarget;
125 | buildConfigurationList = 675BC8811EE64C1A007BAD4D /* Build configuration list for PBXNativeTarget "CKLeftSlideDemo" */;
126 | buildPhases = (
127 | 675BC8661EE64C1A007BAD4D /* Sources */,
128 | 675BC8671EE64C1A007BAD4D /* Frameworks */,
129 | 675BC8681EE64C1A007BAD4D /* Resources */,
130 | );
131 | buildRules = (
132 | );
133 | dependencies = (
134 | );
135 | name = CKLeftSlideDemo;
136 | productName = CKLeftSlideDemo;
137 | productReference = 675BC86A1EE64C1A007BAD4D /* CKLeftSlideDemo.app */;
138 | productType = "com.apple.product-type.application";
139 | };
140 | /* End PBXNativeTarget section */
141 |
142 | /* Begin PBXProject section */
143 | 675BC8621EE64C1A007BAD4D /* Project object */ = {
144 | isa = PBXProject;
145 | attributes = {
146 | LastUpgradeCheck = 0830;
147 | ORGANIZATIONNAME = caike;
148 | TargetAttributes = {
149 | 675BC8691EE64C1A007BAD4D = {
150 | CreatedOnToolsVersion = 8.3.2;
151 | DevelopmentTeam = U5S4SZQP26;
152 | ProvisioningStyle = Automatic;
153 | };
154 | };
155 | };
156 | buildConfigurationList = 675BC8651EE64C1A007BAD4D /* Build configuration list for PBXProject "CKLeftSlideDemo" */;
157 | compatibilityVersion = "Xcode 3.2";
158 | developmentRegion = English;
159 | hasScannedForEncodings = 0;
160 | knownRegions = (
161 | en,
162 | Base,
163 | );
164 | mainGroup = 675BC8611EE64C1A007BAD4D;
165 | productRefGroup = 675BC86B1EE64C1A007BAD4D /* Products */;
166 | projectDirPath = "";
167 | projectRoot = "";
168 | targets = (
169 | 675BC8691EE64C1A007BAD4D /* CKLeftSlideDemo */,
170 | );
171 | };
172 | /* End PBXProject section */
173 |
174 | /* Begin PBXResourcesBuildPhase section */
175 | 675BC8681EE64C1A007BAD4D /* Resources */ = {
176 | isa = PBXResourcesBuildPhase;
177 | buildActionMask = 2147483647;
178 | files = (
179 | 675BC87D1EE64C1A007BAD4D /* LaunchScreen.storyboard in Resources */,
180 | 675760651EE7A84100ABE50A /* mainImage.jpg in Resources */,
181 | 675760611EE7996000ABE50A /* leftImage.jpg in Resources */,
182 | 675760631EE7A6C800ABE50A /* 菜单@3x.png in Resources */,
183 | 675BC87A1EE64C1A007BAD4D /* Assets.xcassets in Resources */,
184 | );
185 | runOnlyForDeploymentPostprocessing = 0;
186 | };
187 | /* End PBXResourcesBuildPhase section */
188 |
189 | /* Begin PBXSourcesBuildPhase section */
190 | 675BC8661EE64C1A007BAD4D /* Sources */ = {
191 | isa = PBXSourcesBuildPhase;
192 | buildActionMask = 2147483647;
193 | files = (
194 | 675BC8721EE64C1A007BAD4D /* AppDelegate.m in Sources */,
195 | 675BC8901EE6A9C6007BAD4D /* NextViewController.m in Sources */,
196 | 675BC86F1EE64C1A007BAD4D /* main.m in Sources */,
197 | 675BC8961EE6AEE2007BAD4D /* LeftViewController.m in Sources */,
198 | 675BC88A1EE64F0E007BAD4D /* MainViewController.m in Sources */,
199 | 675BC8871EE64C82007BAD4D /* CKLeftSlideViewController.m in Sources */,
200 | );
201 | runOnlyForDeploymentPostprocessing = 0;
202 | };
203 | /* End PBXSourcesBuildPhase section */
204 |
205 | /* Begin PBXVariantGroup section */
206 | 675BC87B1EE64C1A007BAD4D /* LaunchScreen.storyboard */ = {
207 | isa = PBXVariantGroup;
208 | children = (
209 | 675BC87C1EE64C1A007BAD4D /* Base */,
210 | );
211 | name = LaunchScreen.storyboard;
212 | sourceTree = "";
213 | };
214 | /* End PBXVariantGroup section */
215 |
216 | /* Begin XCBuildConfiguration section */
217 | 675BC87F1EE64C1A007BAD4D /* Debug */ = {
218 | isa = XCBuildConfiguration;
219 | buildSettings = {
220 | ALWAYS_SEARCH_USER_PATHS = NO;
221 | CLANG_ANALYZER_NONNULL = YES;
222 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
223 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
224 | CLANG_CXX_LIBRARY = "libc++";
225 | CLANG_ENABLE_MODULES = YES;
226 | CLANG_ENABLE_OBJC_ARC = YES;
227 | CLANG_WARN_BOOL_CONVERSION = YES;
228 | CLANG_WARN_CONSTANT_CONVERSION = YES;
229 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
230 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
231 | CLANG_WARN_EMPTY_BODY = YES;
232 | CLANG_WARN_ENUM_CONVERSION = YES;
233 | CLANG_WARN_INFINITE_RECURSION = YES;
234 | CLANG_WARN_INT_CONVERSION = YES;
235 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
236 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
237 | CLANG_WARN_UNREACHABLE_CODE = YES;
238 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
239 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
240 | COPY_PHASE_STRIP = NO;
241 | DEBUG_INFORMATION_FORMAT = dwarf;
242 | ENABLE_STRICT_OBJC_MSGSEND = YES;
243 | ENABLE_TESTABILITY = YES;
244 | GCC_C_LANGUAGE_STANDARD = gnu99;
245 | GCC_DYNAMIC_NO_PIC = NO;
246 | GCC_NO_COMMON_BLOCKS = YES;
247 | GCC_OPTIMIZATION_LEVEL = 0;
248 | GCC_PREPROCESSOR_DEFINITIONS = (
249 | "DEBUG=1",
250 | "$(inherited)",
251 | );
252 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
253 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
254 | GCC_WARN_UNDECLARED_SELECTOR = YES;
255 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
256 | GCC_WARN_UNUSED_FUNCTION = YES;
257 | GCC_WARN_UNUSED_VARIABLE = YES;
258 | IPHONEOS_DEPLOYMENT_TARGET = 10.3;
259 | MTL_ENABLE_DEBUG_INFO = YES;
260 | ONLY_ACTIVE_ARCH = YES;
261 | SDKROOT = iphoneos;
262 | };
263 | name = Debug;
264 | };
265 | 675BC8801EE64C1A007BAD4D /* Release */ = {
266 | isa = XCBuildConfiguration;
267 | buildSettings = {
268 | ALWAYS_SEARCH_USER_PATHS = NO;
269 | CLANG_ANALYZER_NONNULL = YES;
270 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
271 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
272 | CLANG_CXX_LIBRARY = "libc++";
273 | CLANG_ENABLE_MODULES = YES;
274 | CLANG_ENABLE_OBJC_ARC = YES;
275 | CLANG_WARN_BOOL_CONVERSION = YES;
276 | CLANG_WARN_CONSTANT_CONVERSION = YES;
277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
278 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
279 | CLANG_WARN_EMPTY_BODY = YES;
280 | CLANG_WARN_ENUM_CONVERSION = YES;
281 | CLANG_WARN_INFINITE_RECURSION = YES;
282 | CLANG_WARN_INT_CONVERSION = YES;
283 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
284 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
285 | CLANG_WARN_UNREACHABLE_CODE = YES;
286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
288 | COPY_PHASE_STRIP = NO;
289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
290 | ENABLE_NS_ASSERTIONS = NO;
291 | ENABLE_STRICT_OBJC_MSGSEND = YES;
292 | GCC_C_LANGUAGE_STANDARD = gnu99;
293 | GCC_NO_COMMON_BLOCKS = YES;
294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
296 | GCC_WARN_UNDECLARED_SELECTOR = YES;
297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
298 | GCC_WARN_UNUSED_FUNCTION = YES;
299 | GCC_WARN_UNUSED_VARIABLE = YES;
300 | IPHONEOS_DEPLOYMENT_TARGET = 10.3;
301 | MTL_ENABLE_DEBUG_INFO = NO;
302 | SDKROOT = iphoneos;
303 | VALIDATE_PRODUCT = YES;
304 | };
305 | name = Release;
306 | };
307 | 675BC8821EE64C1A007BAD4D /* Debug */ = {
308 | isa = XCBuildConfiguration;
309 | buildSettings = {
310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
311 | DEVELOPMENT_TEAM = U5S4SZQP26;
312 | INFOPLIST_FILE = CKLeftSlideDemo/Info.plist;
313 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
314 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
315 | PRODUCT_BUNDLE_IDENTIFIER = com.caidake.CKLeftSlideDemo;
316 | PRODUCT_NAME = "$(TARGET_NAME)";
317 | };
318 | name = Debug;
319 | };
320 | 675BC8831EE64C1A007BAD4D /* Release */ = {
321 | isa = XCBuildConfiguration;
322 | buildSettings = {
323 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
324 | DEVELOPMENT_TEAM = U5S4SZQP26;
325 | INFOPLIST_FILE = CKLeftSlideDemo/Info.plist;
326 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
327 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
328 | PRODUCT_BUNDLE_IDENTIFIER = com.caidake.CKLeftSlideDemo;
329 | PRODUCT_NAME = "$(TARGET_NAME)";
330 | };
331 | name = Release;
332 | };
333 | /* End XCBuildConfiguration section */
334 |
335 | /* Begin XCConfigurationList section */
336 | 675BC8651EE64C1A007BAD4D /* Build configuration list for PBXProject "CKLeftSlideDemo" */ = {
337 | isa = XCConfigurationList;
338 | buildConfigurations = (
339 | 675BC87F1EE64C1A007BAD4D /* Debug */,
340 | 675BC8801EE64C1A007BAD4D /* Release */,
341 | );
342 | defaultConfigurationIsVisible = 0;
343 | defaultConfigurationName = Release;
344 | };
345 | 675BC8811EE64C1A007BAD4D /* Build configuration list for PBXNativeTarget "CKLeftSlideDemo" */ = {
346 | isa = XCConfigurationList;
347 | buildConfigurations = (
348 | 675BC8821EE64C1A007BAD4D /* Debug */,
349 | 675BC8831EE64C1A007BAD4D /* Release */,
350 | );
351 | defaultConfigurationIsVisible = 0;
352 | defaultConfigurationName = Release;
353 | };
354 | /* End XCConfigurationList section */
355 | };
356 | rootObject = 675BC8621EE64C1A007BAD4D /* Project object */;
357 | }
358 |
--------------------------------------------------------------------------------