├── README.md
└── 侧滑菜单
├── .gitignore
├── 侧滑菜单.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── 侧滑菜单.xccheckout
│ └── xcuserdata
│ │ └── yixiang.xcuserdatad
│ │ ├── UserInterfaceState.xcuserstate
│ │ └── WorkspaceSettings.xcsettings
└── xcuserdata
│ └── yixiang.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── xcschememanagement.plist
│ └── 侧滑菜单.xcscheme
├── 侧滑菜单
├── AppDelegate.h
├── AppDelegate.m
├── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
├── CenterPage
│ ├── Controller
│ │ ├── AffineTransformController.h
│ │ ├── AffineTransformController.m
│ │ ├── BaseAnimationController.h
│ │ ├── BaseAnimationController.m
│ │ ├── BaseViewController.h
│ │ ├── BaseViewController.m
│ │ ├── ComprehensiveCaseController.h
│ │ ├── ComprehensiveCaseController.m
│ │ ├── GroupAnimationController.h
│ │ ├── GroupAnimationController.m
│ │ ├── KeyFrameAnimationController.h
│ │ ├── KeyFrameAnimationController.m
│ │ ├── TransitionAnimationController.h
│ │ └── TransitionAnimationController.m
│ └── View
│ │ ├── TitleButton.h
│ │ └── TitleButton.m
├── DCPathButton
│ ├── DCPathButton.h
│ ├── DCPathButton.m
│ ├── DCPathCenterButton.h
│ ├── DCPathCenterButton.m
│ ├── DCPathItemButton.h
│ └── DCPathItemButton.m
├── DWBubbleMenuButton
│ ├── DWBubbleMenuButton.h
│ └── DWBubbleMenuButton.m
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── LeftPage
│ ├── LeftViewController.h
│ └── LeftViewController.m
├── MCFireworksButton
│ ├── MCFireworksButton.h
│ ├── MCFireworksButton.m
│ ├── MCFireworksView.h
│ └── MCFireworksView.m
├── PrefixHeader.pch
├── RightPage
│ ├── RightViewController.h
│ └── RightViewController.m
├── SWRevealViewController
│ ├── SWRevealViewController.h
│ └── SWRevealViewController.m
├── Sounds
│ ├── bloom.caf
│ ├── fold.caf
│ └── selected.caf
├── ViewController.h
├── ViewController.m
├── image
│ ├── Like-Blue@2x.png
│ ├── Like@2x.png
│ ├── Sparkle.png
│ ├── chooser-button-input-highlighted@2x.png
│ ├── chooser-button-input@2x.png
│ ├── chooser-button-tab-highlighted@2x.png
│ ├── chooser-button-tab@2x.png
│ ├── chooser-moment-button-highlighted@2x.png
│ ├── chooser-moment-button@2x.png
│ ├── chooser-moment-icon-camera-highlighted@2x.png
│ ├── chooser-moment-icon-camera@2x.png
│ ├── chooser-moment-icon-music-highlighted@2x.png
│ ├── chooser-moment-icon-music@2x.png
│ ├── chooser-moment-icon-place-highlighted@2x.png
│ ├── chooser-moment-icon-place@2x.png
│ ├── chooser-moment-icon-sleep-highlighted@2x.png
│ ├── chooser-moment-icon-sleep@2x.png
│ ├── chooser-moment-icon-thought-highlighted@2x.png
│ └── chooser-moment-icon-thought@2x.png
└── main.m
└── 侧滑菜单Tests
├── Info.plist
└── ____Tests.m
/README.md:
--------------------------------------------------------------------------------
1 | ##一、简介
2 | IOS 动画主要是指Core Animation框架。官方使用文档地址为:[Core Animation Guide](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html)。
Core Animation是IOS和OS X平台上负责图形渲染与动画的基础框架。Core Animation可以作用与动画视图或者其他可视元素,为你完成了动画所需的大部分绘帧工作。你只需要配置少量的动画参数(如开始点的位置和结束点的位置)即可使用Core Animation的动画效果。Core Animation将大部分实际的绘图任务交给了图形硬件来处理,图形硬件会加速图形渲染的速度。这种自动化的图形加速技术让动画拥有更高的帧率并且显示效果更加平滑,不会加重CPU的负担而影响程序的运行速度。
3 |
4 | ##二、Core Animation类图以及常用字段
5 | Core Animation类的继承关系图
6 | 
7 |
8 | **常用属性**
9 | duration : 动画的持续时间
10 | beginTime : 动画的开始时间
11 | repeatCount : 动画的重复次数
12 | autoreverses : 执行的动画按照原动画返回执行
13 | timingFunction : 控制动画的显示节奏系统提供五种值选择,分别是:
14 |
15 | - kCAMediaTimingFunctionLinear 线性动画
16 | - kCAMediaTimingFunctionEaseIn 先慢后快(慢进快出)
17 | - kCAMediaTimingFunctionEaseOut 先块后慢(快进慢出)
18 | - kCAMediaTimingFunctionEaseInEaseOut 先慢后快再慢
19 | - kCAMediaTimingFunctionDefault 默认,也属于中间比较快
20 |
21 | delegate : 动画代理。能够检测动画的执行和结束。
22 |
23 | ```
24 | @interface NSObject (CAAnimationDelegate)
25 | - (void)animationDidStart:(CAAnimation *)anim;
26 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag;
27 | @end
28 | ```
29 | path:关键帧动画中的执行路径
30 | type : 过渡动画的动画类型,系统提供了四种过渡动画。
31 | - kCATransitionFade 渐变效果
32 | - kCATransitionMoveIn 进入覆盖效果
33 | - kCATransitionPush 推出效果
34 | - kCATransitionReveal 揭露离开效果
35 | subtype : 过渡动画的动画方向
36 | - kCATransitionFromRight 从右侧进入
37 | - kCATransitionFromLeft 从左侧进入
38 | - kCATransitionFromTop 从顶部进入
39 | - kCATransitionFromBottom 从底部进入
40 |
41 | ##三、IOS动画的调用方式
42 | ###第一种:UIView 代码块调用
43 |
44 | ```
45 | _demoView.frame = CGRectMake(0, SCREEN_HEIGHT/2-50, 50, 50);
46 | [UIView animateWithDuration:1.0f animations:^{
47 | _demoView.frame = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50, 50, 50);
48 | } completion:^(BOOL finished) {
49 | _demoView.frame = CGRectMake(SCREEN_WIDTH/2-25, SCREEN_HEIGHT/2-50, 50, 50);
50 | }];
51 | ```
52 | ###第二种:UIView [begin commit]模式
53 | _demoView.frame = CGRectMake(0, SCREEN_HEIGHT/2-50, 50, 50);
54 | [UIView beginAnimations:nil context:nil];
55 | [UIView setAnimationDuration:1.0f];
56 | _demoView.frame = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50, 50, 50);
57 | [UIView commitAnimations];
58 | ###第三种:使用Core Animation中的类
59 |
60 | ```
61 | CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"position"];
62 | anima.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-75)];
63 | anima.toValue = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-75)];
64 | anima.duration = 1.0f;
65 | [_demoView.layer addAnimation:anima forKey:@"positionAnimation"];
66 | ```
67 | ##四、IOS动画的使用
68 | ###4.1:基础动画(CABaseAnimation)
69 | **重要属性**
70 | **fromValue** : keyPath对应的初始值
71 | **toValue** : keyPath对应的结束值
72 | 基础动画主要提供了对于CALayer对象中的可变属性进行简单动画的操作。比如:位移、透明度、缩放、旋转、背景色等等。
73 | 效果演示:
74 | 
75 | 位移动画代码演示:
76 |
77 | ```
78 | //使用CABasicAnimation创建基础动画
79 | CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"position"];
80 | anima.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-75)];
81 | anima.toValue = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-75)];
82 | anima.duration = 1.0f;
83 | //anima.fillMode = kCAFillModeForwards;
84 | //anima.removedOnCompletion = NO;
85 | [_demoView.layer addAnimation:anima forKey:@"positionAnimation"];
86 | ```
87 | **注意点**
88 | 如果fillMode=kCAFillModeForwards和removedOnComletion=NO,那么在动画执行完毕后,图层会保持显示动画执行后的状态。但在实质上,图层的属性值还是动画执行前的初始值,并没有真正被改变。
89 | ###4.2:关键帧动画(CAKeyframeAnimation)
90 | CAKeyframeAnimation和CABaseAnimation都属于CAPropertyAnimatin的子类。CABaseAnimation只能从一个数值(fromValue)变换成另一个数值(toValue),而CAKeyframeAnimation则会使用一个NSArray保存一组关键帧。
91 | **重要属性**
92 | **values** : 就是上述的NSArray对象。里面的元素称为”关键帧”(keyframe)。动画对象会在指定的时间(duration)内,依次显示values数组中的每一个关键帧
93 | **path** : 可以设置一个CGPathRef\CGMutablePathRef,让层跟着路径移动。path只对CALayer的anchorPoint和position起作用。如果你设置了path,那么values将被忽略。
94 | **keyTimes** : 可以为对应的关键帧指定对应的时间点,其取值范围为0到1.0,keyTimes中的每一个时间值都对应values中的每一帧.当keyTimes没有设置的时候,各个关键帧的时间是平分的。
95 | 效果演示:
96 | 
97 | 圆形路径动画代码演示:
98 |
99 | ```
100 | CAKeyframeAnimation *anima = [CAKeyframeAnimation animationWithKeyPath:@"position"];
101 | UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(SCREEN_WIDTH/2-100, SCREEN_HEIGHT/2-100, 200, 200)];
102 | anima.path = path.CGPath;
103 | anima.duration = 2.0f;
104 | [_demoView.layer addAnimation:anima forKey:@"pathAnimation"];
105 | ```
106 | **说明**:CABasicAnimation可看做是最多只有2个关键帧的CAKeyframeAnimation
107 | ###4.3:组动画(CAAnimationGroup)
108 | CAAnimation的子类,可以保存一组动画对象,将CAAnimationGroup对象加入层后,组中所有动画对象可以同时并发运行。
109 | **重要属性**
110 | **animations** : 用来保存一组动画对象的NSArray
111 | 效果演示:
112 | 
113 | 组动画代码演示:
114 |
115 | ```
116 | CAKeyframeAnimation *anima1 = [CAKeyframeAnimation animationWithKeyPath:@"position"];
117 | NSValue *value0 = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-50)];
118 | NSValue *value1 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2-50)];
119 | NSValue *value2 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2+50)];
120 | NSValue *value3 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2+50)];
121 | NSValue *value4 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2-50)];
122 | NSValue *value5 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50)];
123 | anima1.values = [NSArray arrayWithObjects:value0,value1,value2,value3,value4,value5, nil];
124 |
125 | //缩放动画
126 | CABasicAnimation *anima2 = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
127 | anima2.fromValue = [NSNumber numberWithFloat:0.8f];
128 | anima2.toValue = [NSNumber numberWithFloat:2.0f];
129 |
130 | //旋转动画
131 | CABasicAnimation *anima3 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
132 | anima3.toValue = [NSNumber numberWithFloat:M_PI*4];
133 |
134 | //组动画
135 | CAAnimationGroup *groupAnimation = [CAAnimationGroup animation];
136 | groupAnimation.animations = [NSArray arrayWithObjects:anima1,anima2,anima3, nil];
137 | groupAnimation.duration = 4.0f;
138 |
139 | [_demoView.layer addAnimation:groupAnimation forKey:@"groupAnimation"];
140 | ```
141 | ###4.4:过渡动画(CATransition)
142 | CAAnimation的子类,用于做过渡动画或者转场动画,能够为层提供移出屏幕和移入屏幕的动画效果。
143 | **重要属性**
144 | **type**:动画过渡类型
145 | Apple 官方的SDK其实只提供了四种过渡效果。
146 | - kCATransitionFade 渐变效果
147 | - kCATransitionMoveIn 进入覆盖效果
148 | - kCATransitionPush 推出效果
149 | - kCATransitionReveal 揭露离开效果
150 | 私有API提供了其他很多非常炫的过渡动画,比如@"cube"、@"suckEffect"、@"oglFlip"、 @"rippleEffect"、@"pageCurl"、@"pageUnCurl"、@"cameraIrisHollowOpen"、@"cameraIrisHollowClose"等。
151 | **注意点**
152 | 私有api,不建议开发者们使用。因为苹果公司不提供维护,并且有可能造成你的app审核不通过。
153 |
154 | **subtype**:动画过渡方向
155 |
156 | - kCATransitionFromRight 从右侧进入
157 | - kCATransitionFromLeft 从左侧进入
158 | - kCATransitionFromTop 从顶部进入
159 | - kCATransitionFromBottom 从底部进入
160 |
161 | **startProgress**:动画起点(在整体动画的百分比)
162 | **endProgress**:动画终点(在整体动画的百分比)
163 |
164 | 效果演示:
165 | 
166 |
167 | ###4.5:综合案例
168 | ####4.5.1 : 仿Path菜单效果
169 | 效果演示:
170 | 
171 |
172 | 动画解析:
173 | 1、点击红色按钮,红色按钮旋转。(旋转动画)
174 | 2、黑色小按钮依次弹出,并且带有旋转效果。(位移动画、旋转动画、组动画)
175 | 3、点击黑色小按钮,其他按钮消失,被点击的黑色按钮变大变淡消失。(缩放动画、alpha动画、组动画)
176 | **博主的话**:代码过多,这里不做演示。文章最后提供代码下载地址。
177 |
178 | ####4.5.2: 仿钉钉菜单效果
179 | 效果演示:
180 | 
181 | 看上去挺炫的,其实实现很简单,就是位移动画+缩放动画。
182 |
183 | ####4.5.3: 点赞烟花效果动画
184 | 效果演示:
185 | 
186 | 这里其实只有按钮变大效果使用的缩放动画。烟花效果 使用的是一种比较特殊的动画--粒子动画。
187 | 一个粒子系统一般有两部分组成:
188 | 1、CAEmitterCell:可以看作是单个粒子的原型(例如,一个单一的粉扑在一团烟雾)。当散发出一个粒子,UIKit根据这个发射粒子和定义的基础上创建一个随机粒子。此原型包括一些属性来控制粒子的图片,颜色,方向,运动,缩放比例和生命周期。
189 | 2、CAEmitterLayer:主要控制发射源的位置、尺寸、发射模式、发射源的形状等等。
190 | 以上两个类的属性还是比较多的,这里就不细讲了。大家可以google一下,详细的了解吧。
191 |
192 | ##五、总结
193 | 任何复杂的动画其实都是由一个个简单的动画组装而成的,只要我们善于分解和组装,我们就能实现出满意的效果。动画其实也不是那么难。
194 |
195 | ##六、下载地址
196 | github下载地址:[https://github.com/yixiangboy/IOSAnimationDemo](https://github.com/yixiangboy/IOSAnimationDemo)
197 | 如果觉得对你还有些用,给一颗star吧。你的支持是我继续的动力。
198 | 个人博客地址:[http://blog.csdn.net/yixiangboy](http://blog.csdn.net/yixiangboy)
199 |
200 | ##七、博主的话
201 | **我的联系方式:**
202 | 微博:[新浪微博](http://weibo.com/5612984599/profile?topnav=1&wvr=6)
203 | 博客:[http://blog.csdn.net/yixiangboy ](http://blog.csdn.net/yixiangboy)
204 | github:[https://github.com/yixiangboy](https://github.com/yixiangboy)
205 |
--------------------------------------------------------------------------------
/侧滑菜单/.gitignore:
--------------------------------------------------------------------------------
1 | DerivedData/
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | DA57DF311B5E360D00EF5718 /* chooser-button-input-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF211B5E360D00EF5718 /* chooser-button-input-highlighted@2x.png */; };
11 | DA57DF321B5E360D00EF5718 /* chooser-button-input@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF221B5E360D00EF5718 /* chooser-button-input@2x.png */; };
12 | DA57DF331B5E360D00EF5718 /* chooser-button-tab-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF231B5E360D00EF5718 /* chooser-button-tab-highlighted@2x.png */; };
13 | DA57DF341B5E360D00EF5718 /* chooser-button-tab@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF241B5E360D00EF5718 /* chooser-button-tab@2x.png */; };
14 | DA57DF351B5E360D00EF5718 /* chooser-moment-button-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF251B5E360D00EF5718 /* chooser-moment-button-highlighted@2x.png */; };
15 | DA57DF361B5E360D00EF5718 /* chooser-moment-button@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF261B5E360D00EF5718 /* chooser-moment-button@2x.png */; };
16 | DA57DF371B5E360D00EF5718 /* chooser-moment-icon-camera-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF271B5E360D00EF5718 /* chooser-moment-icon-camera-highlighted@2x.png */; };
17 | DA57DF381B5E360D00EF5718 /* chooser-moment-icon-camera@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF281B5E360D00EF5718 /* chooser-moment-icon-camera@2x.png */; };
18 | DA57DF391B5E360D00EF5718 /* chooser-moment-icon-music-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF291B5E360D00EF5718 /* chooser-moment-icon-music-highlighted@2x.png */; };
19 | DA57DF3A1B5E360D00EF5718 /* chooser-moment-icon-music@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF2A1B5E360D00EF5718 /* chooser-moment-icon-music@2x.png */; };
20 | DA57DF3B1B5E360D00EF5718 /* chooser-moment-icon-place-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF2B1B5E360D00EF5718 /* chooser-moment-icon-place-highlighted@2x.png */; };
21 | DA57DF3C1B5E360D00EF5718 /* chooser-moment-icon-place@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF2C1B5E360D00EF5718 /* chooser-moment-icon-place@2x.png */; };
22 | DA57DF3D1B5E360D00EF5718 /* chooser-moment-icon-sleep-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF2D1B5E360D00EF5718 /* chooser-moment-icon-sleep-highlighted@2x.png */; };
23 | DA57DF3E1B5E360D00EF5718 /* chooser-moment-icon-sleep@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF2E1B5E360D00EF5718 /* chooser-moment-icon-sleep@2x.png */; };
24 | DA57DF3F1B5E360D00EF5718 /* chooser-moment-icon-thought-highlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF2F1B5E360D00EF5718 /* chooser-moment-icon-thought-highlighted@2x.png */; };
25 | DA57DF401B5E360D00EF5718 /* chooser-moment-icon-thought@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF301B5E360D00EF5718 /* chooser-moment-icon-thought@2x.png */; };
26 | DA57DF451B5E36A200EF5718 /* bloom.caf in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF421B5E36A200EF5718 /* bloom.caf */; };
27 | DA57DF461B5E36A200EF5718 /* fold.caf in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF431B5E36A200EF5718 /* fold.caf */; };
28 | DA57DF471B5E36A200EF5718 /* selected.caf in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF441B5E36A200EF5718 /* selected.caf */; };
29 | DA57DF551B5F6A8400EF5718 /* DWBubbleMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DA57DF541B5F6A8400EF5718 /* DWBubbleMenuButton.m */; };
30 | DA57DF5B1B5FC6C300EF5718 /* MCFireworksButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DA57DF581B5FC6C300EF5718 /* MCFireworksButton.m */; };
31 | DA57DF5C1B5FC6C300EF5718 /* MCFireworksView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA57DF5A1B5FC6C300EF5718 /* MCFireworksView.m */; };
32 | DA57DF601B5FC72300EF5718 /* Like-Blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF5D1B5FC72300EF5718 /* Like-Blue@2x.png */; };
33 | DA57DF611B5FC72300EF5718 /* Like@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF5E1B5FC72300EF5718 /* Like@2x.png */; };
34 | DA57DF621B5FC72300EF5718 /* Sparkle.png in Resources */ = {isa = PBXBuildFile; fileRef = DA57DF5F1B5FC72300EF5718 /* Sparkle.png */; };
35 | DA6B3A911BAFF26C00D82AC1 /* AffineTransformController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6B3A841BAFF26C00D82AC1 /* AffineTransformController.m */; };
36 | DA6B3A921BAFF26C00D82AC1 /* BaseAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6B3A861BAFF26C00D82AC1 /* BaseAnimationController.m */; };
37 | DA6B3A931BAFF26C00D82AC1 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6B3A881BAFF26C00D82AC1 /* BaseViewController.m */; };
38 | DA6B3A941BAFF26C00D82AC1 /* ComprehensiveCaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6B3A8A1BAFF26C00D82AC1 /* ComprehensiveCaseController.m */; };
39 | DA6B3A951BAFF26C00D82AC1 /* GroupAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6B3A8C1BAFF26C00D82AC1 /* GroupAnimationController.m */; };
40 | DA6B3A961BAFF26C00D82AC1 /* KeyFrameAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6B3A8E1BAFF26C00D82AC1 /* KeyFrameAnimationController.m */; };
41 | DA6B3A971BAFF26C00D82AC1 /* TransitionAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6B3A901BAFF26C00D82AC1 /* TransitionAnimationController.m */; };
42 | DA88940D1B53E3FF00B47DE7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88940C1B53E3FF00B47DE7 /* main.m */; };
43 | DA8894101B53E3FF00B47DE7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88940F1B53E3FF00B47DE7 /* AppDelegate.m */; };
44 | DA8894131B53E3FF00B47DE7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8894121B53E3FF00B47DE7 /* ViewController.m */; };
45 | DA8894161B53E3FF00B47DE7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DA8894141B53E3FF00B47DE7 /* Main.storyboard */; };
46 | DA8894181B53E3FF00B47DE7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA8894171B53E3FF00B47DE7 /* Images.xcassets */; };
47 | DA88941B1B53E3FF00B47DE7 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA8894191B53E3FF00B47DE7 /* LaunchScreen.xib */; };
48 | DA8894271B53E3FF00B47DE7 /* ____Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8894261B53E3FF00B47DE7 /* ____Tests.m */; };
49 | DA8894331B53E7A200B47DE7 /* SWRevealViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8894321B53E7A200B47DE7 /* SWRevealViewController.m */; };
50 | DA8894391B53F00300B47DE7 /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8894381B53F00300B47DE7 /* RightViewController.m */; };
51 | DA88943F1B53F0CB00B47DE7 /* LeftViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88943E1B53F0CB00B47DE7 /* LeftViewController.m */; };
52 | DAADC32A1B5B40A700E6C503 /* TitleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DAADC3291B5B40A700E6C503 /* TitleButton.m */; };
53 | DADDB5121BC8EEFD0029AC56 /* DCPathButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DADDB50D1BC8EEFD0029AC56 /* DCPathButton.m */; settings = {ASSET_TAGS = (); }; };
54 | DADDB5131BC8EEFD0029AC56 /* DCPathCenterButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DADDB50F1BC8EEFD0029AC56 /* DCPathCenterButton.m */; settings = {ASSET_TAGS = (); }; };
55 | DADDB5141BC8EEFD0029AC56 /* DCPathItemButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DADDB5111BC8EEFD0029AC56 /* DCPathItemButton.m */; settings = {ASSET_TAGS = (); }; };
56 | /* End PBXBuildFile section */
57 |
58 | /* Begin PBXContainerItemProxy section */
59 | DA8894211B53E3FF00B47DE7 /* PBXContainerItemProxy */ = {
60 | isa = PBXContainerItemProxy;
61 | containerPortal = DA8893FF1B53E3FF00B47DE7 /* Project object */;
62 | proxyType = 1;
63 | remoteGlobalIDString = DA8894061B53E3FF00B47DE7;
64 | remoteInfo = "侧滑菜单";
65 | };
66 | /* End PBXContainerItemProxy section */
67 |
68 | /* Begin PBXFileReference section */
69 | DA57DF211B5E360D00EF5718 /* chooser-button-input-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-button-input-highlighted@2x.png"; sourceTree = ""; };
70 | DA57DF221B5E360D00EF5718 /* chooser-button-input@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-button-input@2x.png"; sourceTree = ""; };
71 | DA57DF231B5E360D00EF5718 /* chooser-button-tab-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-button-tab-highlighted@2x.png"; sourceTree = ""; };
72 | DA57DF241B5E360D00EF5718 /* chooser-button-tab@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-button-tab@2x.png"; sourceTree = ""; };
73 | DA57DF251B5E360D00EF5718 /* chooser-moment-button-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-button-highlighted@2x.png"; sourceTree = ""; };
74 | DA57DF261B5E360D00EF5718 /* chooser-moment-button@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-button@2x.png"; sourceTree = ""; };
75 | DA57DF271B5E360D00EF5718 /* chooser-moment-icon-camera-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-camera-highlighted@2x.png"; sourceTree = ""; };
76 | DA57DF281B5E360D00EF5718 /* chooser-moment-icon-camera@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-camera@2x.png"; sourceTree = ""; };
77 | DA57DF291B5E360D00EF5718 /* chooser-moment-icon-music-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-music-highlighted@2x.png"; sourceTree = ""; };
78 | DA57DF2A1B5E360D00EF5718 /* chooser-moment-icon-music@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-music@2x.png"; sourceTree = ""; };
79 | DA57DF2B1B5E360D00EF5718 /* chooser-moment-icon-place-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-place-highlighted@2x.png"; sourceTree = ""; };
80 | DA57DF2C1B5E360D00EF5718 /* chooser-moment-icon-place@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-place@2x.png"; sourceTree = ""; };
81 | DA57DF2D1B5E360D00EF5718 /* chooser-moment-icon-sleep-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-sleep-highlighted@2x.png"; sourceTree = ""; };
82 | DA57DF2E1B5E360D00EF5718 /* chooser-moment-icon-sleep@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-sleep@2x.png"; sourceTree = ""; };
83 | DA57DF2F1B5E360D00EF5718 /* chooser-moment-icon-thought-highlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-thought-highlighted@2x.png"; sourceTree = ""; };
84 | DA57DF301B5E360D00EF5718 /* chooser-moment-icon-thought@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chooser-moment-icon-thought@2x.png"; sourceTree = ""; };
85 | DA57DF421B5E36A200EF5718 /* bloom.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = bloom.caf; sourceTree = ""; };
86 | DA57DF431B5E36A200EF5718 /* fold.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = fold.caf; sourceTree = ""; };
87 | DA57DF441B5E36A200EF5718 /* selected.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = selected.caf; sourceTree = ""; };
88 | DA57DF531B5F6A8400EF5718 /* DWBubbleMenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWBubbleMenuButton.h; sourceTree = ""; };
89 | DA57DF541B5F6A8400EF5718 /* DWBubbleMenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWBubbleMenuButton.m; sourceTree = ""; };
90 | DA57DF571B5FC6C300EF5718 /* MCFireworksButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCFireworksButton.h; sourceTree = ""; };
91 | DA57DF581B5FC6C300EF5718 /* MCFireworksButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCFireworksButton.m; sourceTree = ""; };
92 | DA57DF591B5FC6C300EF5718 /* MCFireworksView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCFireworksView.h; sourceTree = ""; };
93 | DA57DF5A1B5FC6C300EF5718 /* MCFireworksView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCFireworksView.m; sourceTree = ""; };
94 | DA57DF5D1B5FC72300EF5718 /* Like-Blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Like-Blue@2x.png"; sourceTree = ""; };
95 | DA57DF5E1B5FC72300EF5718 /* Like@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Like@2x.png"; sourceTree = ""; };
96 | DA57DF5F1B5FC72300EF5718 /* Sparkle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Sparkle.png; sourceTree = ""; };
97 | DA6B3A831BAFF26C00D82AC1 /* AffineTransformController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AffineTransformController.h; sourceTree = ""; };
98 | DA6B3A841BAFF26C00D82AC1 /* AffineTransformController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AffineTransformController.m; sourceTree = ""; };
99 | DA6B3A851BAFF26C00D82AC1 /* BaseAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseAnimationController.h; sourceTree = ""; };
100 | DA6B3A861BAFF26C00D82AC1 /* BaseAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseAnimationController.m; sourceTree = ""; };
101 | DA6B3A871BAFF26C00D82AC1 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = ""; };
102 | DA6B3A881BAFF26C00D82AC1 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = ""; };
103 | DA6B3A891BAFF26C00D82AC1 /* ComprehensiveCaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComprehensiveCaseController.h; sourceTree = ""; };
104 | DA6B3A8A1BAFF26C00D82AC1 /* ComprehensiveCaseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ComprehensiveCaseController.m; sourceTree = ""; };
105 | DA6B3A8B1BAFF26C00D82AC1 /* GroupAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupAnimationController.h; sourceTree = ""; };
106 | DA6B3A8C1BAFF26C00D82AC1 /* GroupAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupAnimationController.m; sourceTree = ""; };
107 | DA6B3A8D1BAFF26C00D82AC1 /* KeyFrameAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyFrameAnimationController.h; sourceTree = ""; };
108 | DA6B3A8E1BAFF26C00D82AC1 /* KeyFrameAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyFrameAnimationController.m; sourceTree = ""; };
109 | DA6B3A8F1BAFF26C00D82AC1 /* TransitionAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransitionAnimationController.h; sourceTree = ""; };
110 | DA6B3A901BAFF26C00D82AC1 /* TransitionAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TransitionAnimationController.m; sourceTree = ""; };
111 | DA8894071B53E3FF00B47DE7 /* 侧滑菜单.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "侧滑菜单.app"; sourceTree = BUILT_PRODUCTS_DIR; };
112 | DA88940B1B53E3FF00B47DE7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
113 | DA88940C1B53E3FF00B47DE7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
114 | DA88940E1B53E3FF00B47DE7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
115 | DA88940F1B53E3FF00B47DE7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
116 | DA8894111B53E3FF00B47DE7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
117 | DA8894121B53E3FF00B47DE7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
118 | DA8894151B53E3FF00B47DE7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
119 | DA8894171B53E3FF00B47DE7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
120 | DA88941A1B53E3FF00B47DE7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
121 | DA8894201B53E3FF00B47DE7 /* 侧滑菜单Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "侧滑菜单Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
122 | DA8894251B53E3FF00B47DE7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
123 | DA8894261B53E3FF00B47DE7 /* ____Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "____Tests.m"; sourceTree = ""; };
124 | DA8894311B53E7A200B47DE7 /* SWRevealViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWRevealViewController.h; sourceTree = ""; };
125 | DA8894321B53E7A200B47DE7 /* SWRevealViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWRevealViewController.m; sourceTree = ""; };
126 | DA8894371B53F00300B47DE7 /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewController.h; sourceTree = ""; };
127 | DA8894381B53F00300B47DE7 /* RightViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RightViewController.m; sourceTree = ""; };
128 | DA88943D1B53F0CB00B47DE7 /* LeftViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftViewController.h; sourceTree = ""; };
129 | DA88943E1B53F0CB00B47DE7 /* LeftViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftViewController.m; sourceTree = ""; };
130 | DA8894401B55233C00B47DE7 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; };
131 | DAADC3281B5B40A700E6C503 /* TitleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TitleButton.h; sourceTree = ""; };
132 | DAADC3291B5B40A700E6C503 /* TitleButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TitleButton.m; sourceTree = ""; };
133 | DADDB50C1BC8EEFD0029AC56 /* DCPathButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPathButton.h; sourceTree = ""; };
134 | DADDB50D1BC8EEFD0029AC56 /* DCPathButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPathButton.m; sourceTree = ""; };
135 | DADDB50E1BC8EEFD0029AC56 /* DCPathCenterButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPathCenterButton.h; sourceTree = ""; };
136 | DADDB50F1BC8EEFD0029AC56 /* DCPathCenterButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPathCenterButton.m; sourceTree = ""; };
137 | DADDB5101BC8EEFD0029AC56 /* DCPathItemButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPathItemButton.h; sourceTree = ""; };
138 | DADDB5111BC8EEFD0029AC56 /* DCPathItemButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPathItemButton.m; sourceTree = ""; };
139 | /* End PBXFileReference section */
140 |
141 | /* Begin PBXFrameworksBuildPhase section */
142 | DA8894041B53E3FF00B47DE7 /* Frameworks */ = {
143 | isa = PBXFrameworksBuildPhase;
144 | buildActionMask = 2147483647;
145 | files = (
146 | );
147 | runOnlyForDeploymentPostprocessing = 0;
148 | };
149 | DA88941D1B53E3FF00B47DE7 /* Frameworks */ = {
150 | isa = PBXFrameworksBuildPhase;
151 | buildActionMask = 2147483647;
152 | files = (
153 | );
154 | runOnlyForDeploymentPostprocessing = 0;
155 | };
156 | /* End PBXFrameworksBuildPhase section */
157 |
158 | /* Begin PBXGroup section */
159 | DA57DF201B5E35F900EF5718 /* image */ = {
160 | isa = PBXGroup;
161 | children = (
162 | DA57DF5D1B5FC72300EF5718 /* Like-Blue@2x.png */,
163 | DA57DF5E1B5FC72300EF5718 /* Like@2x.png */,
164 | DA57DF5F1B5FC72300EF5718 /* Sparkle.png */,
165 | DA57DF211B5E360D00EF5718 /* chooser-button-input-highlighted@2x.png */,
166 | DA57DF221B5E360D00EF5718 /* chooser-button-input@2x.png */,
167 | DA57DF231B5E360D00EF5718 /* chooser-button-tab-highlighted@2x.png */,
168 | DA57DF241B5E360D00EF5718 /* chooser-button-tab@2x.png */,
169 | DA57DF251B5E360D00EF5718 /* chooser-moment-button-highlighted@2x.png */,
170 | DA57DF261B5E360D00EF5718 /* chooser-moment-button@2x.png */,
171 | DA57DF271B5E360D00EF5718 /* chooser-moment-icon-camera-highlighted@2x.png */,
172 | DA57DF281B5E360D00EF5718 /* chooser-moment-icon-camera@2x.png */,
173 | DA57DF291B5E360D00EF5718 /* chooser-moment-icon-music-highlighted@2x.png */,
174 | DA57DF2A1B5E360D00EF5718 /* chooser-moment-icon-music@2x.png */,
175 | DA57DF2B1B5E360D00EF5718 /* chooser-moment-icon-place-highlighted@2x.png */,
176 | DA57DF2C1B5E360D00EF5718 /* chooser-moment-icon-place@2x.png */,
177 | DA57DF2D1B5E360D00EF5718 /* chooser-moment-icon-sleep-highlighted@2x.png */,
178 | DA57DF2E1B5E360D00EF5718 /* chooser-moment-icon-sleep@2x.png */,
179 | DA57DF2F1B5E360D00EF5718 /* chooser-moment-icon-thought-highlighted@2x.png */,
180 | DA57DF301B5E360D00EF5718 /* chooser-moment-icon-thought@2x.png */,
181 | );
182 | path = image;
183 | sourceTree = "";
184 | };
185 | DA57DF411B5E36A200EF5718 /* Sounds */ = {
186 | isa = PBXGroup;
187 | children = (
188 | DA57DF421B5E36A200EF5718 /* bloom.caf */,
189 | DA57DF431B5E36A200EF5718 /* fold.caf */,
190 | DA57DF441B5E36A200EF5718 /* selected.caf */,
191 | );
192 | path = Sounds;
193 | sourceTree = "";
194 | };
195 | DA57DF521B5F69DF00EF5718 /* DWBubbleMenuButton */ = {
196 | isa = PBXGroup;
197 | children = (
198 | DA57DF531B5F6A8400EF5718 /* DWBubbleMenuButton.h */,
199 | DA57DF541B5F6A8400EF5718 /* DWBubbleMenuButton.m */,
200 | );
201 | path = DWBubbleMenuButton;
202 | sourceTree = "";
203 | };
204 | DA57DF561B5FC68400EF5718 /* MCFireworksButton */ = {
205 | isa = PBXGroup;
206 | children = (
207 | DA57DF571B5FC6C300EF5718 /* MCFireworksButton.h */,
208 | DA57DF581B5FC6C300EF5718 /* MCFireworksButton.m */,
209 | DA57DF591B5FC6C300EF5718 /* MCFireworksView.h */,
210 | DA57DF5A1B5FC6C300EF5718 /* MCFireworksView.m */,
211 | );
212 | path = MCFireworksButton;
213 | sourceTree = "";
214 | };
215 | DA6B3A821BAFF26C00D82AC1 /* Controller */ = {
216 | isa = PBXGroup;
217 | children = (
218 | DA6B3A831BAFF26C00D82AC1 /* AffineTransformController.h */,
219 | DA6B3A841BAFF26C00D82AC1 /* AffineTransformController.m */,
220 | DA6B3A851BAFF26C00D82AC1 /* BaseAnimationController.h */,
221 | DA6B3A861BAFF26C00D82AC1 /* BaseAnimationController.m */,
222 | DA6B3A871BAFF26C00D82AC1 /* BaseViewController.h */,
223 | DA6B3A881BAFF26C00D82AC1 /* BaseViewController.m */,
224 | DA6B3A891BAFF26C00D82AC1 /* ComprehensiveCaseController.h */,
225 | DA6B3A8A1BAFF26C00D82AC1 /* ComprehensiveCaseController.m */,
226 | DA6B3A8B1BAFF26C00D82AC1 /* GroupAnimationController.h */,
227 | DA6B3A8C1BAFF26C00D82AC1 /* GroupAnimationController.m */,
228 | DA6B3A8D1BAFF26C00D82AC1 /* KeyFrameAnimationController.h */,
229 | DA6B3A8E1BAFF26C00D82AC1 /* KeyFrameAnimationController.m */,
230 | DA6B3A8F1BAFF26C00D82AC1 /* TransitionAnimationController.h */,
231 | DA6B3A901BAFF26C00D82AC1 /* TransitionAnimationController.m */,
232 | );
233 | path = Controller;
234 | sourceTree = "";
235 | };
236 | DA8893FE1B53E3FF00B47DE7 = {
237 | isa = PBXGroup;
238 | children = (
239 | DA8894091B53E3FF00B47DE7 /* 侧滑菜单 */,
240 | DA8894231B53E3FF00B47DE7 /* 侧滑菜单Tests */,
241 | DA8894081B53E3FF00B47DE7 /* Products */,
242 | );
243 | sourceTree = "";
244 | };
245 | DA8894081B53E3FF00B47DE7 /* Products */ = {
246 | isa = PBXGroup;
247 | children = (
248 | DA8894071B53E3FF00B47DE7 /* 侧滑菜单.app */,
249 | DA8894201B53E3FF00B47DE7 /* 侧滑菜单Tests.xctest */,
250 | );
251 | name = Products;
252 | sourceTree = "";
253 | };
254 | DA8894091B53E3FF00B47DE7 /* 侧滑菜单 */ = {
255 | isa = PBXGroup;
256 | children = (
257 | DADDB50B1BC8EEFD0029AC56 /* DCPathButton */,
258 | DA57DF561B5FC68400EF5718 /* MCFireworksButton */,
259 | DA57DF521B5F69DF00EF5718 /* DWBubbleMenuButton */,
260 | DA8894361B53EFB600B47DE7 /* RightPage */,
261 | DA8894351B53EF9500B47DE7 /* CenterPage */,
262 | DA8894341B53EF5700B47DE7 /* LeftPage */,
263 | DA8894301B53E78000B47DE7 /* SWRevealViewController */,
264 | DA88940E1B53E3FF00B47DE7 /* AppDelegate.h */,
265 | DA88940F1B53E3FF00B47DE7 /* AppDelegate.m */,
266 | DA8894111B53E3FF00B47DE7 /* ViewController.h */,
267 | DA8894121B53E3FF00B47DE7 /* ViewController.m */,
268 | DA8894141B53E3FF00B47DE7 /* Main.storyboard */,
269 | DA8894171B53E3FF00B47DE7 /* Images.xcassets */,
270 | DA8894191B53E3FF00B47DE7 /* LaunchScreen.xib */,
271 | DA88940A1B53E3FF00B47DE7 /* Supporting Files */,
272 | );
273 | path = "侧滑菜单";
274 | sourceTree = "";
275 | };
276 | DA88940A1B53E3FF00B47DE7 /* Supporting Files */ = {
277 | isa = PBXGroup;
278 | children = (
279 | DA57DF411B5E36A200EF5718 /* Sounds */,
280 | DA57DF201B5E35F900EF5718 /* image */,
281 | DA88940B1B53E3FF00B47DE7 /* Info.plist */,
282 | DA88940C1B53E3FF00B47DE7 /* main.m */,
283 | DA8894401B55233C00B47DE7 /* PrefixHeader.pch */,
284 | );
285 | name = "Supporting Files";
286 | sourceTree = "";
287 | };
288 | DA8894231B53E3FF00B47DE7 /* 侧滑菜单Tests */ = {
289 | isa = PBXGroup;
290 | children = (
291 | DA8894261B53E3FF00B47DE7 /* ____Tests.m */,
292 | DA8894241B53E3FF00B47DE7 /* Supporting Files */,
293 | );
294 | path = "侧滑菜单Tests";
295 | sourceTree = "";
296 | };
297 | DA8894241B53E3FF00B47DE7 /* Supporting Files */ = {
298 | isa = PBXGroup;
299 | children = (
300 | DA8894251B53E3FF00B47DE7 /* Info.plist */,
301 | );
302 | name = "Supporting Files";
303 | sourceTree = "";
304 | };
305 | DA8894301B53E78000B47DE7 /* SWRevealViewController */ = {
306 | isa = PBXGroup;
307 | children = (
308 | DA8894311B53E7A200B47DE7 /* SWRevealViewController.h */,
309 | DA8894321B53E7A200B47DE7 /* SWRevealViewController.m */,
310 | );
311 | path = SWRevealViewController;
312 | sourceTree = "";
313 | };
314 | DA8894341B53EF5700B47DE7 /* LeftPage */ = {
315 | isa = PBXGroup;
316 | children = (
317 | DA88943D1B53F0CB00B47DE7 /* LeftViewController.h */,
318 | DA88943E1B53F0CB00B47DE7 /* LeftViewController.m */,
319 | );
320 | path = LeftPage;
321 | sourceTree = "";
322 | };
323 | DA8894351B53EF9500B47DE7 /* CenterPage */ = {
324 | isa = PBXGroup;
325 | children = (
326 | DA6B3A821BAFF26C00D82AC1 /* Controller */,
327 | DAADC3271B5B404900E6C503 /* View */,
328 | );
329 | path = CenterPage;
330 | sourceTree = "";
331 | };
332 | DA8894361B53EFB600B47DE7 /* RightPage */ = {
333 | isa = PBXGroup;
334 | children = (
335 | DA8894371B53F00300B47DE7 /* RightViewController.h */,
336 | DA8894381B53F00300B47DE7 /* RightViewController.m */,
337 | );
338 | path = RightPage;
339 | sourceTree = "";
340 | };
341 | DAADC3271B5B404900E6C503 /* View */ = {
342 | isa = PBXGroup;
343 | children = (
344 | DAADC3281B5B40A700E6C503 /* TitleButton.h */,
345 | DAADC3291B5B40A700E6C503 /* TitleButton.m */,
346 | );
347 | path = View;
348 | sourceTree = "";
349 | };
350 | DADDB50B1BC8EEFD0029AC56 /* DCPathButton */ = {
351 | isa = PBXGroup;
352 | children = (
353 | DADDB50C1BC8EEFD0029AC56 /* DCPathButton.h */,
354 | DADDB50D1BC8EEFD0029AC56 /* DCPathButton.m */,
355 | DADDB50E1BC8EEFD0029AC56 /* DCPathCenterButton.h */,
356 | DADDB50F1BC8EEFD0029AC56 /* DCPathCenterButton.m */,
357 | DADDB5101BC8EEFD0029AC56 /* DCPathItemButton.h */,
358 | DADDB5111BC8EEFD0029AC56 /* DCPathItemButton.m */,
359 | );
360 | path = DCPathButton;
361 | sourceTree = "";
362 | };
363 | /* End PBXGroup section */
364 |
365 | /* Begin PBXNativeTarget section */
366 | DA8894061B53E3FF00B47DE7 /* 侧滑菜单 */ = {
367 | isa = PBXNativeTarget;
368 | buildConfigurationList = DA88942A1B53E3FF00B47DE7 /* Build configuration list for PBXNativeTarget "侧滑菜单" */;
369 | buildPhases = (
370 | DA8894031B53E3FF00B47DE7 /* Sources */,
371 | DA8894041B53E3FF00B47DE7 /* Frameworks */,
372 | DA8894051B53E3FF00B47DE7 /* Resources */,
373 | );
374 | buildRules = (
375 | );
376 | dependencies = (
377 | );
378 | name = "侧滑菜单";
379 | productName = "侧滑菜单";
380 | productReference = DA8894071B53E3FF00B47DE7 /* 侧滑菜单.app */;
381 | productType = "com.apple.product-type.application";
382 | };
383 | DA88941F1B53E3FF00B47DE7 /* 侧滑菜单Tests */ = {
384 | isa = PBXNativeTarget;
385 | buildConfigurationList = DA88942D1B53E3FF00B47DE7 /* Build configuration list for PBXNativeTarget "侧滑菜单Tests" */;
386 | buildPhases = (
387 | DA88941C1B53E3FF00B47DE7 /* Sources */,
388 | DA88941D1B53E3FF00B47DE7 /* Frameworks */,
389 | DA88941E1B53E3FF00B47DE7 /* Resources */,
390 | );
391 | buildRules = (
392 | );
393 | dependencies = (
394 | DA8894221B53E3FF00B47DE7 /* PBXTargetDependency */,
395 | );
396 | name = "侧滑菜单Tests";
397 | productName = "侧滑菜单Tests";
398 | productReference = DA8894201B53E3FF00B47DE7 /* 侧滑菜单Tests.xctest */;
399 | productType = "com.apple.product-type.bundle.unit-test";
400 | };
401 | /* End PBXNativeTarget section */
402 |
403 | /* Begin PBXProject section */
404 | DA8893FF1B53E3FF00B47DE7 /* Project object */ = {
405 | isa = PBXProject;
406 | attributes = {
407 | LastUpgradeCheck = 0630;
408 | ORGANIZATIONNAME = yixiang;
409 | TargetAttributes = {
410 | DA8894061B53E3FF00B47DE7 = {
411 | CreatedOnToolsVersion = 6.3.2;
412 | };
413 | DA88941F1B53E3FF00B47DE7 = {
414 | CreatedOnToolsVersion = 6.3.2;
415 | TestTargetID = DA8894061B53E3FF00B47DE7;
416 | };
417 | };
418 | };
419 | buildConfigurationList = DA8894021B53E3FF00B47DE7 /* Build configuration list for PBXProject "侧滑菜单" */;
420 | compatibilityVersion = "Xcode 3.2";
421 | developmentRegion = English;
422 | hasScannedForEncodings = 0;
423 | knownRegions = (
424 | en,
425 | Base,
426 | );
427 | mainGroup = DA8893FE1B53E3FF00B47DE7;
428 | productRefGroup = DA8894081B53E3FF00B47DE7 /* Products */;
429 | projectDirPath = "";
430 | projectRoot = "";
431 | targets = (
432 | DA8894061B53E3FF00B47DE7 /* 侧滑菜单 */,
433 | DA88941F1B53E3FF00B47DE7 /* 侧滑菜单Tests */,
434 | );
435 | };
436 | /* End PBXProject section */
437 |
438 | /* Begin PBXResourcesBuildPhase section */
439 | DA8894051B53E3FF00B47DE7 /* Resources */ = {
440 | isa = PBXResourcesBuildPhase;
441 | buildActionMask = 2147483647;
442 | files = (
443 | DA57DF3C1B5E360D00EF5718 /* chooser-moment-icon-place@2x.png in Resources */,
444 | DA57DF3F1B5E360D00EF5718 /* chooser-moment-icon-thought-highlighted@2x.png in Resources */,
445 | DA57DF331B5E360D00EF5718 /* chooser-button-tab-highlighted@2x.png in Resources */,
446 | DA8894161B53E3FF00B47DE7 /* Main.storyboard in Resources */,
447 | DA57DF3D1B5E360D00EF5718 /* chooser-moment-icon-sleep-highlighted@2x.png in Resources */,
448 | DA88941B1B53E3FF00B47DE7 /* LaunchScreen.xib in Resources */,
449 | DA57DF391B5E360D00EF5718 /* chooser-moment-icon-music-highlighted@2x.png in Resources */,
450 | DA57DF621B5FC72300EF5718 /* Sparkle.png in Resources */,
451 | DA57DF361B5E360D00EF5718 /* chooser-moment-button@2x.png in Resources */,
452 | DA57DF371B5E360D00EF5718 /* chooser-moment-icon-camera-highlighted@2x.png in Resources */,
453 | DA57DF471B5E36A200EF5718 /* selected.caf in Resources */,
454 | DA8894181B53E3FF00B47DE7 /* Images.xcassets in Resources */,
455 | DA57DF401B5E360D00EF5718 /* chooser-moment-icon-thought@2x.png in Resources */,
456 | DA57DF351B5E360D00EF5718 /* chooser-moment-button-highlighted@2x.png in Resources */,
457 | DA57DF461B5E36A200EF5718 /* fold.caf in Resources */,
458 | DA57DF3E1B5E360D00EF5718 /* chooser-moment-icon-sleep@2x.png in Resources */,
459 | DA57DF381B5E360D00EF5718 /* chooser-moment-icon-camera@2x.png in Resources */,
460 | DA57DF321B5E360D00EF5718 /* chooser-button-input@2x.png in Resources */,
461 | DA57DF341B5E360D00EF5718 /* chooser-button-tab@2x.png in Resources */,
462 | DA57DF311B5E360D00EF5718 /* chooser-button-input-highlighted@2x.png in Resources */,
463 | DA57DF3A1B5E360D00EF5718 /* chooser-moment-icon-music@2x.png in Resources */,
464 | DA57DF601B5FC72300EF5718 /* Like-Blue@2x.png in Resources */,
465 | DA57DF611B5FC72300EF5718 /* Like@2x.png in Resources */,
466 | DA57DF451B5E36A200EF5718 /* bloom.caf in Resources */,
467 | DA57DF3B1B5E360D00EF5718 /* chooser-moment-icon-place-highlighted@2x.png in Resources */,
468 | );
469 | runOnlyForDeploymentPostprocessing = 0;
470 | };
471 | DA88941E1B53E3FF00B47DE7 /* Resources */ = {
472 | isa = PBXResourcesBuildPhase;
473 | buildActionMask = 2147483647;
474 | files = (
475 | );
476 | runOnlyForDeploymentPostprocessing = 0;
477 | };
478 | /* End PBXResourcesBuildPhase section */
479 |
480 | /* Begin PBXSourcesBuildPhase section */
481 | DA8894031B53E3FF00B47DE7 /* Sources */ = {
482 | isa = PBXSourcesBuildPhase;
483 | buildActionMask = 2147483647;
484 | files = (
485 | DADDB5131BC8EEFD0029AC56 /* DCPathCenterButton.m in Sources */,
486 | DA6B3A921BAFF26C00D82AC1 /* BaseAnimationController.m in Sources */,
487 | DA6B3A961BAFF26C00D82AC1 /* KeyFrameAnimationController.m in Sources */,
488 | DA8894391B53F00300B47DE7 /* RightViewController.m in Sources */,
489 | DA57DF5C1B5FC6C300EF5718 /* MCFireworksView.m in Sources */,
490 | DA57DF551B5F6A8400EF5718 /* DWBubbleMenuButton.m in Sources */,
491 | DA6B3A971BAFF26C00D82AC1 /* TransitionAnimationController.m in Sources */,
492 | DA6B3A951BAFF26C00D82AC1 /* GroupAnimationController.m in Sources */,
493 | DADDB5141BC8EEFD0029AC56 /* DCPathItemButton.m in Sources */,
494 | DA8894131B53E3FF00B47DE7 /* ViewController.m in Sources */,
495 | DA57DF5B1B5FC6C300EF5718 /* MCFireworksButton.m in Sources */,
496 | DADDB5121BC8EEFD0029AC56 /* DCPathButton.m in Sources */,
497 | DA6B3A911BAFF26C00D82AC1 /* AffineTransformController.m in Sources */,
498 | DA8894101B53E3FF00B47DE7 /* AppDelegate.m in Sources */,
499 | DA6B3A931BAFF26C00D82AC1 /* BaseViewController.m in Sources */,
500 | DAADC32A1B5B40A700E6C503 /* TitleButton.m in Sources */,
501 | DA88943F1B53F0CB00B47DE7 /* LeftViewController.m in Sources */,
502 | DA88940D1B53E3FF00B47DE7 /* main.m in Sources */,
503 | DA6B3A941BAFF26C00D82AC1 /* ComprehensiveCaseController.m in Sources */,
504 | DA8894331B53E7A200B47DE7 /* SWRevealViewController.m in Sources */,
505 | );
506 | runOnlyForDeploymentPostprocessing = 0;
507 | };
508 | DA88941C1B53E3FF00B47DE7 /* Sources */ = {
509 | isa = PBXSourcesBuildPhase;
510 | buildActionMask = 2147483647;
511 | files = (
512 | DA8894271B53E3FF00B47DE7 /* ____Tests.m in Sources */,
513 | );
514 | runOnlyForDeploymentPostprocessing = 0;
515 | };
516 | /* End PBXSourcesBuildPhase section */
517 |
518 | /* Begin PBXTargetDependency section */
519 | DA8894221B53E3FF00B47DE7 /* PBXTargetDependency */ = {
520 | isa = PBXTargetDependency;
521 | target = DA8894061B53E3FF00B47DE7 /* 侧滑菜单 */;
522 | targetProxy = DA8894211B53E3FF00B47DE7 /* PBXContainerItemProxy */;
523 | };
524 | /* End PBXTargetDependency section */
525 |
526 | /* Begin PBXVariantGroup section */
527 | DA8894141B53E3FF00B47DE7 /* Main.storyboard */ = {
528 | isa = PBXVariantGroup;
529 | children = (
530 | DA8894151B53E3FF00B47DE7 /* Base */,
531 | );
532 | name = Main.storyboard;
533 | sourceTree = "";
534 | };
535 | DA8894191B53E3FF00B47DE7 /* LaunchScreen.xib */ = {
536 | isa = PBXVariantGroup;
537 | children = (
538 | DA88941A1B53E3FF00B47DE7 /* Base */,
539 | );
540 | name = LaunchScreen.xib;
541 | sourceTree = "";
542 | };
543 | /* End PBXVariantGroup section */
544 |
545 | /* Begin XCBuildConfiguration section */
546 | DA8894281B53E3FF00B47DE7 /* Debug */ = {
547 | isa = XCBuildConfiguration;
548 | buildSettings = {
549 | ALWAYS_SEARCH_USER_PATHS = NO;
550 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
551 | CLANG_CXX_LIBRARY = "libc++";
552 | CLANG_ENABLE_MODULES = YES;
553 | CLANG_ENABLE_OBJC_ARC = YES;
554 | CLANG_WARN_BOOL_CONVERSION = YES;
555 | CLANG_WARN_CONSTANT_CONVERSION = YES;
556 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
557 | CLANG_WARN_EMPTY_BODY = YES;
558 | CLANG_WARN_ENUM_CONVERSION = YES;
559 | CLANG_WARN_INT_CONVERSION = YES;
560 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
561 | CLANG_WARN_UNREACHABLE_CODE = YES;
562 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
563 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
564 | COPY_PHASE_STRIP = NO;
565 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
566 | ENABLE_STRICT_OBJC_MSGSEND = YES;
567 | GCC_C_LANGUAGE_STANDARD = gnu99;
568 | GCC_DYNAMIC_NO_PIC = NO;
569 | GCC_NO_COMMON_BLOCKS = YES;
570 | GCC_OPTIMIZATION_LEVEL = 0;
571 | GCC_PREPROCESSOR_DEFINITIONS = (
572 | "DEBUG=1",
573 | "$(inherited)",
574 | );
575 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
576 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
577 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
578 | GCC_WARN_UNDECLARED_SELECTOR = YES;
579 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
580 | GCC_WARN_UNUSED_FUNCTION = YES;
581 | GCC_WARN_UNUSED_VARIABLE = YES;
582 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
583 | MTL_ENABLE_DEBUG_INFO = YES;
584 | ONLY_ACTIVE_ARCH = YES;
585 | SDKROOT = iphoneos;
586 | };
587 | name = Debug;
588 | };
589 | DA8894291B53E3FF00B47DE7 /* Release */ = {
590 | isa = XCBuildConfiguration;
591 | buildSettings = {
592 | ALWAYS_SEARCH_USER_PATHS = NO;
593 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
594 | CLANG_CXX_LIBRARY = "libc++";
595 | CLANG_ENABLE_MODULES = YES;
596 | CLANG_ENABLE_OBJC_ARC = YES;
597 | CLANG_WARN_BOOL_CONVERSION = YES;
598 | CLANG_WARN_CONSTANT_CONVERSION = YES;
599 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
600 | CLANG_WARN_EMPTY_BODY = YES;
601 | CLANG_WARN_ENUM_CONVERSION = YES;
602 | CLANG_WARN_INT_CONVERSION = YES;
603 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
604 | CLANG_WARN_UNREACHABLE_CODE = YES;
605 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
606 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
607 | COPY_PHASE_STRIP = NO;
608 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
609 | ENABLE_NS_ASSERTIONS = NO;
610 | ENABLE_STRICT_OBJC_MSGSEND = YES;
611 | GCC_C_LANGUAGE_STANDARD = gnu99;
612 | GCC_NO_COMMON_BLOCKS = YES;
613 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
614 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
615 | GCC_WARN_UNDECLARED_SELECTOR = YES;
616 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
617 | GCC_WARN_UNUSED_FUNCTION = YES;
618 | GCC_WARN_UNUSED_VARIABLE = YES;
619 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
620 | MTL_ENABLE_DEBUG_INFO = NO;
621 | SDKROOT = iphoneos;
622 | VALIDATE_PRODUCT = YES;
623 | };
624 | name = Release;
625 | };
626 | DA88942B1B53E3FF00B47DE7 /* Debug */ = {
627 | isa = XCBuildConfiguration;
628 | buildSettings = {
629 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
630 | CLANG_ENABLE_MODULES = YES;
631 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
632 | GCC_PREFIX_HEADER = "$(SRCROOT)/侧滑菜单/PrefixHeader.pch";
633 | INFOPLIST_FILE = "侧滑菜单/Info.plist";
634 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
635 | PRODUCT_NAME = "$(TARGET_NAME)";
636 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
637 | };
638 | name = Debug;
639 | };
640 | DA88942C1B53E3FF00B47DE7 /* Release */ = {
641 | isa = XCBuildConfiguration;
642 | buildSettings = {
643 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
644 | CLANG_ENABLE_MODULES = YES;
645 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
646 | GCC_PREFIX_HEADER = "$(SRCROOT)/侧滑菜单/PrefixHeader.pch";
647 | INFOPLIST_FILE = "侧滑菜单/Info.plist";
648 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
649 | PRODUCT_NAME = "$(TARGET_NAME)";
650 | };
651 | name = Release;
652 | };
653 | DA88942E1B53E3FF00B47DE7 /* Debug */ = {
654 | isa = XCBuildConfiguration;
655 | buildSettings = {
656 | BUNDLE_LOADER = "$(TEST_HOST)";
657 | FRAMEWORK_SEARCH_PATHS = (
658 | "$(SDKROOT)/Developer/Library/Frameworks",
659 | "$(inherited)",
660 | );
661 | GCC_PREPROCESSOR_DEFINITIONS = (
662 | "DEBUG=1",
663 | "$(inherited)",
664 | );
665 | INFOPLIST_FILE = "侧滑菜单Tests/Info.plist";
666 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
667 | PRODUCT_NAME = "$(TARGET_NAME)";
668 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/侧滑菜单.app/侧滑菜单";
669 | };
670 | name = Debug;
671 | };
672 | DA88942F1B53E3FF00B47DE7 /* Release */ = {
673 | isa = XCBuildConfiguration;
674 | buildSettings = {
675 | BUNDLE_LOADER = "$(TEST_HOST)";
676 | FRAMEWORK_SEARCH_PATHS = (
677 | "$(SDKROOT)/Developer/Library/Frameworks",
678 | "$(inherited)",
679 | );
680 | INFOPLIST_FILE = "侧滑菜单Tests/Info.plist";
681 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
682 | PRODUCT_NAME = "$(TARGET_NAME)";
683 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/侧滑菜单.app/侧滑菜单";
684 | };
685 | name = Release;
686 | };
687 | /* End XCBuildConfiguration section */
688 |
689 | /* Begin XCConfigurationList section */
690 | DA8894021B53E3FF00B47DE7 /* Build configuration list for PBXProject "侧滑菜单" */ = {
691 | isa = XCConfigurationList;
692 | buildConfigurations = (
693 | DA8894281B53E3FF00B47DE7 /* Debug */,
694 | DA8894291B53E3FF00B47DE7 /* Release */,
695 | );
696 | defaultConfigurationIsVisible = 0;
697 | defaultConfigurationName = Release;
698 | };
699 | DA88942A1B53E3FF00B47DE7 /* Build configuration list for PBXNativeTarget "侧滑菜单" */ = {
700 | isa = XCConfigurationList;
701 | buildConfigurations = (
702 | DA88942B1B53E3FF00B47DE7 /* Debug */,
703 | DA88942C1B53E3FF00B47DE7 /* Release */,
704 | );
705 | defaultConfigurationIsVisible = 0;
706 | defaultConfigurationName = Release;
707 | };
708 | DA88942D1B53E3FF00B47DE7 /* Build configuration list for PBXNativeTarget "侧滑菜单Tests" */ = {
709 | isa = XCConfigurationList;
710 | buildConfigurations = (
711 | DA88942E1B53E3FF00B47DE7 /* Debug */,
712 | DA88942F1B53E3FF00B47DE7 /* Release */,
713 | );
714 | defaultConfigurationIsVisible = 0;
715 | defaultConfigurationName = Release;
716 | };
717 | /* End XCConfigurationList section */
718 | };
719 | rootObject = DA8893FF1B53E3FF00B47DE7 /* Project object */;
720 | }
721 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/project.xcworkspace/xcshareddata/侧滑菜单.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 06780A99-B6E6-4D14-994B-173CA62790BA
9 | IDESourceControlProjectName
10 | 侧滑菜单
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 736DD147C0EBC2E84B8772B79FF27A6BCC165878
14 | https://github.com/yixiangboy/IOSAnimationDemo
15 |
16 | IDESourceControlProjectPath
17 | 侧滑菜单/侧滑菜单.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 736DD147C0EBC2E84B8772B79FF27A6BCC165878
21 | ../../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/yixiangboy/IOSAnimationDemo
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | 736DD147C0EBC2E84B8772B79FF27A6BCC165878
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 736DD147C0EBC2E84B8772B79FF27A6BCC165878
36 | IDESourceControlWCCName
37 | IOSAnimationDemo
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/project.xcworkspace/xcuserdata/yixiang.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单.xcodeproj/project.xcworkspace/xcuserdata/yixiang.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/project.xcworkspace/xcuserdata/yixiang.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
6 |
7 | SnapshotAutomaticallyBeforeSignificantChanges
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/xcuserdata/yixiang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
24 |
36 |
37 |
38 |
40 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/xcuserdata/yixiang.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | 侧滑菜单.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | DA8894061B53E3FF00B47DE7
16 |
17 | primary
18 |
19 |
20 | DA88941F1B53E3FF00B47DE7
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单.xcodeproj/xcuserdata/yixiang.xcuserdatad/xcschemes/侧滑菜单.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "SWRevealViewController.h"
11 | #import "LeftViewController.h"
12 | #import "BaseAnimationController.h"
13 | #import "RightViewController.h"
14 |
15 | @interface AppDelegate ()
16 |
17 | @end
18 |
19 | @implementation AppDelegate
20 |
21 |
22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
23 |
24 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
25 |
26 | //左侧菜单栏
27 | LeftViewController *leftViewController = [[LeftViewController alloc] init];
28 |
29 | //首页
30 | BaseAnimationController *centerView1Controller = [[BaseAnimationController alloc] init];
31 |
32 | //右侧菜单栏
33 | RightViewController *rightViewController = [[RightViewController alloc] init];
34 |
35 | SWRevealViewController *revealViewController = [[SWRevealViewController alloc] initWithRearViewController:leftViewController frontViewController:centerView1Controller];
36 | revealViewController.rightViewController = rightViewController;
37 |
38 | //浮动层离左边距的宽度
39 | revealViewController.rearViewRevealWidth = 230;
40 | // revealViewController.rightViewRevealWidth = 230;
41 |
42 | //是否让浮动层弹回原位
43 | //mainRevealController.bounceBackOnOverdraw = NO;
44 | [revealViewController setFrontViewPosition:FrontViewPositionLeft animated:YES];
45 |
46 | self.window.rootViewController = revealViewController;
47 | self.window.backgroundColor = [UIColor whiteColor];
48 | [self.window makeKeyAndVisible];
49 | return YES;
50 | }
51 |
52 | - (void)applicationWillResignActive:(UIApplication *)application {
53 | // 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.
54 | // 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.
55 | }
56 |
57 | - (void)applicationDidEnterBackground:(UIApplication *)application {
58 | // 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.
59 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
60 | }
61 |
62 | - (void)applicationWillEnterForeground:(UIApplication *)application {
63 | // 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.
64 | }
65 |
66 | - (void)applicationDidBecomeActive:(UIApplication *)application {
67 | // 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.
68 | }
69 |
70 | - (void)applicationWillTerminate:(UIApplication *)application {
71 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
72 | }
73 |
74 | @end
75 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/AffineTransformController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AffineTransformController.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/9/21.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface AffineTransformController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/AffineTransformController.m:
--------------------------------------------------------------------------------
1 | //
2 | // AffineTransformController.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/9/21.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "AffineTransformController.h"
10 |
11 | @interface AffineTransformController ()
12 |
13 | @property (nonatomic , strong) UIView *demoView;
14 |
15 | @end
16 |
17 | @implementation AffineTransformController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 |
22 | [self.view addSubview:self.demoView];
23 | }
24 |
25 |
26 | //UI开发技巧,重写setter方法和Code Block Evaluation C Extension语法
27 | - (UIView *)demoView{
28 | if (!_demoView) {
29 | _demoView = ({
30 | UIView *demoView = [[UIView alloc] initWithFrame:({
31 | CGRect rect = CGRectMake(SCREEN_WIDTH/2-50, SCREEN_HEIGHT/2-100,100 ,100 );
32 | rect;
33 | })];
34 | demoView.backgroundColor = [UIColor redColor];
35 | demoView;
36 | });
37 | }
38 | return _demoView;
39 | }
40 |
41 | -(NSArray *)operateTitleArray{
42 | return [NSArray arrayWithObjects:@"位移",@"缩放",@"旋转",@"组合",@"反转",nil];
43 | }
44 |
45 | -(void)clickBtn : (UIButton *)btn{
46 | switch (btn.tag) {
47 | case 0:
48 | [self positionAnimation];
49 | break;
50 | case 1:
51 | [self scaleAnimation];
52 | break;
53 | case 2:
54 | [self rotateAnimation];
55 | break;
56 | case 3:
57 | [self combinationAnimation];
58 | break;
59 | case 4:
60 | [self invertAnimation];
61 | break;
62 | default:
63 | break;
64 | }
65 | }
66 |
67 | -(void)positionAnimation{
68 | _demoView.transform = CGAffineTransformIdentity;
69 | [UIView animateWithDuration:1.0f animations:^{
70 | _demoView.transform = CGAffineTransformMakeTranslation(100, 100);
71 | }];
72 | }
73 |
74 | -(void)scaleAnimation{
75 | _demoView.transform = CGAffineTransformIdentity;
76 | [UIView animateWithDuration:1.0f animations:^{
77 | _demoView.transform = CGAffineTransformMakeScale(2, 2);
78 | }];
79 | }
80 |
81 | -(void)rotateAnimation{
82 | _demoView.transform = CGAffineTransformIdentity;
83 | [UIView animateWithDuration:1.0f animations:^{
84 | _demoView.transform = CGAffineTransformMakeRotation(M_PI);
85 | }];
86 | }
87 |
88 | -(void)combinationAnimation{
89 | //仿射变换的组合使用
90 | _demoView.transform = CGAffineTransformIdentity;
91 | [UIView animateWithDuration:1.0f animations:^{
92 | CGAffineTransform transform1 = CGAffineTransformMakeRotation(M_PI);
93 | CGAffineTransform transform2 = CGAffineTransformScale(transform1, 0.5, 0.5);
94 | _demoView.transform = CGAffineTransformTranslate(transform2, 100, 100);
95 | }];
96 | }
97 |
98 | -(void)invertAnimation{
99 | _demoView.transform = CGAffineTransformIdentity;
100 | [UIView animateWithDuration:1.0f animations:^{
101 | //矩阵反转
102 | _demoView.transform = CGAffineTransformInvert(CGAffineTransformMakeScale(2, 2));
103 | }];
104 | }
105 |
106 | -(NSString *)controllerTitle{
107 | return @"仿射变换";
108 | }
109 |
110 | @end
111 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/BaseAnimationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView1Controller.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "BaseViewController.h"
11 |
12 | @interface BaseAnimationController : BaseViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/BaseAnimationController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView1Controller.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "BaseAnimationController.h"
10 | #import "SWRevealViewController.h"
11 | #import "AppDelegate.h"
12 |
13 | @interface BaseAnimationController()
14 |
15 | @property (nonatomic , strong) UIView *demoView;
16 |
17 | @end
18 |
19 | @implementation BaseAnimationController
20 |
21 | -(void)initView{
22 | [super initView];
23 |
24 |
25 | _demoView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-50, SCREEN_HEIGHT/2-100,100 ,100 )];
26 | _demoView.backgroundColor = [UIColor redColor];
27 | [self.view addSubview:_demoView];
28 |
29 | }
30 |
31 |
32 | -(NSArray *)operateTitleArray{
33 | return [NSArray arrayWithObjects:@"位移",@"透明度",@"缩放",@"旋转",@"背景色", nil];
34 | }
35 |
36 | -(void)clickBtn : (UIButton *)btn{
37 | switch (btn.tag) {
38 | case 0:
39 | [self positionAnimation];
40 | break;
41 | case 1:
42 | [self opacityAniamtion];
43 | break;
44 | case 2:
45 | [self scaleAnimation];
46 | break;
47 | case 3:
48 | [self rotateAnimation];
49 | break;
50 | case 4:
51 | [self backgroundAnimation];
52 | break;
53 |
54 | default:
55 | break;
56 | }
57 | }
58 |
59 | -(NSString *)controllerTitle{
60 | return @"基础动画";
61 | }
62 |
63 | /**
64 | * 位移动画演示
65 | */
66 | -(void)positionAnimation{
67 | //使用CABasicAnimation创建基础动画
68 | CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"position"];
69 | anima.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-75)];
70 | anima.toValue = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-75)];
71 | anima.duration = 1.0f;
72 | //如果fillMode=kCAFillModeForwards和removedOnComletion=NO,那么在动画执行完毕后,图层会保持显示动画执行后的状态。但在实质上,图层的属性值还是动画执行前的初始值,并没有真正被改变。
73 | //anima.fillMode = kCAFillModeForwards;
74 | //anima.removedOnCompletion = NO;
75 | anima.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
76 | [_demoView.layer addAnimation:anima forKey:@"positionAnimation"];
77 |
78 |
79 | //使用UIView Animation 代码块调用
80 | // _demoView.frame = CGRectMake(0, SCREEN_HEIGHT/2-50, 50, 50);
81 | // [UIView animateWithDuration:1.0f animations:^{
82 | // _demoView.frame = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50, 50, 50);
83 | // } completion:^(BOOL finished) {
84 | // _demoView.frame = CGRectMake(SCREEN_WIDTH/2-25, SCREEN_HEIGHT/2-50, 50, 50);
85 | // }];
86 | //
87 | //使用UIView [begin,commit]模式
88 | // _demoView.frame = CGRectMake(0, SCREEN_HEIGHT/2-50, 50, 50);
89 | // [UIView beginAnimations:nil context:nil];
90 | // [UIView setAnimationDuration:1.0f];
91 | // _demoView.frame = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50, 50, 50);
92 | // [UIView commitAnimations];
93 | }
94 |
95 | /**
96 | * 透明度动画
97 | */
98 | -(void)opacityAniamtion{
99 | CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"opacity"];
100 | anima.fromValue = [NSNumber numberWithFloat:1.0f];
101 | anima.toValue = [NSNumber numberWithFloat:0.2f];
102 | anima.duration = 1.0f;
103 | [_demoView.layer addAnimation:anima forKey:@"opacityAniamtion"];
104 | }
105 |
106 | /**
107 | * 缩放动画
108 | */
109 | -(void)scaleAnimation{
110 | // CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"bounds"];
111 | // anima.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, 200, 200)];
112 | // anima.duration = 1.0f;
113 | // [_demoView.layer addAnimation:anima forKey:@"scaleAnimation"];
114 |
115 | CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"transform.scale"];//同上
116 | anima.toValue = [NSNumber numberWithFloat:2.0f];
117 | anima.duration = 1.0f;
118 | [_demoView.layer addAnimation:anima forKey:@"scaleAnimation"];
119 |
120 | // CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"];
121 | // anima.toValue = [NSNumber numberWithFloat:0.2f];
122 | // anima.duration = 1.0f;
123 | // [_demoView.layer addAnimation:anima forKey:@"scaleAnimation"];
124 | }
125 |
126 | /**
127 | * 旋转动画
128 | */
129 | -(void)rotateAnimation{
130 | CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];//绕着z轴为矢量,进行旋转(@"transform.rotation.z"==@@"transform.rotation")
131 | anima.toValue = [NSNumber numberWithFloat:M_PI];
132 | anima.duration = 1.0f;
133 | [_demoView.layer addAnimation:anima forKey:@"rotateAnimation"];
134 |
135 | // //valueWithCATransform3D作用与layer
136 | // CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"transform"];
137 | // anima.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 0, 0, 1)];//绕着矢量(x,y,z)旋转
138 | // anima.duration = 1.0f;
139 | // //anima.repeatCount = MAXFLOAT;
140 | // [_demoView.layer addAnimation:anima forKey:@"rotateAnimation"];
141 |
142 | // //CGAffineTransform作用与View
143 | // _demoView.transform = CGAffineTransformMakeRotation(0);
144 | // [UIView animateWithDuration:1.0f animations:^{
145 | // _demoView.transform = CGAffineTransformMakeRotation(M_PI);
146 | // } completion:^(BOOL finished) {
147 | //
148 | // }];
149 | }
150 |
151 | /**
152 | * 背景色变化动画
153 | */
154 | -(void)backgroundAnimation{
155 | CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"backgroundColor"];
156 | anima.toValue =(id) [UIColor greenColor].CGColor;
157 | anima.duration = 1.0f;
158 | [_demoView.layer addAnimation:anima forKey:@"backgroundAnimation"];
159 | }
160 |
161 |
162 | @end
163 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/BaseViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/18.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "TitleButton.h"
11 |
12 | @interface BaseViewController : ViewController
13 |
14 | /**
15 | * 当前Controller的标题
16 | *
17 | * @return 标题
18 | */
19 | -(NSString *)controllerTitle;
20 |
21 | /**
22 | * 初始化View
23 | */
24 | -(void)initView;
25 |
26 | /**
27 | * 按钮操作区的数组元素
28 | *
29 | * @return 数组
30 | */
31 | -(NSArray *)operateTitleArray;
32 |
33 | /**
34 | * 每个按钮的点击时间
35 | *
36 | * @param btn
37 | */
38 | -(void)clickBtn : (UIButton *)btn;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/BaseViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/18.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 | #import "SWRevealViewController.h"
11 |
12 | @interface BaseViewController ()
13 |
14 | @property (nonatomic , strong) NSArray *operateTitleArray;
15 |
16 | @end
17 |
18 | @implementation BaseViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | [self initData];
23 | [self initView];
24 | }
25 |
26 | -(void)initData{
27 | _operateTitleArray = [self operateTitleArray];
28 | }
29 |
30 | -(void)initView{
31 |
32 | UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH ,60)];
33 | containerView.backgroundColor = [UIColor cyanColor];
34 | [self.view addSubview:containerView];
35 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, 40)];
36 | label.textAlignment = NSTextAlignmentCenter;
37 | label.text = [self controllerTitle];
38 | [containerView addSubview:label];
39 |
40 | self.view.backgroundColor = [UIColor whiteColor];
41 | if(_operateTitleArray&&_operateTitleArray.count>0){
42 | NSUInteger row = _operateTitleArray.count%4==0 ? _operateTitleArray.count/4 : _operateTitleArray.count/4+1;
43 | UIView *operateView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT-(row*50+20), SCREEN_WIDTH, row*50+20)];
44 | [self.view addSubview:operateView];
45 | for (int i=0; i<_operateTitleArray.count; i++) {
46 | TitleButton *btn = [[TitleButton alloc] initWithFrame:[self rectForBtnAtIndex:i totalNum:_operateTitleArray.count] withTitle:[_operateTitleArray objectAtIndex:i]];
47 | btn.tag = i;
48 | [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside];
49 | [operateView addSubview:btn];
50 | }
51 | }
52 | //注册该页面可以执行滑动切换
53 | SWRevealViewController *revealController = self.revealViewController;
54 | [self.view addGestureRecognizer:revealController.panGestureRecognizer];
55 | }
56 |
57 | -(NSString *)controllerTitle{
58 | return @"默认标题";
59 | }
60 |
61 | /**
62 | * 获得每个操作按钮的frame
63 | *
64 | * @param index 当前按钮的位置,从0开始
65 | * @param totleNum 所有按钮的总数
66 | *
67 | * @return 按钮的frame
68 | */
69 | -(CGRect)rectForBtnAtIndex : (NSUInteger)index totalNum : (NSUInteger)totleNum{
70 | //每一行最多显示4个
71 | NSUInteger maxColumnNum = 4;
72 | //每个按钮的列间距
73 | CGFloat columnMargin = 20;
74 | //每个按钮的行间距
75 | CGFloat rowMargin = 20;
76 | //行数
77 | // NSUInteger row = totleNum/maxColumnNum;
78 | //每个按钮的宽度
79 | CGFloat width = (SCREEN_WIDTH - columnMargin*5)/4;
80 | //每个按钮的高度
81 | CGFloat height = 30;
82 |
83 | //每个按钮的偏移
84 | CGFloat offsetX = columnMargin+(index%maxColumnNum)*(width+columnMargin);
85 | CGFloat offsetY = rowMargin+(index/maxColumnNum)*(height+rowMargin);
86 |
87 | return CGRectMake(offsetX, offsetY, width, height);
88 | }
89 |
90 | -(void)clickBtn : (UIButton *)btn{
91 |
92 | }
93 |
94 | @end
95 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/ComprehensiveCaseController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView5Controller.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/19.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface ComprehensiveCaseController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/ComprehensiveCaseController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView5Controller.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/19.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "ComprehensiveCaseController.h"
10 | #import "DCPathButton.h"
11 | #import "DWBubbleMenuButton.h"
12 | #import "MCFireworksButton.h"
13 |
14 | @interface ComprehensiveCaseController ()
15 |
16 | @property (nonatomic , strong) DCPathButton *pathAnimationView;
17 |
18 | @property (nonatomic , strong) DWBubbleMenuButton *dingdingAnimationMenu;
19 |
20 | @property (nonatomic , strong) MCFireworksButton *goodBtn;
21 |
22 | @property (nonatomic , assign) BOOL selected;
23 | @end
24 |
25 | @implementation ComprehensiveCaseController
26 |
27 | -(void)initView{
28 | [super initView];
29 | [self pathAnimation];
30 | }
31 |
32 |
33 | -(NSArray *)operateTitleArray{
34 | return [NSArray arrayWithObjects:@"Path",@"钉钉",@"点赞", nil];
35 | }
36 |
37 | -(void)clickBtn : (UIButton *)btn{
38 | switch (btn.tag) {
39 | case 0:
40 | [self pathAnimation];
41 | break;
42 | case 1:
43 | [self dingdingAnimation];
44 | break;
45 | case 2:
46 | [self clickGoodAnimation];
47 | break;
48 | default:
49 | break;
50 | }
51 | }
52 |
53 | /**
54 | * 仿Path 菜单动画
55 | */
56 | -(void)pathAnimation{
57 | if (_dingdingAnimationMenu) {
58 | _dingdingAnimationMenu.hidden = YES;
59 | }
60 | if (_goodBtn) {
61 | _goodBtn.hidden = YES;
62 | }
63 | if (!_pathAnimationView) {
64 | [self ConfigureDCPathButton];
65 | }else{
66 | _pathAnimationView.hidden = NO;
67 | }
68 | }
69 |
70 | - (void)ConfigureDCPathButton
71 | {
72 | // Configure center button
73 | //
74 | DCPathButton *dcPathButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"]
75 | hilightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]];
76 | _pathAnimationView = dcPathButton;
77 |
78 | dcPathButton.delegate = self;
79 |
80 | // Configure item buttons
81 | //
82 | DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-music"]
83 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-music-highlighted"]
84 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
85 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
86 |
87 | DCPathItemButton *itemButton_2 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-place"]
88 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-place-highlighted"]
89 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
90 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
91 |
92 | DCPathItemButton *itemButton_3 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-camera"]
93 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-camera-highlighted"]
94 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
95 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
96 |
97 | DCPathItemButton *itemButton_4 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-thought"]
98 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-thought-highlighted"]
99 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
100 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
101 |
102 | DCPathItemButton *itemButton_5 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-sleep"]
103 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-sleep-highlighted"]
104 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
105 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
106 |
107 | // Add the item button into the center button
108 | //
109 | [dcPathButton addPathItems:@[itemButton_1, itemButton_2, itemButton_3, itemButton_4, itemButton_5]];
110 |
111 | [self.view addSubview:dcPathButton];
112 |
113 | }
114 |
115 | #pragma mark - DCPathButton Delegate
116 |
117 | - (void)itemButtonTappedAtIndex:(NSUInteger)index
118 | {
119 | NSLog(@"You tap at index : %ld", index);
120 | }
121 |
122 | //--------------------------------------------萌萌的分割线---------------------------------------------------
123 | /**
124 | * 仿造钉钉菜单动画
125 | */
126 | -(void)dingdingAnimation{
127 | if (_pathAnimationView) {
128 | _pathAnimationView.hidden = YES;
129 | }
130 | if (_goodBtn) {
131 | _goodBtn.hidden = YES;
132 | }
133 | if (!_dingdingAnimationMenu) {
134 | UILabel *homeLabel = [self createHomeButtonView];
135 |
136 | DWBubbleMenuButton *upMenuView = [[DWBubbleMenuButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - homeLabel.frame.size.width - 20.f,
137 | self.view.frame.size.height - homeLabel.frame.size.height - 20.f,
138 | homeLabel.frame.size.width,
139 | homeLabel.frame.size.height)
140 | expansionDirection:DirectionUp];
141 | upMenuView.homeButtonView = homeLabel;
142 | [upMenuView addButtons:[self createDemoButtonArray]];
143 |
144 | _dingdingAnimationMenu = upMenuView;
145 |
146 | [self.view addSubview:upMenuView];
147 | }else{
148 | _dingdingAnimationMenu.hidden = NO;
149 | }
150 | }
151 |
152 | - (UILabel *)createHomeButtonView {
153 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0.f, 0.f, 40.f, 40.f)];
154 |
155 | label.text = @"Tap";
156 | label.textColor = [UIColor whiteColor];
157 | label.textAlignment = NSTextAlignmentCenter;
158 | label.layer.cornerRadius = label.frame.size.height / 2.f;
159 | label.backgroundColor =[UIColor colorWithRed:0.f green:0.f blue:0.f alpha:0.5f];
160 | label.clipsToBounds = YES;
161 |
162 | return label;
163 | }
164 |
165 | - (NSArray *)createDemoButtonArray {
166 | NSMutableArray *buttonsMutable = [[NSMutableArray alloc] init];
167 |
168 | int i = 0;
169 | for (NSString *title in @[@"A", @"B", @"C", @"D", @"E", @"F"]) {
170 | UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
171 |
172 | [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
173 | [button setTitle:title forState:UIControlStateNormal];
174 |
175 | button.frame = CGRectMake(0.f, 0.f, 30.f, 30.f);
176 | button.layer.cornerRadius = button.frame.size.height / 2.f;
177 | button.backgroundColor = [UIColor colorWithRed:0.f green:0.f blue:0.f alpha:0.5f];
178 | button.clipsToBounds = YES;
179 | button.tag = i++;
180 |
181 | [button addTarget:self action:@selector(dwBtnClick:) forControlEvents:UIControlEventTouchUpInside];
182 |
183 | [buttonsMutable addObject:button];
184 | }
185 |
186 | return [buttonsMutable copy];
187 | }
188 |
189 | - (void)dwBtnClick:(UIButton *)sender {
190 | NSLog(@"DWButton tapped, tag: %ld", (long)sender.tag);
191 | }
192 |
193 |
194 | //--------------------------------------------萌萌的分割线---------------------------------------------------
195 |
196 | /**
197 | * 仿造facebook,点赞动画
198 | */
199 | -(void)clickGoodAnimation{
200 | if (_pathAnimationView) {
201 | _pathAnimationView.hidden = YES;
202 | }
203 | if (_dingdingAnimationMenu) {
204 | _dingdingAnimationMenu.hidden = YES;
205 | }
206 | if (!_goodBtn) {
207 | _goodBtn = [[MCFireworksButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-25, SCREEN_HEIGHT/2-25, 50, 50)];
208 | _goodBtn.particleImage = [UIImage imageNamed:@"Sparkle"];
209 | _goodBtn.particleScale = 0.05;
210 | _goodBtn.particleScaleRange = 0.02;
211 | [_goodBtn setImage:[UIImage imageNamed:@"Like"] forState:UIControlStateNormal];
212 |
213 | [_goodBtn addTarget:self action:@selector(handleButtonPress:) forControlEvents:UIControlEventTouchUpInside];
214 | [self.view addSubview:_goodBtn];
215 | }else{
216 | _goodBtn.hidden = NO;
217 | }
218 | }
219 |
220 | - (void)handleButtonPress:(id)sender {
221 | _selected = !_selected;
222 | if(_selected) {
223 | [_goodBtn popOutsideWithDuration:0.5];
224 | [_goodBtn setImage:[UIImage imageNamed:@"Like-Blue"] forState:UIControlStateNormal];
225 | [_goodBtn animate];
226 | }else {
227 | [_goodBtn popInsideWithDuration:0.4];
228 | [_goodBtn setImage:[UIImage imageNamed:@"Like"] forState:UIControlStateNormal];
229 | }
230 | }
231 |
232 | //--------------------------------------------萌萌的分割线---------------------------------------------------
233 | -(NSString *)controllerTitle{
234 | return @"综合案例";
235 | }
236 |
237 |
238 | @end
239 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/GroupAnimationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView3Controller.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/18.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface GroupAnimationController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/GroupAnimationController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView3Controller.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/18.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "GroupAnimationController.h"
10 |
11 | @interface GroupAnimationController ()
12 |
13 | @property (nonatomic , strong) UIView *demoView;
14 |
15 | @end
16 |
17 | @implementation GroupAnimationController
18 |
19 | -(void)initView{
20 | [super initView];
21 |
22 | _demoView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-25, SCREEN_HEIGHT/2-50,50,50)];
23 | _demoView.backgroundColor = [UIColor redColor];
24 | [self.view addSubview:_demoView];
25 |
26 | }
27 |
28 | -(NSArray *)operateTitleArray{
29 | return [NSArray arrayWithObjects:@"同时",@"连续", nil];
30 | }
31 |
32 | -(void)clickBtn : (UIButton *)btn{
33 | switch (btn.tag) {
34 | case 0:
35 | [self groupAnimation1];
36 | break;
37 | case 1:
38 | [self groupAnimation2];
39 | break;
40 | default:
41 | break;
42 | }
43 | }
44 |
45 | -(void)groupAnimation1{
46 | // //位移动画
47 | CAKeyframeAnimation *anima1 = [CAKeyframeAnimation animationWithKeyPath:@"position"];
48 | NSValue *value0 = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-50)];
49 | NSValue *value1 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2-50)];
50 | NSValue *value2 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2+50)];
51 | NSValue *value3 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2+50)];
52 | NSValue *value4 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2-50)];
53 | NSValue *value5 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50)];
54 | anima1.values = [NSArray arrayWithObjects:value0,value1,value2,value3,value4,value5, nil];
55 |
56 | //缩放动画
57 | CABasicAnimation *anima2 = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
58 | anima2.fromValue = [NSNumber numberWithFloat:0.8f];
59 | anima2.toValue = [NSNumber numberWithFloat:2.0f];
60 |
61 | //旋转动画
62 | CABasicAnimation *anima3 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
63 | anima3.toValue = [NSNumber numberWithFloat:M_PI*4];
64 |
65 | //组动画
66 | CAAnimationGroup *groupAnimation = [CAAnimationGroup animation];
67 | groupAnimation.animations = [NSArray arrayWithObjects:anima1,anima2,anima3, nil];
68 | groupAnimation.duration = 4.0f;
69 |
70 | [_demoView.layer addAnimation:groupAnimation forKey:@"groupAnimation"];
71 |
72 | //-------------如下,使用三个animation不分装成group,只是把他们添加到layer,也有组动画的效果。-------------
73 | // //位移动画
74 | // CAKeyframeAnimation *anima1 = [CAKeyframeAnimation animationWithKeyPath:@"position"];
75 | // NSValue *value0 = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-50)];
76 | // NSValue *value1 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2-50)];
77 | // NSValue *value2 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2+50)];
78 | // NSValue *value3 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2+50)];
79 | // NSValue *value4 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2-50)];
80 | // NSValue *value5 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50)];
81 | // anima1.values = [NSArray arrayWithObjects:value0,value1,value2,value3,value4,value5, nil];
82 | // anima1.duration = 4.0f;
83 | // [_demoView.layer addAnimation:anima1 forKey:@"aa"];
84 | //
85 | // //缩放动画
86 | // CABasicAnimation *anima2 = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
87 | // anima2.fromValue = [NSNumber numberWithFloat:0.8f];
88 | // anima2.toValue = [NSNumber numberWithFloat:2.0f];
89 | // anima2.duration = 4.0f;
90 | // [_demoView.layer addAnimation:anima2 forKey:@"bb"];
91 | //
92 | // //旋转动画
93 | // CABasicAnimation *anima3 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
94 | // anima3.toValue = [NSNumber numberWithFloat:M_PI*4];
95 | // anima3.duration = 4.0f;
96 | // [_demoView.layer addAnimation:anima3 forKey:@"cc"];
97 | }
98 |
99 | /**
100 | * 顺序执行的组动画
101 | */
102 | -(void)groupAnimation2{
103 | CFTimeInterval currentTime = CACurrentMediaTime();
104 | //位移动画
105 | CABasicAnimation *anima1 = [CABasicAnimation animationWithKeyPath:@"position"];
106 | anima1.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-75)];
107 | anima1.toValue = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/2, SCREEN_HEIGHT/2-75)];
108 | anima1.beginTime = currentTime;
109 | anima1.duration = 1.0f;
110 | anima1.fillMode = kCAFillModeForwards;
111 | anima1.removedOnCompletion = NO;
112 | [_demoView.layer addAnimation:anima1 forKey:@"aa"];
113 |
114 | //缩放动画
115 | CABasicAnimation *anima2 = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
116 | anima2.fromValue = [NSNumber numberWithFloat:0.8f];
117 | anima2.toValue = [NSNumber numberWithFloat:2.0f];
118 | anima2.beginTime = currentTime+1.0f;
119 | anima2.duration = 1.0f;
120 | anima2.fillMode = kCAFillModeForwards;
121 | anima2.removedOnCompletion = NO;
122 | [_demoView.layer addAnimation:anima2 forKey:@"bb"];
123 |
124 | //旋转动画
125 | CABasicAnimation *anima3 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
126 | anima3.toValue = [NSNumber numberWithFloat:M_PI*4];
127 | anima3.beginTime = currentTime+2.0f;
128 | anima3.duration = 1.0f;
129 | anima3.fillMode = kCAFillModeForwards;
130 | anima3.removedOnCompletion = NO;
131 | [_demoView.layer addAnimation:anima3 forKey:@"cc"];
132 | }
133 |
134 | -(NSString *)controllerTitle{
135 | return @"组动画";
136 | }
137 |
138 |
139 | @end
140 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/KeyFrameAnimationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView2Controller.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/14.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "BaseViewController.h"
11 |
12 | @interface KeyFrameAnimationController : BaseViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/KeyFrameAnimationController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView2Controller.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/14.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "KeyFrameAnimationController.h"
10 | #import "SWRevealViewController.h"
11 |
12 |
13 | @interface KeyFrameAnimationController ()
14 |
15 | @property (nonatomic , strong) UIView *demoView;
16 |
17 | @end
18 |
19 | @implementation KeyFrameAnimationController
20 |
21 | -(void)initView{
22 | [super initView];
23 |
24 | _demoView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-25, SCREEN_HEIGHT/2-50,50,50)];
25 | _demoView.backgroundColor = [UIColor redColor];
26 | [self.view addSubview:_demoView];
27 | }
28 |
29 | -(NSArray *)operateTitleArray{
30 | return [NSArray arrayWithObjects:@"关键帧",@"路径",@"抖动", nil];
31 | }
32 |
33 | -(NSString *)controllerTitle{
34 | return @"关键帧动画";
35 | }
36 |
37 | -(void)clickBtn : (UIButton *)btn{
38 | switch (btn.tag) {
39 | case 0:
40 | [self keyFrameAnimation];
41 | break;
42 | case 1:
43 | [self pathAnimation];
44 | break;
45 | case 2:
46 | [self shakeAnimation];
47 | break;
48 | default:
49 | break;
50 | }
51 | }
52 |
53 | /**
54 | * 关键帧动画
55 | */
56 | -(void)keyFrameAnimation{
57 | CAKeyframeAnimation *anima = [CAKeyframeAnimation animationWithKeyPath:@"position"];
58 | NSValue *value0 = [NSValue valueWithCGPoint:CGPointMake(0, SCREEN_HEIGHT/2-50)];
59 | NSValue *value1 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2-50)];
60 | NSValue *value2 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH/3, SCREEN_HEIGHT/2+50)];
61 | NSValue *value3 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2+50)];
62 | NSValue *value4 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH*2/3, SCREEN_HEIGHT/2-50)];
63 | NSValue *value5 = [NSValue valueWithCGPoint:CGPointMake(SCREEN_WIDTH, SCREEN_HEIGHT/2-50)];
64 | anima.values = [NSArray arrayWithObjects:value0,value1,value2,value3,value4,value5, nil];
65 | anima.duration = 2.0f;
66 | anima.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];//设置动画的节奏
67 | anima.delegate = self;//设置代理,可以检测动画的开始和结束
68 | [_demoView.layer addAnimation:anima forKey:@"keyFrameAnimation"];
69 |
70 | }
71 |
72 | -(void)animationDidStart:(CAAnimation *)anim{
73 | NSLog(@"开始动画");
74 | }
75 |
76 | -(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
77 | NSLog(@"结束动画");
78 | }
79 |
80 | /**
81 | * path动画
82 | */
83 | -(void)pathAnimation{
84 | CAKeyframeAnimation *anima = [CAKeyframeAnimation animationWithKeyPath:@"position"];
85 | UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(SCREEN_WIDTH/2-100, SCREEN_HEIGHT/2-100, 200, 200)];
86 | anima.path = path.CGPath;
87 | anima.duration = 2.0f;
88 | [_demoView.layer addAnimation:anima forKey:@"pathAnimation"];
89 | }
90 |
91 | /**
92 | * 抖动效果
93 | */
94 | -(void)shakeAnimation{
95 | CAKeyframeAnimation *anima = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation"];//在这里@"transform.rotation"==@"transform.rotation.z"
96 | NSValue *value1 = [NSNumber numberWithFloat:-M_PI/180*4];
97 | NSValue *value2 = [NSNumber numberWithFloat:M_PI/180*4];
98 | NSValue *value3 = [NSNumber numberWithFloat:-M_PI/180*4];
99 | anima.values = @[value1,value2,value3];
100 | anima.repeatCount = MAXFLOAT;
101 |
102 | [_demoView.layer addAnimation:anima forKey:@"shakeAnimation"];
103 |
104 |
105 | }
106 |
107 | @end
108 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/TransitionAnimationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView4Controller.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/18.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface TransitionAnimationController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/Controller/TransitionAnimationController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CenterView4Controller.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/18.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "TransitionAnimationController.h"
10 |
11 | @interface TransitionAnimationController ()
12 |
13 | @property (nonatomic , strong) UIView *demoView;
14 |
15 | @property (nonatomic , strong) UILabel *demoLabel;
16 |
17 | @property (nonatomic , assign) NSInteger index;
18 |
19 | @end
20 |
21 | @implementation TransitionAnimationController
22 |
23 | -(void)initView{
24 | [super initView];
25 | _index = 0;
26 |
27 | _demoView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-90, SCREEN_HEIGHT/2-200,180,260)];
28 | [self.view addSubview:_demoView];
29 |
30 | _demoLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(_demoView.frame)/2-10, CGRectGetHeight(_demoView.frame)/2-20, 20, 40)];
31 | _demoLabel.textAlignment = NSTextAlignmentCenter;
32 | _demoLabel.font = [UIFont systemFontOfSize:40];
33 | [_demoView addSubview:_demoLabel];
34 |
35 | [self changeView:YES];
36 |
37 |
38 | }
39 |
40 | -(NSArray *)operateTitleArray{
41 | return [NSArray arrayWithObjects:@"fade",@"moveIn",@"push",@"reveal",@"cube",@"suck",@"oglFlip",@"ripple",@"Curl",@"UnCurl",@"caOpen",@"caClose", nil];
42 | }
43 |
44 | -(void)clickBtn : (UIButton *)btn{
45 | switch (btn.tag) {
46 | case 0:
47 | [self fadeAnimation];
48 | break;
49 | case 1:
50 | [self moveInAnimation];
51 | break;
52 | case 2:
53 | [self pushAnimation];
54 | break;
55 | case 3:
56 | [self revealAnimation];
57 | break;
58 | case 4:
59 | [self cubeAnimation];
60 | break;
61 | case 5:
62 | [self suckEffectAnimation];
63 | break;
64 | case 6:
65 | [self oglFlipAnimation];
66 | break;
67 | case 7:
68 | [self rippleEffectAnimation];
69 | break;
70 | case 8:
71 | [self pageCurlAnimation];
72 | break;
73 | case 9:
74 | [self pageUnCurlAnimation];
75 | break;
76 | case 10:
77 | [self cameraIrisHollowOpenAnimation];
78 | break;
79 | case 11:
80 | [self cameraIrisHollowCloseAnimation];
81 | break;
82 | default:
83 | break;
84 | }
85 | }
86 |
87 |
88 | //-----------------------------public api------------------------------------
89 | /*
90 | type:
91 | kCATransitionFade;
92 | kCATransitionMoveIn;
93 | kCATransitionPush;
94 | kCATransitionReveal;
95 | */
96 | /*
97 | subType:
98 | kCATransitionFromRight;
99 | kCATransitionFromLeft;
100 | kCATransitionFromTop;
101 | kCATransitionFromBottom;
102 | */
103 |
104 | /**
105 | * 逐渐消失
106 | */
107 | -(void)fadeAnimation{
108 | [self changeView:YES];
109 | CATransition *anima = [CATransition animation];
110 | anima.type = kCATransitionFade;//设置动画的类型
111 | anima.subtype = kCATransitionFromRight; //设置动画的方向
112 | //anima.startProgress = 0.3;//设置动画起点
113 | //anima.endProgress = 0.8;//设置动画终点
114 | anima.duration = 1.0f;
115 |
116 | [_demoView.layer addAnimation:anima forKey:@"fadeAnimation"];
117 | }
118 |
119 | -(void)moveInAnimation{
120 | [self changeView:YES];
121 | CATransition *anima = [CATransition animation];
122 | anima.type = kCATransitionMoveIn;//设置动画的类型
123 | anima.subtype = kCATransitionFromRight; //设置动画的方向
124 | anima.duration = 1.0f;
125 |
126 | [_demoView.layer addAnimation:anima forKey:@"moveInAnimation"];
127 | }
128 |
129 | -(void)pushAnimation{
130 | [self changeView:YES];
131 | CATransition *anima = [CATransition animation];
132 | anima.type = kCATransitionPush;//设置动画的类型
133 | anima.subtype = kCATransitionFromRight; //设置动画的方向
134 | anima.duration = 1.0f;
135 |
136 | [_demoView.layer addAnimation:anima forKey:@"pushAnimation"];
137 | }
138 |
139 | -(void)revealAnimation{
140 | [self changeView:YES];
141 | CATransition *anima = [CATransition animation];
142 | anima.type = kCATransitionReveal;//设置动画的类型
143 | anima.subtype = kCATransitionFromRight; //设置动画的方向
144 | anima.duration = 1.0f;
145 |
146 | [_demoView.layer addAnimation:anima forKey:@"revealAnimation"];
147 | }
148 |
149 | //-----------------------------private api------------------------------------
150 | /*
151 | Don't be surprised if Apple rejects your app for including those effects,
152 | and especially don't be surprised if your app starts behaving strangely after an OS update.
153 | */
154 |
155 |
156 | /**
157 | * 立体翻滚效果
158 | */
159 | -(void)cubeAnimation{
160 | [self changeView:YES];
161 | CATransition *anima = [CATransition animation];
162 | anima.type = @"cube";//设置动画的类型
163 | anima.subtype = kCATransitionFromRight; //设置动画的方向
164 | anima.duration = 1.0f;
165 |
166 | [_demoView.layer addAnimation:anima forKey:@"revealAnimation"];
167 | }
168 |
169 |
170 | -(void)suckEffectAnimation{
171 | [self changeView:YES];
172 | CATransition *anima = [CATransition animation];
173 | anima.type = @"suckEffect";//设置动画的类型
174 | anima.subtype = kCATransitionFromRight; //设置动画的方向
175 | anima.duration = 1.0f;
176 |
177 | [_demoView.layer addAnimation:anima forKey:@"suckEffectAnimation"];
178 | }
179 |
180 | -(void)oglFlipAnimation{
181 | [self changeView:YES];
182 | CATransition *anima = [CATransition animation];
183 | anima.type = @"oglFlip";//设置动画的类型
184 | anima.subtype = kCATransitionFromRight; //设置动画的方向
185 | anima.duration = 1.0f;
186 |
187 | [_demoView.layer addAnimation:anima forKey:@"oglFlipAnimation"];
188 | }
189 |
190 | -(void)rippleEffectAnimation{
191 | [self changeView:YES];
192 | CATransition *anima = [CATransition animation];
193 | anima.type = @"rippleEffect";//设置动画的类型
194 | anima.subtype = kCATransitionFromRight; //设置动画的方向
195 | anima.duration = 1.0f;
196 |
197 | [_demoView.layer addAnimation:anima forKey:@"rippleEffectAnimation"];
198 | }
199 |
200 | -(void)pageCurlAnimation{
201 | [self changeView:YES];
202 | CATransition *anima = [CATransition animation];
203 | anima.type = @"pageCurl";//设置动画的类型
204 | anima.subtype = kCATransitionFromRight; //设置动画的方向
205 | anima.duration = 1.0f;
206 |
207 | [_demoView.layer addAnimation:anima forKey:@"pageCurlAnimation"];
208 | }
209 |
210 | -(void)pageUnCurlAnimation{
211 | [self changeView:YES];
212 | CATransition *anima = [CATransition animation];
213 | anima.type = @"pageUnCurl";//设置动画的类型
214 | anima.subtype = kCATransitionFromRight; //设置动画的方向
215 | anima.duration = 1.0f;
216 |
217 | [_demoView.layer addAnimation:anima forKey:@"pageUnCurlAnimation"];
218 | }
219 |
220 | -(void)cameraIrisHollowOpenAnimation{
221 | [self changeView:YES];
222 | CATransition *anima = [CATransition animation];
223 | anima.type = @"cameraIrisHollowOpen";//设置动画的类型
224 | anima.subtype = kCATransitionFromRight; //设置动画的方向
225 | anima.duration = 1.0f;
226 |
227 | [_demoView.layer addAnimation:anima forKey:@"cameraIrisHollowOpenAnimation"];
228 | }
229 |
230 | -(void)cameraIrisHollowCloseAnimation{
231 | [self changeView:YES];
232 | CATransition *anima = [CATransition animation];
233 | anima.type = @"cameraIrisHollowClose";//设置动画的类型
234 | anima.subtype = kCATransitionFromRight; //设置动画的方向
235 | anima.duration = 1.0f;
236 |
237 | [_demoView.layer addAnimation:anima forKey:@"cameraIrisHollowCloseAnimation"];
238 | }
239 |
240 | -(NSString *)controllerTitle{
241 | return @"过渡动画";
242 | }
243 |
244 | /**
245 | * 设置view的值
246 | */
247 | -(void)changeView : (BOOL)isUp{
248 | if (_index>3) {
249 | _index = 0;
250 | }
251 | if (_index<0) {
252 | _index = 3;
253 | }
254 | NSArray *colors = [NSArray arrayWithObjects:[UIColor cyanColor],[UIColor magentaColor],[UIColor orangeColor],[UIColor purpleColor], nil];
255 | NSArray *titles = [NSArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
256 | _demoView.backgroundColor = [colors objectAtIndex:_index];
257 | _demoLabel.text = [titles objectAtIndex:_index];
258 | if (isUp) {
259 | _index++;
260 | }else{
261 | _index--;
262 | }
263 | }
264 |
265 | @end
266 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/View/TitleButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // TitleButton.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/19.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface TitleButton : UIButton
12 |
13 | /**
14 | * 初始化按钮
15 | *
16 | * @param frame frame
17 | * @param title 标题
18 | *
19 | * @return 按钮对象
20 | */
21 | -(instancetype)initWithFrame:(CGRect)frame withTitle:(NSString *)title;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/CenterPage/View/TitleButton.m:
--------------------------------------------------------------------------------
1 | //
2 | // TitleButton.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/19.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "TitleButton.h"
10 |
11 | @implementation TitleButton
12 |
13 | -(instancetype)initWithFrame:(CGRect)frame withTitle:(NSString *)title{
14 | self = [super initWithFrame:frame];
15 | if (self) {
16 | [self setTitle:title forState:UIControlStateNormal];
17 | self.titleLabel.font = [UIFont systemFontOfSize:12];
18 | self.backgroundColor = [UIColor grayColor];
19 | }
20 |
21 | return self;
22 | }
23 |
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DCPathButton/DCPathButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // DCPathButton.h
3 | // DCPathButton
4 | //
5 | // Created by tang dixi on 30/7/14.
6 | // Copyright (c) 2014 Tangdxi. All rights reserved.
7 | //
8 |
9 | #import "DCPathItemButton.h"
10 |
11 | @import UIKit;
12 | @import QuartzCore;
13 | @import AudioToolbox;
14 |
15 | @protocol DCPathButtonDelegate
16 |
17 | - (void)itemButtonTappedAtIndex:(NSUInteger)index;
18 |
19 | @end
20 |
21 | @interface DCPathButton : UIView
22 |
23 | @property (weak, nonatomic) id delegate;
24 |
25 | @property (strong, nonatomic) NSMutableArray *itemButtonImages;
26 | @property (strong, nonatomic) NSMutableArray *itemButtonHighlightedImages;
27 |
28 | @property (strong, nonatomic) UIImage *itemButtonBackgroundImage;
29 | @property (strong, nonatomic) UIImage *itemButtonBackgroundHighlightedImage;
30 |
31 | @property (assign, nonatomic) CGFloat bloomRadius;
32 |
33 | - (id)initWithCenterImage:(UIImage *)centerImage hilightedImage:(UIImage *)centerHighlightedImage;
34 | - (void)addPathItems:(NSArray *)pathItemButtons;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DCPathButton/DCPathButton.m:
--------------------------------------------------------------------------------
1 | //
2 | // DCPathButton.m
3 | // DCPathButton
4 | //
5 | // Created by tang dixi on 30/7/14.
6 | // Copyright (c) 2014 Tangdxi. All rights reserved.
7 | //
8 |
9 | #import "DCPathButton.h"
10 | #import "DCPathCenterButton.h"
11 |
12 | @interface DCPathButton ()
13 |
14 | #pragma mark - Private Property
15 |
16 | @property (strong, nonatomic) UIImage *centerImage;
17 | @property (strong, nonatomic) UIImage *centerHighlightedImage;
18 |
19 | @property (assign, nonatomic, getter = isBloom) BOOL bloom;
20 |
21 | @property (assign, nonatomic) CGSize foldedSize;
22 | @property (assign, nonatomic) CGSize bloomSize;
23 |
24 | @property (assign, nonatomic) CGPoint foldCenter;
25 | @property (assign, nonatomic) CGPoint bloomCenter;
26 |
27 | @property (assign, nonatomic) CGPoint pathCenterButtonBloomCenter;
28 |
29 | @property (assign, nonatomic) CGPoint expandCenter;
30 | @property (strong, nonatomic) UIView *bottomView;
31 | @property (strong, nonatomic) DCPathCenterButton *pathCenterButton;
32 | @property (strong, nonatomic) NSMutableArray *itemButtons;
33 |
34 | @property (assign, nonatomic) SystemSoundID bloomSound;
35 | @property (assign, nonatomic) SystemSoundID foldSound;
36 | @property (assign, nonatomic) SystemSoundID selectedSound;
37 |
38 |
39 | @end
40 |
41 | @implementation DCPathButton
42 |
43 | #pragma mark - Initialization
44 |
45 | - (id)initWithCenterImage:(UIImage *)centerImage hilightedImage:(UIImage *)centerHighlightedImage
46 | {
47 | if (self = [super init]) {
48 |
49 | // Configure center and high light center image
50 | //
51 | self.centerImage = centerImage;
52 | self.centerHighlightedImage = centerHighlightedImage;
53 |
54 | // Init button and image array
55 | //
56 | self.itemButtonImages = [[NSMutableArray alloc]init];
57 | self.itemButtonHighlightedImages = [[NSMutableArray alloc]init];
58 | self.itemButtons = [[NSMutableArray alloc]init];
59 |
60 | // Configure views
61 | //
62 | [self configureViewsLayout];
63 |
64 | // Configure sounds
65 | //
66 | [self configureSounds];
67 | }
68 | return self;
69 | }
70 |
71 | - (void)configureViewsLayout
72 | {
73 | // Init some property only once
74 | //
75 | self.foldedSize = self.centerImage.size;
76 | self.bloomSize = [UIScreen mainScreen].bounds.size;
77 |
78 | self.bloom = NO;
79 | self.bloomRadius = 105.0f;
80 |
81 | // Configure the view's center, it will change after the frame folded or bloomed
82 | //景铭修改过了,原来self.foldCenter = CGPointMake(self.bloomSize.width / 2, self.bloomSize.height - 25.5f);
83 | self.foldCenter = CGPointMake(self.bloomSize.width / 2, self.bloomSize.height - 225.5f);
84 | self.bloomCenter = CGPointMake(self.bloomSize.width / 2, self.bloomSize.height / 2);
85 |
86 | // Configure the DCPathButton's origin frame
87 | //
88 | self.frame = CGRectMake(0, 0, self.foldedSize.width, self.foldedSize.height);
89 | self.center = self.foldCenter;
90 |
91 | // Configure center button
92 | //
93 | _pathCenterButton = [[DCPathCenterButton alloc]initWithImage:self.centerImage highlightedImage:self.centerHighlightedImage];
94 | _pathCenterButton.center = CGPointMake(self.frame.size.width/2, self.frame.size.height/2);
95 | _pathCenterButton.delegate = self;
96 | [self addSubview:_pathCenterButton];
97 |
98 | // Configure bottom view
99 | //
100 | _bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.bloomSize.width, self.bloomSize.height)];
101 | _bottomView.backgroundColor = [UIColor blackColor];
102 | _bottomView.alpha = 0.0f;
103 |
104 | }
105 |
106 |
107 | - (void)configureSounds
108 | {
109 | // Configure bloom sound
110 | //
111 | NSString *bloomSoundPath = [[NSBundle mainBundle]pathForResource:@"bloom" ofType:@"caf"];
112 | NSURL *bloomSoundURL = [NSURL fileURLWithPath:bloomSoundPath];
113 | AudioServicesCreateSystemSoundID((__bridge CFURLRef)bloomSoundURL, &_bloomSound);
114 |
115 | // Configure fold sound
116 | //
117 | NSString *foldSoundPath = [[NSBundle mainBundle]pathForResource:@"fold" ofType:@"caf"];
118 | NSURL *foldSoundURL = [NSURL fileURLWithPath:foldSoundPath];
119 | AudioServicesCreateSystemSoundID((__bridge CFURLRef)foldSoundURL, &_foldSound);
120 |
121 | // Configure selected sound
122 | //
123 | NSString *selectedSoundPath = [[NSBundle mainBundle]pathForResource:@"selected" ofType:@"caf"];
124 | NSURL *selectedSoundURL = [NSURL fileURLWithPath:selectedSoundPath];
125 | AudioServicesCreateSystemSoundID((__bridge CFURLRef)selectedSoundURL, &_selectedSound);
126 |
127 | }
128 |
129 | #pragma mark - Configure Center Button Images
130 |
131 | - (void)setCenterImage:(UIImage *)centerImage
132 | {
133 | if (!centerImage) {
134 | NSLog(@"Load center image failed ... ");
135 | return ;
136 | }
137 | _centerImage = centerImage;
138 | }
139 |
140 | - (void)setCenterHighlightedImage:(UIImage *)highlightedImage
141 | {
142 | if (!highlightedImage) {
143 | NSLog(@"Load highted image failed ... ");
144 | return ;
145 | }
146 | _centerHighlightedImage = highlightedImage;
147 | }
148 |
149 | #pragma mark - Configure Expand Center Point
150 |
151 | - (void)setPathCenterButtonBloomCenter:(CGPoint)centerButtonBloomCenter
152 | {
153 | // Just set the bloom center once
154 | //
155 | if (_pathCenterButtonBloomCenter.x == 0) {
156 | _pathCenterButtonBloomCenter = centerButtonBloomCenter;
157 | }
158 | return ;
159 | }
160 |
161 | #pragma mark - Expand Status
162 |
163 | - (BOOL)isBloom
164 | {
165 | return _bloom;
166 | }
167 |
168 | #pragma mark - Center Button Delegate
169 |
170 | - (void)centerButtonTapped
171 | {
172 | self.isBloom? [self pathCenterButtonFold] : [self pathCenterButtonBloom];
173 | }
174 |
175 | #pragma mark - Caculate The Item's End Point
176 |
177 | - (CGPoint)createEndPointWithRadius:(CGFloat)itemExpandRadius andAngel:(CGFloat)angel
178 | {
179 | return CGPointMake(self.pathCenterButtonBloomCenter.x - cosf(angel * M_PI) * itemExpandRadius,
180 | self.pathCenterButtonBloomCenter.y - sinf(angel * M_PI) * itemExpandRadius);
181 | }
182 |
183 | #pragma mark - Center Button Fold
184 |
185 | - (void)pathCenterButtonFold
186 | {
187 | // Play fold sound
188 | //
189 | AudioServicesPlaySystemSound(self.foldSound);
190 |
191 | // Load item buttons from array
192 | //
193 | for (int i = 1; i <= self.itemButtons.count; i++) {
194 |
195 | DCPathItemButton *itemButton = self.itemButtons[i - 1];
196 |
197 | CGFloat currentAngel = i / ((CGFloat)self.itemButtons.count + 1);
198 | CGPoint farPoint = [self createEndPointWithRadius:self.bloomRadius + 5.0f andAngel:currentAngel];
199 |
200 | CAAnimationGroup *foldAnimation = [self foldAnimationFromPoint:itemButton.center withFarPoint:farPoint];
201 |
202 | [itemButton.layer addAnimation:foldAnimation forKey:@"foldAnimation"];
203 | itemButton.center = self.pathCenterButtonBloomCenter;
204 |
205 | }
206 |
207 | [self bringSubviewToFront:self.pathCenterButton];
208 |
209 | // Resize the DCPathButton's frame to the foled frame and remove the item buttons
210 | //
211 | [self resizeToFoldedFrame];
212 |
213 | }
214 |
215 | - (void)resizeToFoldedFrame
216 | {
217 | [UIView animateWithDuration:0.0618f * 3
218 | delay:0.0618f * 2
219 | options:UIViewAnimationOptionCurveEaseIn
220 | animations:^{
221 | _pathCenterButton.transform = CGAffineTransformMakeRotation(0);
222 | }
223 | completion:nil];
224 |
225 | [UIView animateWithDuration:0.1f
226 | delay:0.35f
227 | options:UIViewAnimationOptionCurveLinear
228 | animations:^{
229 | _bottomView.alpha = 0.0f;
230 | }
231 | completion:nil];
232 |
233 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
234 | for (DCPathItemButton *itemButton in self.itemButtons) {
235 | [itemButton performSelector:@selector(removeFromSuperview)];
236 | }
237 |
238 | self.frame = CGRectMake(0, 0, self.foldedSize.width, self.foldedSize.height);
239 | self.center = self.foldCenter;
240 | self.pathCenterButton.center = CGPointMake(self.frame.size.width/2, self.frame.size.height/2);
241 |
242 | [self.bottomView removeFromSuperview];
243 | });
244 |
245 | _bloom = NO;
246 | }
247 |
248 | - (CAAnimationGroup *)foldAnimationFromPoint:(CGPoint)endPoint withFarPoint:(CGPoint)farPoint
249 | {
250 | // 1.Configure rotation animation
251 | //
252 | CAKeyframeAnimation *rotationAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
253 | rotationAnimation.values = @[@(0), @(M_PI), @(M_PI * 2)];
254 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
255 | rotationAnimation.duration = 0.35f;
256 |
257 | // 2.Configure moving animation
258 | //
259 | CAKeyframeAnimation *movingAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
260 |
261 | // Create moving path
262 | //
263 | CGMutablePathRef path = CGPathCreateMutable();
264 | CGPathMoveToPoint(path, NULL, endPoint.x, endPoint.y);
265 | CGPathAddLineToPoint(path, NULL, farPoint.x, farPoint.y);
266 | CGPathAddLineToPoint(path, NULL, self.pathCenterButtonBloomCenter.x, self.pathCenterButtonBloomCenter.y);
267 |
268 | movingAnimation.keyTimes = @[@(0.0f), @(0.75), @(1.0)];
269 |
270 | movingAnimation.path = path;
271 | movingAnimation.duration = 0.35f;
272 | CGPathRelease(path);
273 |
274 | // 3.Merge animation together
275 | //
276 | CAAnimationGroup *animations = [CAAnimationGroup animation];
277 | animations.animations = @[rotationAnimation, movingAnimation];
278 | animations.duration = 0.35f;
279 |
280 | return animations;
281 | }
282 |
283 | #pragma mark - Center Button Bloom
284 |
285 | - (void)pathCenterButtonBloom
286 | {
287 | // Play bloom sound
288 | //
289 | AudioServicesPlaySystemSound(self.bloomSound);
290 |
291 | // Configure center button bloom
292 | //
293 | // 1. Store the current center point to 'centerButtonBloomCenter
294 | //
295 | self.pathCenterButtonBloomCenter = self.center;
296 |
297 | // 2. Resize the DCPathButton's frame
298 | //
299 | self.frame = CGRectMake(0, 0, self.bloomSize.width, self.bloomSize.height);
300 | self.center = CGPointMake(self.bloomSize.width / 2, self.bloomSize.height / 2);
301 |
302 | [self insertSubview:self.bottomView belowSubview:self.pathCenterButton];
303 |
304 | // 3. Excute the bottom view alpha animation
305 | //
306 | [UIView animateWithDuration:0.0618f * 3
307 | delay:0.0f
308 | options:UIViewAnimationOptionCurveEaseIn
309 | animations:^{
310 | _bottomView.alpha = 0.618f;
311 | }
312 | completion:nil];
313 |
314 | // 4. Excute the center button rotation animation
315 | //
316 | [UIView animateWithDuration:0.1575f
317 | animations:^{
318 | _pathCenterButton.transform = CGAffineTransformMakeRotation(-0.75f * M_PI);
319 | }];
320 |
321 | self.pathCenterButton.center = self.pathCenterButtonBloomCenter;
322 |
323 | // 5. Excute the bloom animation
324 | //
325 | CGFloat basicAngel = 180 / (self.itemButtons.count + 1) ;
326 |
327 | for (int i = 1; i <= self.itemButtons.count; i++) {
328 |
329 | DCPathItemButton *pathItemButton = self.itemButtons[i - 1];
330 |
331 | pathItemButton.delegate = self;
332 | pathItemButton.tag = i - 1;
333 | pathItemButton.transform = CGAffineTransformMakeTranslation(1, 1);
334 | pathItemButton.alpha = 1.0f;
335 |
336 | // 1. Add pathItem button to the view
337 | //
338 | CGFloat currentAngel = (basicAngel * i)/180;
339 |
340 | pathItemButton.center = self.pathCenterButtonBloomCenter;
341 |
342 | [self insertSubview:pathItemButton belowSubview:self.pathCenterButton];
343 |
344 | // 2.Excute expand animation
345 | //
346 | CGPoint endPoint = [self createEndPointWithRadius:self.bloomRadius andAngel:currentAngel];
347 | CGPoint farPoint = [self createEndPointWithRadius:self.bloomRadius + 10.0f andAngel:currentAngel];
348 | CGPoint nearPoint = [self createEndPointWithRadius:self.bloomRadius - 5.0f andAngel:currentAngel];
349 |
350 | CAAnimationGroup *bloomAnimation = [self bloomAnimationWithEndPoint:endPoint
351 | andFarPoint:farPoint
352 | andNearPoint:nearPoint];
353 |
354 | [pathItemButton.layer addAnimation:bloomAnimation forKey:@"bloomAnimation"];
355 | pathItemButton.center = endPoint;
356 |
357 | }
358 |
359 | _bloom = YES;
360 |
361 | }
362 |
363 | - (CAAnimationGroup *)bloomAnimationWithEndPoint:(CGPoint)endPoint andFarPoint:(CGPoint)farPoint andNearPoint:(CGPoint)nearPoint
364 | {
365 | // 1.Configure rotation animation
366 | //
367 | CAKeyframeAnimation *rotationAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
368 | rotationAnimation.values = @[@(0.0), @(- M_PI), @(- M_PI * 1.5), @(- M_PI * 2)];
369 | rotationAnimation.duration = 0.3f;
370 | rotationAnimation.keyTimes = @[@(0.0), @(0.3), @(0.6), @(1.0)];
371 |
372 | // 2.Configure moving animation
373 | //
374 | CAKeyframeAnimation *movingAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
375 |
376 | // Create moving path
377 | //
378 | CGMutablePathRef path = CGPathCreateMutable();
379 | CGPathMoveToPoint(path, NULL, self.pathCenterButtonBloomCenter.x, self.pathCenterButtonBloomCenter.y);
380 | CGPathAddLineToPoint(path, NULL, farPoint.x, farPoint.y);
381 | CGPathAddLineToPoint(path, NULL, nearPoint.x, nearPoint.y);
382 | CGPathAddLineToPoint(path, NULL, endPoint.x, endPoint.y);
383 |
384 | movingAnimation.path = path;
385 | movingAnimation.keyTimes = @[@(0.0), @(0.5), @(0.7), @(1.0)];
386 | movingAnimation.duration = 0.3f;
387 | CGPathRelease(path);
388 |
389 | // 3.Merge two animation together
390 | //
391 | CAAnimationGroup *animations = [CAAnimationGroup animation];
392 | animations.animations = @[movingAnimation, rotationAnimation];
393 | animations.duration = 0.3f;
394 | animations.delegate = self;
395 |
396 | return animations;
397 | }
398 |
399 | #pragma mark - Add PathButton Item
400 |
401 | - (void)addPathItems:(NSArray *)pathItemButtons
402 | {
403 | [self.itemButtons addObjectsFromArray:pathItemButtons];
404 | }
405 |
406 | #pragma mark - DCPathButton Touch Events
407 |
408 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
409 | {
410 | // Tap the bottom area, excute the fold animation
411 | [self pathCenterButtonFold];
412 | }
413 |
414 | #pragma mark - DCPathButton Item Delegate
415 |
416 | - (void)itemButtonTapped:(DCPathItemButton *)itemButton
417 | {
418 | if ([_delegate respondsToSelector:@selector(itemButtonTappedAtIndex:)]) {
419 |
420 | DCPathItemButton *selectedButton = self.itemButtons[itemButton.tag];
421 |
422 | // Play selected sound
423 | //
424 | AudioServicesPlaySystemSound(self.selectedSound);
425 |
426 | // Excute the explode animation when the item is seleted
427 | //
428 | [UIView animateWithDuration:0.0618f * 5
429 | animations:^{
430 | selectedButton.transform = CGAffineTransformMakeScale(3, 3);
431 | selectedButton.alpha = 0.0f;
432 | }];
433 |
434 | // Excute the dismiss animation when the item is unselected
435 | //
436 | for (int i = 0; i < self.itemButtons.count; i++) {
437 | if (i == selectedButton.tag) {
438 | continue;
439 | }
440 | DCPathItemButton *unselectedButton = self.itemButtons[i];
441 | [UIView animateWithDuration:0.0618f * 2
442 | animations:^{
443 | unselectedButton.transform = CGAffineTransformMakeScale(0, 0);
444 | }];
445 | }
446 |
447 | // Excute the delegate method
448 | //
449 | [_delegate itemButtonTappedAtIndex:itemButton.tag];
450 |
451 | // Resize the DCPathButton's frame
452 | //
453 | [self resizeToFoldedFrame];
454 | }
455 | }
456 |
457 | @end
458 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DCPathButton/DCPathCenterButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // DCPathCenterButton.h
3 | // DCPathButton
4 | //
5 | // Created by tang dixi on 30/7/14.
6 | // Copyright (c) 2014 Tangdxi. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @protocol DCPathCenterButtonDelegate
12 |
13 | - (void)centerButtonTapped;
14 |
15 | @end
16 |
17 | @interface DCPathCenterButton : UIImageView
18 |
19 | @property (weak, nonatomic) id delegate;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DCPathButton/DCPathCenterButton.m:
--------------------------------------------------------------------------------
1 | //
2 | // DCPathCenterButton.m
3 | // DCPathButton
4 | //
5 | // Created by tang dixi on 30/7/14.
6 | // Copyright (c) 2014 Tangdxi. All rights reserved.
7 | //
8 |
9 | #import "DCPathCenterButton.h"
10 |
11 | @implementation DCPathCenterButton
12 |
13 | - (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage
14 | {
15 | if (self = [super initWithImage:image highlightedImage:highlightedImage]) {
16 |
17 | self.userInteractionEnabled = YES;
18 |
19 | self.image = image;
20 | self.highlightedImage = highlightedImage;
21 |
22 | }
23 | return self;
24 | }
25 |
26 | #pragma mark - Scale Center Button Frame to 5x
27 |
28 | - (CGRect)scaleRect:(CGRect)originRect
29 | {
30 | return CGRectMake(- originRect.size.width,
31 | - originRect.size.height,
32 | originRect.size.width * 3,
33 | originRect.size.height * 3);
34 | }
35 |
36 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
37 | {
38 | self.highlighted = YES;
39 |
40 | // Center button Begin Tapped
41 | if ([_delegate respondsToSelector:@selector(centerButtonTapped)]) {
42 | [_delegate centerButtonTapped];
43 | }
44 |
45 | }
46 |
47 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
48 | {
49 | CGPoint currentLocation = [[touches anyObject]locationInView:self];
50 |
51 |
52 | // Cancel button highlight when the touch location is out of 5x area
53 | //
54 | if (!CGRectContainsPoint([self scaleRect:self.bounds] , currentLocation)) {
55 | self.highlighted = NO;
56 | return ;
57 | }
58 |
59 | // If moving in the 3x area, keep the highlight state
60 | //
61 | self.highlighted = YES;
62 | }
63 |
64 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
65 | {
66 | self.highlighted = NO;
67 | }
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DCPathButton/DCPathItemButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // DCPathItemButton.h
3 | // DCPathButton
4 | //
5 | // Created by tang dixi on 31/7/14.
6 | // Copyright (c) 2014 Tangdxi. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @class DCPathItemButton;
12 |
13 | @protocol DCPathItemButtonDelegate
14 |
15 | - (void)itemButtonTapped:(DCPathItemButton *)itemButton;
16 |
17 | @end
18 |
19 | @interface DCPathItemButton : UIImageView
20 |
21 | @property (assign, nonatomic) NSUInteger index;
22 | @property (weak, nonatomic) id delegate;
23 |
24 | - (id)initWithImage:(UIImage *)image
25 | highlightedImage:(UIImage *)highlightedImage
26 | backgroundImage:(UIImage *)backgroundImage
27 | backgroundHighlightedImage:(UIImage *)backgroundHighlightedImage;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DCPathButton/DCPathItemButton.m:
--------------------------------------------------------------------------------
1 | //
2 | // DCPathItemButton.m
3 | // DCPathButton
4 | //
5 | // Created by tang dixi on 31/7/14.
6 | // Copyright (c) 2014 Tangdxi. All rights reserved.
7 | //
8 |
9 | #import "DCPathItemButton.h"
10 |
11 | @interface DCPathItemButton ()
12 |
13 | @property (strong, nonatomic) UIImageView *backgroundImageView;
14 |
15 | @end
16 |
17 | @implementation DCPathItemButton
18 |
19 | - (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage backgroundImage:(UIImage *)backgroundImage backgroundHighlightedImage:(UIImage *)backgroundHighlightedImage
20 | {
21 | if (self = [super init]) {
22 |
23 | // Make sure the iteam has a certain frame
24 | //
25 | CGRect itemFrame = CGRectMake(0, 0, backgroundImage.size.width, backgroundImage.size.height);
26 |
27 | if (!backgroundImage || !backgroundHighlightedImage) {
28 | itemFrame = CGRectMake(0, 0, image.size.width, image.size.height);
29 | }
30 | self.frame = itemFrame;
31 |
32 | // Configure the item image
33 | //
34 | self.image = backgroundImage;
35 | self.highlightedImage = backgroundHighlightedImage;
36 |
37 | self.userInteractionEnabled = YES;
38 |
39 | // Configure background
40 | //
41 | _backgroundImageView = [[UIImageView alloc]initWithImage:image
42 | highlightedImage:highlightedImage];
43 |
44 | _backgroundImageView.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
45 |
46 | [self addSubview:_backgroundImageView];
47 |
48 | }
49 | return self;
50 | }
51 |
52 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
53 | {
54 | self.highlighted = YES;
55 | self.backgroundImageView.highlighted = YES;
56 | }
57 |
58 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
59 | {
60 | CGPoint currentLocation = [[touches anyObject]locationInView:self];
61 |
62 | if (! CGRectContainsPoint([self scaleRect:self.bounds], currentLocation)) {
63 | self.highlighted = NO;
64 | self.backgroundImageView.highlighted = NO;
65 |
66 | return ;
67 | }
68 |
69 | self.highlighted = YES;
70 | self.backgroundImageView.highlighted = YES;
71 | }
72 |
73 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
74 | {
75 | if ([_delegate respondsToSelector:@selector(itemButtonTapped:)]) {
76 | [_delegate itemButtonTapped:self];
77 | }
78 |
79 | self.highlighted = NO;
80 | self.backgroundImageView.highlighted = NO;
81 | }
82 |
83 | #pragma mark - Scale Item Button
84 |
85 | - (CGRect)scaleRect:(CGRect)originRect
86 | {
87 | return CGRectMake(- originRect.size.width * 2,
88 | - originRect.size.height * 2,
89 | originRect.size.width * 5,
90 | originRect.size.height * 5);
91 | }
92 |
93 | @end
94 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DWBubbleMenuButton/DWBubbleMenuButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // DWBubbleMenuButton.h
3 | // DWBubbleMenuButtonExample
4 | //
5 | // Created by Derrick Walker on 10/8/14.
6 | // Copyright (c) 2014 Derrick Walker. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, ExpansionDirection) {
12 | DirectionLeft = 0,
13 | DirectionRight,
14 | DirectionUp,
15 | DirectionDown
16 | };
17 |
18 |
19 | @class DWBubbleMenuButton;
20 |
21 | @protocol DWBubbleMenuViewDelegate
22 |
23 | @optional
24 | - (void)bubbleMenuButtonWillExpand:(DWBubbleMenuButton *)expandableView;
25 | - (void)bubbleMenuButtonDidExpand:(DWBubbleMenuButton *)expandableView;
26 | - (void)bubbleMenuButtonWillCollapse:(DWBubbleMenuButton *)expandableView;
27 | - (void)bubbleMenuButtonDidCollapse:(DWBubbleMenuButton *)expandableView;
28 |
29 | @end
30 |
31 | @interface DWBubbleMenuButton : UIView
32 |
33 | @property (nonatomic, weak, readonly) NSArray *buttons;
34 | @property (nonatomic, strong) UIView *homeButtonView;
35 | @property (nonatomic, readonly) BOOL isCollapsed;
36 | @property (nonatomic, weak) id delegate;
37 |
38 | // The direction in which the menu expands
39 | @property (nonatomic) enum ExpansionDirection direction;
40 |
41 | // Indicates whether the home button will animate it's touch highlighting, this is enabled by default
42 | @property (nonatomic) BOOL animatedHighlighting;
43 |
44 | // Indicates whether menu should collapse after a button selection, this is enabled by default
45 | @property (nonatomic) BOOL collapseAfterSelection;
46 |
47 | // The duration of the expand/collapse animation
48 | @property (nonatomic) float animationDuration;
49 |
50 | // The default alpha of the homeButtonView when not tapped
51 | @property (nonatomic) float standbyAlpha;
52 |
53 | // The highlighted alpha of the homeButtonView when tapped
54 | @property (nonatomic) float highlightAlpha;
55 |
56 | // The spacing between menu buttons when expanded
57 | @property (nonatomic) float buttonSpacing;
58 |
59 | // Initializers
60 | - (id)initWithFrame:(CGRect)frame expansionDirection:(ExpansionDirection)direction;
61 |
62 | // Public Methods
63 | - (void)addButtons:(NSArray *)buttons;
64 | - (void)addButton:(UIButton *)button;
65 | - (void)showButtons;
66 | - (void)dismissButtons;
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/DWBubbleMenuButton/DWBubbleMenuButton.m:
--------------------------------------------------------------------------------
1 | //
2 | // DWBubbleMenuButton.m
3 | // DWBubbleMenuButtonExample
4 | //
5 | // Created by Derrick Walker on 10/8/14.
6 | // Copyright (c) 2014 Derrick Walker. All rights reserved.
7 | //
8 |
9 | #import "DWBubbleMenuButton.h"
10 |
11 | #define kDefaultAnimationDuration 0.25f
12 |
13 | @interface DWBubbleMenuButton ()
14 |
15 | @property (nonatomic, strong) UITapGestureRecognizer *tapGestureRecognizer;
16 | @property (nonatomic, strong) NSMutableArray *buttonContainer;
17 | @property (nonatomic, assign) CGRect originFrame;
18 |
19 | @end
20 |
21 | @implementation DWBubbleMenuButton
22 |
23 | #pragma mark -
24 | #pragma mark Public Methods
25 |
26 | - (void)addButtons:(NSArray *)buttons {
27 | assert(buttons != nil);
28 | for (UIButton *button in buttons) {
29 | [self addButton:button];
30 | }
31 |
32 | if (self.homeButtonView != nil) {
33 | [self bringSubviewToFront:self.homeButtonView];
34 | }
35 | }
36 |
37 | - (void)addButton:(UIButton *)button {
38 | assert(button != nil);
39 | if (_buttonContainer == nil) {
40 | self.buttonContainer = [[NSMutableArray alloc] init];
41 | }
42 |
43 | if ([_buttonContainer containsObject:button] == false) {
44 | [_buttonContainer addObject:button];
45 | [self addSubview:button];
46 | button.hidden = YES;
47 | }
48 | }
49 |
50 | - (void)showButtons {
51 | if ([self.delegate respondsToSelector:@selector(bubbleMenuButtonWillExpand:)]) {
52 | [self.delegate bubbleMenuButtonWillExpand:self];
53 | }
54 |
55 | [self _prepareForButtonExpansion];
56 |
57 | self.userInteractionEnabled = NO;
58 |
59 | [CATransaction begin];
60 | [CATransaction setAnimationDuration:_animationDuration];
61 | [CATransaction setCompletionBlock:^{
62 | for (UIButton *button in _buttonContainer) {
63 | button.transform = CGAffineTransformIdentity;
64 | }
65 |
66 | if (self.delegate != nil) {
67 | if ([self.delegate respondsToSelector:@selector(bubbleMenuButtonDidExpand:)]) {
68 | [self.delegate bubbleMenuButtonDidExpand:self];
69 | }
70 | }
71 |
72 | self.userInteractionEnabled = YES;
73 | }];
74 |
75 | NSArray *buttonContainer = _buttonContainer;
76 |
77 | if (self.direction == DirectionUp || self.direction == DirectionLeft) {
78 | buttonContainer = [self _reverseOrderFromArray:_buttonContainer];
79 | }
80 |
81 | for (int i = 0; i < buttonContainer.count; i++) {
82 | int index = (int)buttonContainer.count - (i + 1);
83 |
84 | UIButton *button = [buttonContainer objectAtIndex:index];
85 | button.hidden = NO;
86 |
87 | // position animation
88 | CABasicAnimation *positionAnimation = [CABasicAnimation animationWithKeyPath:@"position"];
89 |
90 | CGPoint originPosition = CGPointZero;
91 | CGPoint finalPosition = CGPointZero;
92 |
93 | switch (self.direction) {
94 | case DirectionLeft:
95 | originPosition = CGPointMake(self.frame.size.width - self.homeButtonView.frame.size.width, self.frame.size.height/2.f);
96 | finalPosition = CGPointMake(self.frame.size.width - self.homeButtonView.frame.size.width - button.frame.size.width/2.f - self.buttonSpacing
97 | - ((button.frame.size.width + self.buttonSpacing) * index),
98 | self.frame.size.height/2.f);
99 | break;
100 |
101 | case DirectionRight:
102 | originPosition = CGPointMake(self.homeButtonView.frame.size.width, self.frame.size.height/2.f);
103 | finalPosition = CGPointMake(self.homeButtonView.frame.size.width + self.buttonSpacing + button.frame.size.width/2.f
104 | + ((button.frame.size.width + self.buttonSpacing) * index),
105 | self.frame.size.height/2.f);
106 | break;
107 |
108 | case DirectionUp:
109 | originPosition = CGPointMake(self.frame.size.width/2.f, self.frame.size.height - self.homeButtonView.frame.size.height);
110 | finalPosition = CGPointMake(self.frame.size.width/2.f,
111 | self.frame.size.height - self.homeButtonView.frame.size.height - self.buttonSpacing - button.frame.size.height/2.f
112 | - ((button.frame.size.height + self.buttonSpacing) * index));
113 | break;
114 |
115 | case DirectionDown:
116 | originPosition = CGPointMake(self.frame.size.width/2.f, self.homeButtonView.frame.size.height);
117 | finalPosition = CGPointMake(self.frame.size.width/2.f,
118 | self.homeButtonView.frame.size.height + self.buttonSpacing + button.frame.size.height/2.f
119 | + ((button.frame.size.height + self.buttonSpacing) * index));
120 | break;
121 |
122 | default:
123 | break;
124 | }
125 |
126 | positionAnimation.duration = _animationDuration;
127 | positionAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
128 | positionAnimation.fromValue = [NSValue valueWithCGPoint:originPosition];
129 | positionAnimation.toValue = [NSValue valueWithCGPoint:finalPosition];
130 | positionAnimation.beginTime = CACurrentMediaTime() + (_animationDuration/(float)_buttonContainer.count * (float)i);
131 | positionAnimation.fillMode = kCAFillModeForwards;
132 | positionAnimation.removedOnCompletion = NO;
133 |
134 | [button.layer addAnimation:positionAnimation forKey:@"positionAnimation"];
135 |
136 | button.layer.position = finalPosition;
137 |
138 | // scale animation
139 | CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
140 |
141 | scaleAnimation.duration = _animationDuration;
142 | scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
143 | scaleAnimation.fromValue = [NSNumber numberWithFloat:0.01f];
144 | scaleAnimation.toValue = [NSNumber numberWithFloat:1.f];
145 | scaleAnimation.beginTime = CACurrentMediaTime() + (_animationDuration/(float)_buttonContainer.count * (float)i) + 0.03f;
146 | scaleAnimation.fillMode = kCAFillModeForwards;
147 | scaleAnimation.removedOnCompletion = NO;
148 |
149 | [button.layer addAnimation:scaleAnimation forKey:@"scaleAnimation"];
150 |
151 | button.transform = CGAffineTransformMakeScale(0.01f, 0.01f);
152 | }
153 |
154 | [CATransaction commit];
155 |
156 | _isCollapsed = NO;
157 | }
158 |
159 | - (void)dismissButtons {
160 | if ([self.delegate respondsToSelector:@selector(bubbleMenuButtonWillCollapse:)]) {
161 | [self.delegate bubbleMenuButtonWillCollapse:self];
162 | }
163 |
164 | self.userInteractionEnabled = NO;
165 |
166 | [CATransaction begin];
167 | [CATransaction setAnimationDuration:_animationDuration];
168 | [CATransaction setCompletionBlock:^{
169 | [self _finishCollapse];
170 |
171 | for (UIButton *button in _buttonContainer) {
172 | button.transform = CGAffineTransformIdentity;
173 | button.hidden = YES;
174 | }
175 |
176 | if (self.delegate != nil) {
177 | if ([self.delegate respondsToSelector:@selector(bubbleMenuButtonDidCollapse:)]) {
178 | [self.delegate bubbleMenuButtonDidCollapse:self];
179 | }
180 | }
181 |
182 | self.userInteractionEnabled = YES;
183 | }];
184 |
185 | int index = 0;
186 | for (int i = (int)_buttonContainer.count - 1; i >= 0; i--) {
187 | UIButton *button = [_buttonContainer objectAtIndex:i];
188 |
189 | if (self.direction == DirectionDown || self.direction == DirectionRight) {
190 | button = [_buttonContainer objectAtIndex:index];
191 | }
192 |
193 | // scale animation
194 | CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
195 |
196 | scaleAnimation.duration = _animationDuration;
197 | scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
198 | scaleAnimation.fromValue = [NSNumber numberWithFloat:1.f];
199 | scaleAnimation.toValue = [NSNumber numberWithFloat:0.01f];
200 | scaleAnimation.beginTime = CACurrentMediaTime() + (_animationDuration/(float)_buttonContainer.count * (float)index) + 0.03;
201 | scaleAnimation.fillMode = kCAFillModeForwards;
202 | scaleAnimation.removedOnCompletion = NO;
203 |
204 | [button.layer addAnimation:scaleAnimation forKey:@"scaleAnimation"];
205 |
206 | button.transform = CGAffineTransformMakeScale(1.f, 1.f);
207 |
208 | // position animation
209 | CABasicAnimation *positionAnimation = [CABasicAnimation animationWithKeyPath:@"position"];
210 |
211 | CGPoint originPosition = button.layer.position;
212 | CGPoint finalPosition = CGPointZero;
213 |
214 | switch (self.direction) {
215 | case DirectionLeft:
216 | finalPosition = CGPointMake(self.frame.size.width - self.homeButtonView.frame.size.width, self.frame.size.height/2.f);
217 | break;
218 |
219 | case DirectionRight:
220 | finalPosition = CGPointMake(self.homeButtonView.frame.size.width, self.frame.size.height/2.f);
221 | break;
222 |
223 | case DirectionUp:
224 | finalPosition = CGPointMake(self.frame.size.width/2.f, self.frame.size.height - self.homeButtonView.frame.size.height);
225 | break;
226 |
227 | case DirectionDown:
228 | finalPosition = CGPointMake(self.frame.size.width/2.f, self.homeButtonView.frame.size.height);
229 | break;
230 |
231 | default:
232 | break;
233 | }
234 |
235 | positionAnimation.duration = _animationDuration;
236 | positionAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
237 | positionAnimation.fromValue = [NSValue valueWithCGPoint:originPosition];
238 | positionAnimation.toValue = [NSValue valueWithCGPoint:finalPosition];
239 | positionAnimation.beginTime = CACurrentMediaTime() + (_animationDuration/(float)_buttonContainer.count * (float)index);
240 | positionAnimation.fillMode = kCAFillModeForwards;
241 | positionAnimation.removedOnCompletion = NO;
242 |
243 | [button.layer addAnimation:positionAnimation forKey:@"positionAnimation"];
244 |
245 | button.layer.position = originPosition;
246 | index++;
247 | }
248 |
249 | [CATransaction commit];
250 |
251 | _isCollapsed = YES;
252 | }
253 |
254 | #pragma mark -
255 | #pragma mark Private Methods
256 |
257 | - (void)_defaultInit {
258 | self.clipsToBounds = YES;
259 | self.layer.masksToBounds = YES;
260 |
261 | self.direction = DirectionUp;
262 | self.animatedHighlighting = YES;
263 | self.collapseAfterSelection = YES;
264 | self.animationDuration = kDefaultAnimationDuration;
265 | self.standbyAlpha = 1.f;
266 | self.highlightAlpha = 0.45f;
267 | self.originFrame = self.frame;
268 | self.buttonSpacing = 20.f;
269 | _isCollapsed = YES;
270 |
271 | self.tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_handleTapGesture:)];
272 | self.tapGestureRecognizer.cancelsTouchesInView = NO;
273 | self.tapGestureRecognizer.delegate = self;
274 |
275 | [self addGestureRecognizer:self.tapGestureRecognizer];
276 | }
277 |
278 | - (void)_handleTapGesture:(id)sender {
279 | if (self.tapGestureRecognizer.state == UIGestureRecognizerStateEnded) {
280 | CGPoint touchLocation = [self.tapGestureRecognizer locationOfTouch:0 inView:self];
281 |
282 | if (_collapseAfterSelection && _isCollapsed == NO && CGRectContainsPoint(self.homeButtonView.frame, touchLocation) == false) {
283 | [self dismissButtons];
284 | }
285 | }
286 | }
287 |
288 | - (void)_animateWithBlock:(void (^)(void))animationBlock {
289 | [UIView transitionWithView:self
290 | duration:kDefaultAnimationDuration
291 | options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut
292 | animations:animationBlock
293 | completion:NULL];
294 | }
295 |
296 | - (void)_setTouchHighlighted:(BOOL)highlighted {
297 | float alphaValue = highlighted ? _highlightAlpha : _standbyAlpha;
298 |
299 | if (self.homeButtonView.alpha == alphaValue)
300 | return;
301 |
302 | if (_animatedHighlighting) {
303 | [self _animateWithBlock:^{
304 | if (self.homeButtonView != nil) {
305 | self.homeButtonView.alpha = alphaValue;
306 | }
307 | }];
308 | } else {
309 | if (self.homeButtonView != nil) {
310 | self.homeButtonView.alpha = alphaValue;
311 | }
312 | }
313 | }
314 |
315 | - (float)_combinedButtonHeight {
316 | float height = 0;
317 | for (UIButton *button in _buttonContainer) {
318 | height += button.frame.size.height + self.buttonSpacing;
319 | }
320 |
321 | return height;
322 | }
323 |
324 | - (float)_combinedButtonWidth {
325 | float width = 0;
326 | for (UIButton *button in _buttonContainer) {
327 | width += button.frame.size.width + self.buttonSpacing;
328 | }
329 |
330 | return width;
331 | }
332 |
333 | /**
334 | * 设置展开后的self.frame
335 | */
336 | - (void)_prepareForButtonExpansion {
337 | float buttonHeight = [self _combinedButtonHeight];
338 | float buttonWidth = [self _combinedButtonWidth];
339 |
340 | switch (self.direction) {
341 | case DirectionUp:
342 | {
343 | self.homeButtonView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;//自动调整与superView顶部的距离,保证与superView底部的距离不变。
344 |
345 | CGRect frame = self.frame;
346 | frame.origin.y -= buttonHeight;
347 | frame.size.height += buttonHeight;
348 | self.frame = frame;
349 | }
350 | break;
351 |
352 | case DirectionDown:
353 | {
354 | self.homeButtonView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;//自动调整与superView底部的距离,也就是说,与superView顶部的距离不变。
355 |
356 | CGRect frame = self.frame;
357 | frame.size.height += buttonHeight;
358 | self.frame = frame;
359 | }
360 | break;
361 |
362 | case DirectionLeft:
363 | {
364 | self.homeButtonView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;//自动调整与superView左边的距离,保证与superView右边的距离不变。
365 |
366 | CGRect frame = self.frame;
367 | frame.origin.x -= buttonWidth;
368 | frame.size.width += buttonWidth;
369 | self.frame = frame;
370 | }
371 | break;
372 |
373 | case DirectionRight:
374 | {
375 | self.homeButtonView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;//自动调整与superView的右边距离,保证与superView左边的距离不变。
376 |
377 | CGRect frame = self.frame;
378 | frame.size.width += buttonWidth;
379 | self.frame = frame;
380 | }
381 | break;
382 |
383 | default:
384 | break;
385 | }
386 | }
387 |
388 | - (void)_finishCollapse {
389 | self.frame = _originFrame;
390 | }
391 |
392 | - (UIView *)_subviewForPoint:(CGPoint)point {
393 | for (UIView *subview in self.subviews) {
394 | if (CGRectContainsPoint(subview.frame, point)) {
395 | return subview;
396 | }
397 | }
398 |
399 | return self;
400 | }
401 |
402 | - (NSArray *)_reverseOrderFromArray:(NSArray *)array {
403 | NSMutableArray *reverseArray = [NSMutableArray array];
404 |
405 | for (int i = (int)array.count - 1; i >= 0; i--) {
406 | [reverseArray addObject:[array objectAtIndex:i]];
407 | }
408 |
409 | return reverseArray;
410 | }
411 |
412 | #pragma mark -
413 | #pragma mark Setters/Getters
414 |
415 | - (void)setHomeButtonView:(UIView *)homeButtonView {
416 | if (_homeButtonView != homeButtonView) {
417 | _homeButtonView = homeButtonView;
418 | }
419 |
420 | if ([_homeButtonView isDescendantOfView:self] == NO) {
421 | [self addSubview:_homeButtonView];
422 | }
423 | }
424 |
425 | - (NSArray *)buttons {
426 | return [_buttonContainer copy];
427 | }
428 |
429 | #pragma mark -
430 | #pragma mark Touch Handling Methods
431 |
432 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
433 | [super touchesBegan:touches withEvent:event];
434 | UITouch *touch = [touches anyObject];
435 |
436 | if (CGRectContainsPoint(self.homeButtonView.frame, [touch locationInView:self])) {
437 | [self _setTouchHighlighted:YES];
438 | }
439 | }
440 |
441 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
442 | [super touchesEnded:touches withEvent:event];
443 | UITouch *touch = [touches anyObject];
444 |
445 | [self _setTouchHighlighted:NO];
446 |
447 | if (CGRectContainsPoint(self.homeButtonView.frame, [touch locationInView:self])) {
448 | if (_isCollapsed) {
449 | [self showButtons];
450 | } else {
451 | [self dismissButtons];
452 | }
453 | }
454 | }
455 |
456 | - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
457 | [super touchesCancelled:touches withEvent:event];
458 |
459 | [self _setTouchHighlighted:NO];
460 | }
461 |
462 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
463 | [super touchesMoved:touches withEvent:event];
464 | UITouch *touch = [touches anyObject];
465 |
466 | [self _setTouchHighlighted:CGRectContainsPoint(self.homeButtonView.frame, [touch locationInView:self])];
467 | }
468 |
469 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
470 | {
471 | UIView *hitView = [super hitTest:point withEvent:event];
472 |
473 | if (hitView == self) {
474 | if (_isCollapsed) {
475 | return self;
476 | } else {
477 | return [self _subviewForPoint:point];
478 | }
479 | }
480 |
481 | return hitView;
482 | }
483 |
484 | #pragma mark -
485 | #pragma mark UIGestureRecognizer Delegate
486 |
487 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
488 | shouldReceiveTouch:(UITouch *)touch {
489 | CGPoint touchLocation = [touch locationInView:self];
490 |
491 | if ([self _subviewForPoint:touchLocation] != self && _collapseAfterSelection) {
492 | return YES;
493 | }
494 |
495 | return NO;
496 | }
497 |
498 | #pragma mark -
499 | #pragma mark Lifecycle
500 |
501 | - (id)initWithFrame:(CGRect)frame {
502 | self = [super initWithFrame:frame];
503 |
504 | if (self) {
505 | [self _defaultInit];
506 | }
507 | return self;
508 | }
509 |
510 | - (id)initWithFrame:(CGRect)frame expansionDirection:(ExpansionDirection)direction {
511 | self = [super initWithFrame:frame];
512 |
513 | if (self) {
514 | [self _defaultInit];
515 | _direction = direction;
516 | }
517 | return self;
518 | }
519 |
520 | @end
521 |
522 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | alibaba.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/LeftPage/LeftViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LeftViewController.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LeftViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/LeftPage/LeftViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // LeftViewController.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "LeftViewController.h"
10 | #import "SWRevealViewController.h"
11 | #import "BaseAnimationController.h"
12 | #import "KeyFrameAnimationController.h"
13 | #import "GroupAnimationController.h"
14 | #import "TransitionAnimationController.h"
15 | #import "ComprehensiveCaseController.h"
16 | #import "AffineTransformController.h"
17 |
18 | @interface LeftViewController()
19 |
20 | @property (nonatomic , strong) UITableView *tableView;
21 |
22 | @property (nonatomic , strong) NSArray *menuArray;
23 |
24 | @end
25 |
26 | @implementation LeftViewController
27 |
28 | -(void)viewDidLoad{
29 | [super viewDidLoad];
30 | [self initData];
31 | [self initView];
32 | }
33 |
34 | -(void)initData{
35 | _menuArray = [NSArray arrayWithObjects:@"基础动画",@"关键帧动画",@"组动画",@"过渡动画",@"仿射变换",@"综合案例", nil];
36 | }
37 |
38 | -(void)initView{
39 | self.view.backgroundColor = [UIColor lightGrayColor];
40 |
41 | _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, SCREEN_HEIGHT-20) style:UITableViewStyleGrouped];
42 | _tableView.dataSource = self;
43 | _tableView.delegate = self;
44 | [self.view addSubview:_tableView];
45 | }
46 |
47 |
48 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
49 | return _menuArray.count;
50 | }
51 |
52 |
53 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
54 | static NSString *TABLE_VIEW_ID = @"table_view_id";
55 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TABLE_VIEW_ID];
56 | if (!cell) {
57 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TABLE_VIEW_ID];
58 | }
59 | cell.textLabel.text = [_menuArray objectAtIndex:indexPath.row];
60 |
61 | return cell;
62 | }
63 |
64 |
65 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
66 | return 0.01;
67 | }
68 |
69 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
70 | return 0.01;
71 | }
72 |
73 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
74 | SWRevealViewController *revealViewController = self.revealViewController;
75 | UIViewController *viewController;
76 |
77 | switch (indexPath.row) {
78 | case 0:
79 | viewController = [[BaseAnimationController alloc] init];
80 | break;
81 | case 1:
82 | viewController = [[KeyFrameAnimationController alloc] init];
83 | break;
84 | case 2:
85 | viewController = [[GroupAnimationController alloc] init];
86 | break;
87 | case 3:
88 | viewController = [[TransitionAnimationController alloc] init];
89 | break;
90 | case 4:
91 | viewController = [[AffineTransformController alloc] init];
92 | break;
93 | case 5:
94 | viewController = [[ComprehensiveCaseController alloc] init];
95 | break;
96 | default:
97 | break;
98 | }
99 | //调用pushFrontViewController进行页面切换
100 | [revealViewController pushFrontViewController:viewController animated:YES];
101 |
102 | }
103 |
104 | @end
105 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/MCFireworksButton/MCFireworksButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // MCFireworksButton.h
3 | // MCFireworksButton
4 | //
5 | // Created by Matthew Cheok on 17/3/14.
6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MCFireworksButton : UIButton
12 |
13 | @property (strong, nonatomic) UIImage *particleImage;
14 | @property (assign, nonatomic) CGFloat particleScale;
15 | @property (assign, nonatomic) CGFloat particleScaleRange;
16 |
17 | - (void)animate;
18 | - (void)popOutsideWithDuration:(NSTimeInterval)duration;
19 | - (void)popInsideWithDuration:(NSTimeInterval)duration;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/MCFireworksButton/MCFireworksButton.m:
--------------------------------------------------------------------------------
1 | //
2 | // MCFireworksButton.m
3 | // MCFireworksButton
4 | //
5 | // Created by Matthew Cheok on 17/3/14.
6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved.
7 | //
8 |
9 | #import "MCFireworksButton.h"
10 | #import "MCFireworksView.h"
11 |
12 | @interface MCFireworksButton ()
13 |
14 | @property (strong, nonatomic) MCFireworksView *fireworksView;
15 |
16 | @end
17 |
18 | @implementation MCFireworksButton
19 |
20 | - (void)setup {
21 | self.clipsToBounds = NO;
22 |
23 | _fireworksView = [[MCFireworksView alloc] init];
24 | [self insertSubview:_fireworksView atIndex:0];
25 | }
26 |
27 | - (id)initWithFrame:(CGRect)frame {
28 | self = [super initWithFrame:frame];
29 | if (self) {
30 | [self setup];
31 | }
32 | return self;
33 | }
34 |
35 | - (id)initWithCoder:(NSCoder *)aDecoder {
36 | self = [super initWithCoder:aDecoder];
37 | if (self) {
38 | [self setup];
39 | }
40 | return self;
41 | }
42 |
43 | - (void)layoutSubviews {
44 | [super layoutSubviews];
45 | self.fireworksView.frame = self.bounds;
46 |
47 | [self insertSubview:self.fireworksView atIndex:0];
48 | }
49 |
50 | #pragma mark - Methods
51 |
52 | - (void)animate {
53 | [self.fireworksView animate];
54 | }
55 |
56 | - (void)popOutsideWithDuration:(NSTimeInterval)duration {
57 | __weak typeof(self) weakSelf = self;
58 | self.transform = CGAffineTransformIdentity;
59 | [UIView animateKeyframesWithDuration:duration delay:0 options:0 animations: ^{
60 | [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1 / 3.0 animations: ^{
61 | typeof(self) strongSelf = weakSelf;
62 | strongSelf.transform = CGAffineTransformMakeScale(1.5, 1.5);
63 | }];
64 | [UIView addKeyframeWithRelativeStartTime:1/3.0 relativeDuration:1/3.0 animations: ^{
65 | typeof(self) strongSelf = weakSelf;
66 | strongSelf.transform = CGAffineTransformMakeScale(0.8, 0.8);
67 | }];
68 | [UIView addKeyframeWithRelativeStartTime:2/3.0 relativeDuration:1/3.0 animations: ^{
69 | typeof(self) strongSelf = weakSelf;
70 | strongSelf.transform = CGAffineTransformMakeScale(1.0, 1.0);
71 | }];
72 | } completion:nil];
73 | }
74 |
75 | - (void)popInsideWithDuration:(NSTimeInterval)duration {
76 | __weak typeof(self) weakSelf = self;
77 | self.transform = CGAffineTransformIdentity;
78 | [UIView animateKeyframesWithDuration:duration delay:0 options:0 animations: ^{
79 | [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1 / 2.0 animations: ^{
80 | typeof(self) strongSelf = weakSelf;
81 | strongSelf.transform = CGAffineTransformMakeScale(0.8, 0.8);
82 | }];
83 | [UIView addKeyframeWithRelativeStartTime:1/2.0 relativeDuration:1/2.0 animations: ^{
84 | typeof(self) strongSelf = weakSelf;
85 | strongSelf.transform = CGAffineTransformMakeScale(1.0, 1.0);
86 | }];
87 | } completion:nil];
88 | }
89 |
90 | #pragma mark - Properties
91 |
92 | - (UIImage *)particleImage {
93 | return self.fireworksView.particleImage;
94 | }
95 |
96 | - (void)setParticleImage:(UIImage *)particleImage {
97 | self.fireworksView.particleImage = particleImage;
98 | }
99 |
100 | - (CGFloat)particleScale {
101 | return self.fireworksView.particleScale;
102 | }
103 |
104 | - (void)setParticleScale:(CGFloat)particleScale {
105 | self.fireworksView.particleScale = particleScale;
106 | }
107 |
108 | - (CGFloat)particleScaleRange {
109 | return self.fireworksView.particleScaleRange;
110 | }
111 |
112 | - (void)setParticleScaleRange:(CGFloat)particleScaleRange {
113 | self.fireworksView.particleScaleRange = particleScaleRange;
114 | }
115 |
116 | @end
117 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/MCFireworksButton/MCFireworksView.h:
--------------------------------------------------------------------------------
1 | //
2 | // MCFireworksView.h
3 | // MCFireworksButton
4 | //
5 | // Created by Matthew Cheok on 17/3/14.
6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MCFireworksView : UIView
12 |
13 | @property (strong, nonatomic) UIImage *particleImage;
14 | @property (assign, nonatomic) CGFloat particleScale;
15 | @property (assign, nonatomic) CGFloat particleScaleRange;
16 |
17 | - (void)animate;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/MCFireworksButton/MCFireworksView.m:
--------------------------------------------------------------------------------
1 | //
2 | // MCFireworksView.m
3 | // MCFireworksButton
4 | //
5 | // Created by Matthew Cheok on 17/3/14.
6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved.
7 | //
8 |
9 | #import "MCFireworksView.h"
10 |
11 | @interface MCFireworksView ()
12 |
13 | @property (strong, nonatomic) NSArray *emitterCells;
14 | @property (strong, nonatomic) CAEmitterLayer *chargeLayer;
15 | @property (strong, nonatomic) CAEmitterLayer *explosionLayer;
16 |
17 | @end
18 |
19 | @implementation MCFireworksView
20 |
21 | - (void)setup {
22 | self.clipsToBounds = NO;
23 | self.userInteractionEnabled = NO;
24 |
25 | CAEmitterCell *explosionCell = [CAEmitterCell emitterCell];
26 | explosionCell.name = @"explosion";
27 | explosionCell.alphaRange = 0.20;
28 | explosionCell.alphaSpeed = -1.0;
29 |
30 | explosionCell.lifetime = 0.7;
31 | explosionCell.lifetimeRange = 0.3;
32 | explosionCell.birthRate = 0;
33 | explosionCell.velocity = 40.00;
34 | explosionCell.velocityRange = 10.00;
35 |
36 | _explosionLayer = [CAEmitterLayer layer];
37 | _explosionLayer.name = @"emitterLayer";
38 | _explosionLayer.emitterShape = kCAEmitterLayerCircle;
39 | _explosionLayer.emitterMode = kCAEmitterLayerOutline;
40 | _explosionLayer.emitterSize = CGSizeMake(25, 0);
41 | _explosionLayer.emitterCells = @[explosionCell];
42 | _explosionLayer.renderMode = kCAEmitterLayerOldestFirst;
43 | _explosionLayer.masksToBounds = NO;
44 | _explosionLayer.seed = 1366128504;
45 | [self.layer addSublayer:_explosionLayer];
46 |
47 | CAEmitterCell *chargeCell = [CAEmitterCell emitterCell];
48 | chargeCell.name = @"charge";
49 | chargeCell.alphaRange = 0.20;
50 | chargeCell.alphaSpeed = -1.0;
51 |
52 | chargeCell.lifetime = 0.3;
53 | chargeCell.lifetimeRange = 0.1;
54 | chargeCell.birthRate = 0;
55 | chargeCell.velocity = -40.0;
56 | chargeCell.velocityRange = 0.00;
57 |
58 | _chargeLayer = [CAEmitterLayer layer];
59 | _chargeLayer.name = @"emitterLayer";
60 | _chargeLayer.emitterShape = kCAEmitterLayerCircle;
61 | _chargeLayer.emitterMode = kCAEmitterLayerOutline;
62 | _chargeLayer.emitterSize = CGSizeMake(25, 0);
63 | _chargeLayer.emitterCells = @[chargeCell];
64 | _chargeLayer.renderMode = kCAEmitterLayerOldestFirst;
65 | _chargeLayer.masksToBounds = NO;
66 | _chargeLayer.seed = 1366128504;
67 | [self.layer addSublayer:_chargeLayer];
68 |
69 | self.emitterCells = @[chargeCell, explosionCell];
70 | }
71 |
72 | - (id)initWithFrame:(CGRect)frame {
73 | self = [super initWithFrame:frame];
74 | if (self) {
75 | [self setup];
76 | }
77 | return self;
78 | }
79 |
80 | - (id)initWithCoder:(NSCoder *)aDecoder {
81 | self = [super initWithCoder:aDecoder];
82 | if (self) {
83 | [self setup];
84 | }
85 | return self;
86 | }
87 |
88 | - (void)layoutSubviews {
89 | [super layoutSubviews];
90 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds));
91 | self.chargeLayer.emitterPosition = center;
92 | self.explosionLayer.emitterPosition = center;
93 | }
94 |
95 | #pragma mark - Methods
96 |
97 | - (void)animate {
98 | self.chargeLayer.beginTime = CACurrentMediaTime();
99 | [self.chargeLayer setValue:@80 forKeyPath:@"emitterCells.charge.birthRate"];
100 | [self performSelector:@selector(explode) withObject:nil afterDelay:0.2];
101 | }
102 |
103 | - (void)explode {
104 | [self.chargeLayer setValue:@0 forKeyPath:@"emitterCells.charge.birthRate"];
105 | self.explosionLayer.beginTime = CACurrentMediaTime();
106 | [self.explosionLayer setValue:@500 forKeyPath:@"emitterCells.explosion.birthRate"];
107 | [self performSelector:@selector(stop) withObject:nil afterDelay:0.1];
108 | }
109 |
110 | - (void)stop {
111 | [self.chargeLayer setValue:@0 forKeyPath:@"emitterCells.charge.birthRate"];
112 | [self.explosionLayer setValue:@0 forKeyPath:@"emitterCells.explosion.birthRate"];
113 | }
114 |
115 | #pragma mark - Properties
116 |
117 | - (void)setParticleImage:(UIImage *)particleImage {
118 | _particleImage = particleImage;
119 | for (CAEmitterCell *cell in self.emitterCells) {
120 | cell.contents = (id)[particleImage CGImage];
121 | }
122 | }
123 |
124 | - (void)setParticleScale:(CGFloat)particleScale {
125 | _particleScale = particleScale;
126 | for (CAEmitterCell *cell in self.emitterCells) {
127 | cell.scale = particleScale;
128 | }
129 | }
130 |
131 | - (void)setParticleScaleRange:(CGFloat)particleScaleRange {
132 | _particleScaleRange = particleScaleRange;
133 | for (CAEmitterCell *cell in self.emitterCells) {
134 | cell.scaleRange = particleScaleRange;
135 | }
136 | }
137 |
138 | @end
139 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/PrefixHeader.pch:
--------------------------------------------------------------------------------
1 | //
2 | // PrefixHeader.pch
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/14.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #ifndef _____PrefixHeader_pch
10 | #define _____PrefixHeader_pch
11 |
12 | // Include any system framework and library headers here that should be included in all compilation units.
13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
14 |
15 | #define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
16 | #define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/RightPage/RightViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // RightViewController.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface RightViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/RightPage/RightViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // RightViewController.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "RightViewController.h"
10 |
11 | @implementation RightViewController
12 |
13 | -(void)viewDidLoad{
14 | [super viewDidLoad];
15 | self.view.backgroundColor = [UIColor orangeColor];
16 |
17 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-100, 100, 200, 100)];
18 | label.text = @"右边侧滑栏";
19 | label.font = [UIFont systemFontOfSize:22];
20 | label.textAlignment = NSTextAlignmentCenter;
21 | [self.view addSubview:label];
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/SWRevealViewController/SWRevealViewController.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Copyright (c) 2013 Joan Lluch
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 furnished
10 | 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
21 | THE SOFTWARE.
22 |
23 | Early code inspired on a similar class by Philip Kluz (Philip.Kluz@zuui.org)
24 |
25 | */
26 |
27 | /*
28 |
29 | RELEASE NOTES
30 |
31 | Version 2.4.0 (Current Version)
32 |
33 | - Updated behaviour of appearance method calls on child controllers
34 | - Removes Xcode 6.3.1 warnings
35 |
36 | Version 2.3.0
37 |
38 | - StoryBoard initializing bug fix
39 | - Minor Code refactoring
40 |
41 | Version 2.2.0
42 |
43 | - State Restoration support.
44 | - Reverted panGestureRecognizer implementation to before v2.1.0 (works better).
45 | - New properties 'toggleAnimationType', 'springDampingRatio'. Default reveal animation is 'Spring'
46 | - New property 'frontViewShadowColor'
47 | - New properties 'clipsViewsToBounds' and '_extendedPointInsideHit'
48 | - New delegate methods for finer control of front view location in the overdraw area, as long as deprecation note on former delegate methods
49 | - Other minor changes that should not affect current implementations
50 |
51 | Version 2.1.0
52 |
53 | - Removed SWDirectionPanGestureRecognizer. Horizontal panning is filtered on the shouldBegin delegate. This is cleaner, I hope it does not break previous funcionality
54 | - Took a cleaner approach to storyboard support. SWRevealViewControllerSegue is now deprecated and you should use SWRevealViewControllerSegueSetController and SWRevealViewControllerSeguePushController instead.
55 | - A minor change on the autoresizingMask of the internal views to fix a glitch on iOS8. This should not affect iOS7
56 |
57 | Version 2.0.2
58 |
59 | - Added new delegates for better control of gesture recognizers
60 |
61 | Version 2.0.1
62 |
63 | - Fix: draggableBorderWidth now correctly handles the cases where one of the rear controllers is not provided
64 | - Fix: the shadow related properties are now granted at any time after view load, not just after initialization.
65 |
66 | Version 2.0.0
67 |
68 | - Dropped support for iOS6 and earlier. This version will only work on iOS7
69 |
70 | - The method setFrontViewController:animated: does not longer perform a full reveal animation. Instead it just replaces the frontViewController in
71 | its current position. Use the new pushFrontViewController:animated: method to perform a replacement of the front controlles with reveal animation
72 | as in the previous version
73 |
74 | IMPORTANT: You must replace all calls to setFrontViewController:animated by calls to pushFrontViewController:animated to prevent breaking
75 | functionality on existing projects.
76 |
77 | - Added support for animated replacement of child controllers: setRearViewController, setFrontViewController, setRightViewController now have animated versions.
78 |
79 | - The new 'replaceViewAnimationDuration' property sets the default duration of child viewController replacement.
80 |
81 | - Added the following new delegate methods
82 | revealController:willAddViewController:forOperation:animated:
83 | revealController:didAddViewController:forOperation:animated:
84 |
85 | - The class also supports custom UIViewControllerAnimatedTransitioning related with the replacement of child viewControllers.
86 | You can implement the following new delegate method: revealController:animationControllerForOperation:fromViewController:toViewController:
87 | and provide an object conforming to UIViewControllerAnimatedTransitioning to implement custom animations.
88 |
89 | Version 1.1.3
90 |
91 | - Reverted the supportedInterfaceOrientations to the default behavior. This is consistent with Apple provided controllers
92 |
93 | - The presentFrontViewHierarchically now dynamically takes into account the smaller header height of bars on iPhone landscape orientation
94 |
95 | Version 1.1.2
96 |
97 | - The status bar style and appearance are now handled in sync with the class animations.
98 | You can implement the methods preferredStatusBarStyle and prefersStatusBarHidden on your child controllers to define the desired appearance
99 |
100 | - The loadView method now calls a method, loadStoryboardControllers, just for the purpose of loading child controllers from a storyboard.
101 | You can override this method and remove the @try @catch statements if you want the debugger not to stop at them in case you have set an exception breakpoint.
102 |
103 | Version 1.1.1
104 |
105 | - You can now get a tapGestureRecognizer from the class. See the tapGestureRecognizer method for more information.
106 |
107 | - Both the panGestureRecognizer and the tapGestureRecognizer are now attached to the revealViewController's front content view
108 | by default, so they will start working just by calling their access methods even if you do not attach them to any of your views.
109 | This enables you to dissable interactions on your views -for example based on position- without breaking normal gesture behavior.
110 |
111 | - Corrected a bug that caused a crash on iOS6 and earlier.
112 |
113 | Version 1.1.0
114 |
115 | - The method setFrontViewController:animated now performs the correct animations both for left and right controllers.
116 |
117 | - The class now automatically handles the status bar appearance depending on the currently shown child controller.
118 |
119 | Version 1.0.8
120 |
121 | - Support for constant width frontView by setting a negative value to reveal widths. See properties rearViewRevealWidth and rightViewRevealWidth
122 |
123 | - Support for draggableBorderWidth. See property of the same name.
124 |
125 | - The Pan gesture recongnizer can be disabled by implementing the following delegate method and returning NO
126 | revealControllerPanGestureShouldBegin:
127 |
128 | - Added the ability to track pan gesture reveal progress through the following new delegate methods
129 | revealController:panGestureBeganFromLocation:progress:
130 | revealController:panGestureMovedToLocation:progress:
131 | revealController:panGestureEndedToLocation:progress:
132 |
133 | Previous Versions
134 |
135 | - No release notes were updated for previous versions.
136 |
137 | */
138 |
139 |
140 | #import
141 |
142 | @class SWRevealViewController;
143 | @protocol SWRevealViewControllerDelegate;
144 |
145 | #pragma mark - SWRevealViewController Class
146 |
147 | // Enum values for setFrontViewPosition:animated:
148 | typedef NS_ENUM( NSInteger, FrontViewPosition)
149 | {
150 | // Front controller is removed from view. Animated transitioning from this state will cause the same
151 | // effect than animating from FrontViewPositionLeftSideMost. Use this instead of FrontViewPositionLeftSideMost when
152 | // you want to remove the front view controller view from the view hierarchy.
153 | FrontViewPositionLeftSideMostRemoved,
154 |
155 | // Left most position, front view is presented left-offseted by rightViewRevealWidth+rigthViewRevealOverdraw
156 | FrontViewPositionLeftSideMost,
157 |
158 | // Left position, front view is presented left-offseted by rightViewRevealWidth
159 | FrontViewPositionLeftSide,
160 |
161 | // Center position, rear view is hidden behind front controller
162 | FrontViewPositionLeft,
163 |
164 | // Right possition, front view is presented right-offseted by rearViewRevealWidth
165 | FrontViewPositionRight,
166 |
167 | // Right most possition, front view is presented right-offseted by rearViewRevealWidth+rearViewRevealOverdraw
168 | FrontViewPositionRightMost,
169 |
170 | // Front controller is removed from view. Animated transitioning from this state will cause the same
171 | // effect than animating from FrontViewPositionRightMost. Use this instead of FrontViewPositionRightMost when
172 | // you intent to remove the front controller view from the view hierarchy.
173 | FrontViewPositionRightMostRemoved,
174 |
175 | };
176 |
177 | // Enum values for toggleAnimationType
178 | typedef NS_ENUM(NSInteger, SWRevealToggleAnimationType)
179 | {
180 | SWRevealToggleAnimationTypeSpring, // <- produces a spring based animation
181 | SWRevealToggleAnimationTypeEaseOut, // <- produces an ease out curve animation
182 | };
183 |
184 |
185 | @interface SWRevealViewController : UIViewController
186 |
187 | /* Basic API */
188 |
189 | // Object instance init and rear view setting
190 | - (id)initWithRearViewController:(UIViewController *)rearViewController frontViewController:(UIViewController *)frontViewController;
191 |
192 | // Rear view controller, can be nil if not used
193 | @property (nonatomic) UIViewController *rearViewController;
194 | - (void)setRearViewController:(UIViewController *)rearViewController animated:(BOOL)animated;
195 |
196 | // Optional right view controller, can be nil if not used
197 | @property (nonatomic) UIViewController *rightViewController;
198 | - (void)setRightViewController:(UIViewController *)rightViewController animated:(BOOL)animated;
199 |
200 | // Front view controller, can be nil on initialization but must be supplied by the time the view is loaded
201 | @property (nonatomic) UIViewController *frontViewController;
202 | - (void)setFrontViewController:(UIViewController *)frontViewController animated:(BOOL)animated;
203 |
204 | // Sets the frontViewController using a default set of chained animations consisting on moving the
205 | // presented frontViewController to the right most possition, replacing it, and moving it back to the left position
206 | - (void)pushFrontViewController:(UIViewController *)frontViewController animated:(BOOL)animated;
207 |
208 | // Sets the frontViewController position. You can call the animated version several times with different
209 | // positions to obtain a set of animations that will be performed in order one after the other.
210 | @property (nonatomic) FrontViewPosition frontViewPosition;
211 | - (void)setFrontViewPosition:(FrontViewPosition)frontViewPosition animated:(BOOL)animated;
212 |
213 | // The following methods are meant to be directly connected to the action method of a button
214 | // to perform user triggered postion change of the controller views. This is ussually added to a
215 | // button on top left or right of the frontViewController
216 | - (IBAction)revealToggle:(id)sender;
217 | - (IBAction)rightRevealToggle:(id)sender; // <-- simetric implementation of the above for the rightViewController
218 |
219 | // Toogles the current state of the front controller between Left or Right and fully visible
220 | // Use setFrontViewPosition to set a particular position
221 | - (void)revealToggleAnimated:(BOOL)animated;
222 | - (void)rightRevealToggleAnimated:(BOOL)animated; // <-- simetric implementation of the above for the rightViewController
223 |
224 | // The following method will provide a panGestureRecognizer suitable to be added to any view
225 | // in order to perform usual drag and swipe gestures to reveal the rear views. This is usually added to the top bar
226 | // of a front controller, but it can be added to your frontViewController view or to the reveal controller view to provide full screen panning.
227 | // By default, the panGestureRecognizer is added to the view containing the front controller view. To keep this default behavior
228 | // you still need to call this method, just don't add it to any of your views. The default setup allows you to dissable
229 | // user interactions on your controller views without affecting the recognizer.
230 | - (UIPanGestureRecognizer*)panGestureRecognizer;
231 |
232 | // The following method will provide a tapGestureRecognizer suitable to be added to any view on the frontController
233 | // for concealing the rear views. By default no tap recognizer is created or added to any view, however if you call this method after
234 | // the controller's view has been loaded the recognizer is added to the reveal controller's front container view.
235 | // Thus, you can disable user interactions on your frontViewController view without affecting the tap recognizer.
236 | - (UITapGestureRecognizer*)tapGestureRecognizer;
237 |
238 | /* The following properties are provided for further customization, they are set to default values on initialization,
239 | you do not generally have to set them */
240 |
241 | // Defines how much of the rear or right view is shown, default is 260.
242 | // Negative values indicate that the reveal width should be computed by substracting the full front view width,
243 | // so the revealed frontView width is kept constant when bounds change as opposed to the rear or right width.
244 | @property (nonatomic) CGFloat rearViewRevealWidth;
245 | @property (nonatomic) CGFloat rightViewRevealWidth; // <-- simetric implementation of the above for the rightViewController
246 |
247 | // Defines how much of an overdraw can occur when dragging further than 'rearViewRevealWidth', default is 60.
248 | @property (nonatomic) CGFloat rearViewRevealOverdraw;
249 | @property (nonatomic) CGFloat rightViewRevealOverdraw; // <-- simetric implementation of the above for the rightViewController
250 |
251 | // Defines how much displacement is applied to the rear view when animating or dragging the front view, default is 40.
252 | @property (nonatomic) CGFloat rearViewRevealDisplacement;
253 | @property (nonatomic) CGFloat rightViewRevealDisplacement; // <-- simetric implementation of the above for the rightViewController
254 |
255 | // Defines a width on the border of the view attached to the panGesturRecognizer where the gesture is allowed,
256 | // default is 0 which means no restriction.
257 | @property (nonatomic) CGFloat draggableBorderWidth;
258 |
259 | // If YES (the default) the controller will bounce to the Left position when dragging further than 'rearViewRevealWidth'
260 | @property (nonatomic) BOOL bounceBackOnOverdraw;
261 | @property (nonatomic) BOOL bounceBackOnLeftOverdraw; // <-- simetric implementation of the above for the rightViewController
262 |
263 | // If YES (default is NO) the controller will allow permanent dragging up to the rightMostPosition
264 | @property (nonatomic) BOOL stableDragOnOverdraw;
265 | @property (nonatomic) BOOL stableDragOnLeftOverdraw; // <-- simetric implementation of the above for the rightViewController
266 |
267 | // If YES (default is NO) the front view controller will be ofsseted vertically by the height of a navigation bar.
268 | // Use this on iOS7 when you add an instance of RevealViewController as a child of a UINavigationController (or another SWRevealViewController)
269 | // and you want the front view controller to be presented below the navigation bar of its UINavigationController grand parent.
270 | // The rearViewController will still appear full size and blurred behind the navigation bar of its UINavigationController grand parent
271 | @property (nonatomic) BOOL presentFrontViewHierarchically;
272 |
273 | // Velocity required for the controller to toggle its state based on a swipe movement, default is 250
274 | @property (nonatomic) CGFloat quickFlickVelocity;
275 |
276 | // Duration for the revealToggle animation, default is 0.25
277 | @property (nonatomic) NSTimeInterval toggleAnimationDuration;
278 |
279 | // Animation type, default is SWRevealToggleAnimationTypeSpring
280 | @property (nonatomic) SWRevealToggleAnimationType toggleAnimationType;
281 |
282 | // When animation type is SWRevealToggleAnimationTypeSpring determines the damping ratio, default is 1
283 | @property (nonatomic) CGFloat springDampingRatio;
284 |
285 | // Duration for animated replacement of view controllers
286 | @property (nonatomic) NSTimeInterval replaceViewAnimationDuration;
287 |
288 | // Defines the radius of the front view's shadow, default is 2.5f
289 | @property (nonatomic) CGFloat frontViewShadowRadius;
290 |
291 | // Defines the radius of the front view's shadow offset default is {0.0f,2.5f}
292 | @property (nonatomic) CGSize frontViewShadowOffset;
293 |
294 | // Defines the front view's shadow opacity, default is 1.0f
295 | @property (nonatomic) CGFloat frontViewShadowOpacity;
296 |
297 | // Defines the front view's shadow color, default is blackColor
298 | @property (nonatomic) UIColor *frontViewShadowColor;
299 |
300 | // Defines whether the controller should clip subviews to its view bounds. Default is NO.
301 | // Set this to YES when you are presenting this controller as a non full-screen child of a
302 | // custom container controller which does not explicitly clips its subviews.
303 | @property (nonatomic) BOOL clipsViewsToBounds;
304 |
305 | // Defines whether your views clicable area extends beyond the bounds of this controller. Default is NO.
306 | // Set this to YES if you are presenting this controller as a non full-screen child of a custom container and you are not
307 | // clipping your front view to this controller bounds.
308 | @property (nonatomic) BOOL extendsPointInsideHit;
309 |
310 | /* The class properly handles all the relevant calls to appearance methods on the contained controllers.
311 | Moreover you can assign a delegate to let the class inform you on positions and animation activity */
312 |
313 | // Delegate
314 | @property (nonatomic,weak) id delegate;
315 |
316 | @end
317 |
318 |
319 | #pragma mark - SWRevealViewControllerDelegate Protocol
320 |
321 | typedef enum
322 | {
323 | SWRevealControllerOperationNone,
324 | SWRevealControllerOperationReplaceRearController,
325 | SWRevealControllerOperationReplaceFrontController,
326 | SWRevealControllerOperationReplaceRightController,
327 |
328 | } SWRevealControllerOperation;
329 |
330 |
331 | @protocol SWRevealViewControllerDelegate
332 |
333 | @optional
334 |
335 | // The following delegate methods will be called before and after the front view moves to a position
336 | - (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position;
337 | - (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position;
338 |
339 | // This will be called inside the reveal animation, thus you can use it to place your own code that will be animated in sync
340 | - (void)revealController:(SWRevealViewController *)revealController animateToPosition:(FrontViewPosition)position;
341 |
342 | // Implement this to return NO when you want the pan gesture recognizer to be ignored
343 | - (BOOL)revealControllerPanGestureShouldBegin:(SWRevealViewController *)revealController;
344 |
345 | // Implement this to return NO when you want the tap gesture recognizer to be ignored
346 | - (BOOL)revealControllerTapGestureShouldBegin:(SWRevealViewController *)revealController;
347 |
348 | // Implement this to return YES if you want other gesture recognizer to share touch events with the pan gesture
349 | - (BOOL)revealController:(SWRevealViewController *)revealController
350 | panGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
351 |
352 | // Implement this to return YES if you want other gesture recognizer to share touch events with the tap gesture
353 | - (BOOL)revealController:(SWRevealViewController *)revealController
354 | tapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
355 |
356 | // Called when the gestureRecognizer began and ended
357 | - (void)revealControllerPanGestureBegan:(SWRevealViewController *)revealController;
358 | - (void)revealControllerPanGestureEnded:(SWRevealViewController *)revealController;
359 |
360 | // The following methods provide a means to track the evolution of the gesture recognizer.
361 | // The 'location' parameter is the X origin coordinate of the front view as the user drags it
362 | // The 'progress' parameter is a number ranging from 0 to 1 indicating the front view location relative to the
363 | // rearRevealWidth or rightRevealWidth. 1 is fully revealed, dragging ocurring in the overDraw region will result in values above 1.
364 | // The 'overProgress' parameter is a number ranging from 0 to 1 indicating the front view location relative to the
365 | // overdraw region. 0 is fully revealed, 1 is fully overdrawn. Negative values occur inside the normal reveal region
366 | - (void)revealController:(SWRevealViewController *)revealController panGestureBeganFromLocation:(CGFloat)location progress:(CGFloat)progress overProgress:(CGFloat)overProgress;
367 | - (void)revealController:(SWRevealViewController *)revealController panGestureMovedToLocation:(CGFloat)location progress:(CGFloat)progress overProgress:(CGFloat)overProgress;
368 | - (void)revealController:(SWRevealViewController *)revealController panGestureEndedToLocation:(CGFloat)location progress:(CGFloat)progress overProgress:(CGFloat)overProgress;
369 |
370 | // Notification of child controller replacement
371 | - (void)revealController:(SWRevealViewController *)revealController willAddViewController:(UIViewController *)viewController
372 | forOperation:(SWRevealControllerOperation)operation animated:(BOOL)animated;
373 | - (void)revealController:(SWRevealViewController *)revealController didAddViewController:(UIViewController *)viewController
374 | forOperation:(SWRevealControllerOperation)operation animated:(BOOL)animated;
375 |
376 | // Support for custom transition animations while replacing child controllers. If implemented, it will be fired in response
377 | // to calls to 'setXXViewController' methods
378 | - (id)revealController:(SWRevealViewController *)revealController
379 | animationControllerForOperation:(SWRevealControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC;
380 |
381 | // DEPRECATED - The following delegate methods will be removed some time in the future
382 | - (void)revealController:(SWRevealViewController *)revealController panGestureBeganFromLocation:(CGFloat)location progress:(CGFloat)progress; // (DEPRECATED)
383 | - (void)revealController:(SWRevealViewController *)revealController panGestureMovedToLocation:(CGFloat)location progress:(CGFloat)progress; // (DEPRECATED)
384 | - (void)revealController:(SWRevealViewController *)revealController panGestureEndedToLocation:(CGFloat)location progress:(CGFloat)progress; // (DEPRECATED)
385 | @end
386 |
387 |
388 | #pragma mark - UIViewController(SWRevealViewController) Category
389 |
390 | // A category of UIViewController to let childViewControllers easily access their parent SWRevealViewController
391 | @interface UIViewController(SWRevealViewController)
392 |
393 | - (SWRevealViewController*)revealViewController;
394 |
395 | @end
396 |
397 |
398 | #pragma mark - StoryBoard support Classes
399 |
400 | /* StoryBoard support */
401 |
402 | // String identifiers to be applied to segues on a storyboard
403 | extern NSString* const SWSegueRearIdentifier; // this is @"sw_rear"
404 | extern NSString* const SWSegueFrontIdentifier; // this is @"sw_front"
405 | extern NSString* const SWSegueRightIdentifier; // this is @"sw_right"
406 |
407 | /* This will allow the class to be defined on a storyboard */
408 |
409 | // Use this along with one of the above segue identifiers to segue to the initial state
410 | @interface SWRevealViewControllerSegueSetController : UIStoryboardSegue
411 | @end
412 |
413 | // Use this to push a view controller
414 | @interface SWRevealViewControllerSeguePushController : UIStoryboardSegue
415 | @end
416 |
417 |
418 | //#pragma mark - SWRevealViewControllerSegue (DEPRECATED)
419 | //
420 | //@interface SWRevealViewControllerSegue : UIStoryboardSegue // DEPRECATED: USE SWRevealViewControllerSegueSetController instead
421 | //@property (nonatomic, strong) void(^performBlock)( SWRevealViewControllerSegue* segue, UIViewController* svc, UIViewController* dvc );
422 | //@end
423 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/Sounds/bloom.caf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/Sounds/bloom.caf
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/Sounds/fold.caf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/Sounds/fold.caf
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/Sounds/selected.caf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/Sounds/selected.caf
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 |
21 | }
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/Like-Blue@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/Like-Blue@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/Like@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/Like@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/Sparkle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/Sparkle.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-button-input-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-button-input-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-button-input@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-button-input@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-button-tab-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-button-tab-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-button-tab@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-button-tab@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-button-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-button-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-button@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-button@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-camera-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-camera-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-camera@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-camera@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-music-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-music-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-music@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-music@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-place-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-place-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-place@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-place@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-sleep-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-sleep-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-sleep@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-sleep@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-thought-highlighted@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-thought-highlighted@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/image/chooser-moment-icon-thought@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/IOSAnimationDemo/6ed1fc6af04b735ff4d4213d39e92fb6a333e588/侧滑菜单/侧滑菜单/image/chooser-moment-icon-thought@2x.png
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // 侧滑菜单
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. 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 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | alibaba.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/侧滑菜单/侧滑菜单Tests/____Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // ____Tests.m
3 | // 侧滑菜单Tests
4 | //
5 | // Created by yixiang on 15/7/13.
6 | // Copyright (c) 2015年 yixiang. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface ____Tests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation ____Tests
17 |
18 | - (void)setUp {
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 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------