├── GIF ├── step1.gif ├── step2.gif ├── step3.gif ├── step4.gif ├── step5.gif ├── step6Fail.gif ├── step7Fail.gif ├── step6Success.gif ├── oneLoadingAnimation.gif └── originLoadingAnimation.gif ├── OneLoadingAnimationStep1 ├── OneLoadingAnimationStep1.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── OneLoadingAnimationStep1 │ ├── ViewController.h │ ├── Src │ └── OneLoadingAnimation │ │ ├── OneLoadingAnimationView.h │ │ ├── ArcToCircleLayer.h │ │ ├── ArcToCircleLayer.m │ │ └── OneLoadingAnimationView.m │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ └── AppDelegate.m ├── OneLoadingAnimationStep2 ├── OneLoadingAnimationStep2.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── OneLoadingAnimationStep2 │ ├── ViewController.h │ ├── Src │ └── OneLoadingAnimation │ │ ├── OneLoadingAnimationView.h │ │ ├── ArcToCircleLayer.h │ │ ├── ArcToCircleLayer.m │ │ └── OneLoadingAnimationView.m │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ └── AppDelegate.m ├── OneLoadingAnimationStep3 ├── OneLoadingAnimationStep3.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── OneLoadingAnimationStep3 │ ├── ViewController.h │ ├── Src │ └── OneLoadingAnimation │ │ ├── OneLoadingAnimationView.h │ │ ├── ArcToCircleLayer.h │ │ ├── ArcToCircleLayer.m │ │ └── OneLoadingAnimationView.m │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ └── AppDelegate.m ├── OneLoadingAnimationStep4 ├── OneLoadingAnimationStep4.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── OneLoadingAnimationStep4 │ ├── ViewController.h │ ├── Src │ └── OneLoadingAnimation │ │ ├── OneLoadingAnimationView.h │ │ ├── ArcToCircleLayer.h │ │ ├── ArcToCircleLayer.m │ │ └── OneLoadingAnimationView.m │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ └── AppDelegate.m ├── OneLoadingAnimationStep5 ├── OneLoadingAnimationStep5.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj └── OneLoadingAnimationStep5 │ ├── ViewController.h │ ├── Src │ └── OneLoadingAnimation │ │ ├── OneLoadingAnimationView.h │ │ ├── ArcToCircleLayer.h │ │ └── ArcToCircleLayer.m │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ └── AppDelegate.m ├── OneLoadingAnimationComplete ├── OneLoadingAnimationComplete.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── OneLoadingAnimationComplete │ ├── ViewController.h │ ├── Src │ └── OneLoadingAnimation │ │ ├── OneLoadingAnimationView.h │ │ ├── ArcToCircleLayer.h │ │ └── ArcToCircleLayer.m │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ └── AppDelegate.m ├── OneLoadingAnimationStep1Another ├── OneLoadingAnimationStep1Another.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── OneLoadingAnimationStep1Another │ ├── ViewController.h │ ├── Src │ └── OneLoadingAnimation │ │ ├── OneLoadingAnimationView.h │ │ ├── ArcToCircleLayer.h │ │ ├── ArcToCircleLayer.m │ │ └── OneLoadingAnimationView.m │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ └── AppDelegate.m ├── OneLoadingAnimationCompleteSwift ├── OneLoadingAnimationCompleteSwift.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj └── OneLoadingAnimationCompleteSwift │ ├── ViewController.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── AppDelegate.swift │ └── Src │ └── OneLoadingAnimation │ └── ArcToCircleLayer.swift ├── README.md └── .gitignore /GIF/step1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step1.gif -------------------------------------------------------------------------------- /GIF/step2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step2.gif -------------------------------------------------------------------------------- /GIF/step3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step3.gif -------------------------------------------------------------------------------- /GIF/step4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step4.gif -------------------------------------------------------------------------------- /GIF/step5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step5.gif -------------------------------------------------------------------------------- /GIF/step6Fail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step6Fail.gif -------------------------------------------------------------------------------- /GIF/step7Fail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step7Fail.gif -------------------------------------------------------------------------------- /GIF/step6Success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/step6Success.gif -------------------------------------------------------------------------------- /GIF/oneLoadingAnimation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/oneLoadingAnimation.gif -------------------------------------------------------------------------------- /GIF/originLoadingAnimation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/OneLoadingAnimation/master/GIF/originLoadingAnimation.gif -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OneLoadingAnimationStep2 4 | // 5 | // Created by thatsoul on 15/11/21. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Src/OneLoadingAnimation/OneLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OneLoadingAnimationView : UIView 12 | - (void)startAnimation; 13 | @end 14 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/Src/OneLoadingAnimation/OneLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OneLoadingAnimationView : UIView 12 | - (void)startAnimation; 13 | @end 14 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/Src/OneLoadingAnimation/OneLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OneLoadingAnimationView : UIView 12 | - (void)startAnimation; 13 | @end 14 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/Src/OneLoadingAnimation/OneLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OneLoadingAnimationView : UIView 12 | - (void)startAnimation; 13 | @end 14 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/Src/OneLoadingAnimation/OneLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OneLoadingAnimationView : UIView 12 | - (void)startAnimation; 13 | @end 14 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Src/OneLoadingAnimation/OneLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OneLoadingAnimationView : UIView 12 | - (void)startAnimation; 13 | @end 14 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OneLoadingAnimationStep2 4 | // 5 | // Created by thatsoul on 15/11/21. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OneLoadingAnimationStep4 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OneLoadingAnimationStep5 4 | // 5 | // Created by thatsoul on 15/12/1. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/Src/OneLoadingAnimation/OneLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OneLoadingAnimationView : UIView 12 | - (void)startSuccess; 13 | - (void)startFail; 14 | @end 15 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OneLoadingAnimationComplete 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Src/OneLoadingAnimation/ArcToCircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ArcToCircleLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @end 15 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OneLoadingAnimationStep1Another 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/Src/OneLoadingAnimation/ArcToCircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ArcToCircleLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @end 15 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/Src/OneLoadingAnimation/ArcToCircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ArcToCircleLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @end 15 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Src/OneLoadingAnimation/ArcToCircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ArcToCircleLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @end 15 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OneLoadingAnimationStep2 4 | // 5 | // Created by thatsoul on 15/11/21. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OneLoadingAnimationStep4 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OneLoadingAnimationStep5 4 | // 5 | // Created by thatsoul on 15/12/1. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OneLoadingAnimationComplete 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OneLoadingAnimationStep1Another 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. 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 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/Src/OneLoadingAnimation/ArcToCircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ArcToCircleLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @property (nonatomic) UIColor *color; 15 | @property (nonatomic) CGFloat lineWidth; 16 | @end 17 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/Src/OneLoadingAnimation/ArcToCircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ArcToCircleLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @property (nonatomic) UIColor *color; 15 | @property (nonatomic) CGFloat lineWidth; 16 | @end 17 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/Src/OneLoadingAnimation/ArcToCircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ArcToCircleLayer : CALayer 13 | @property (nonatomic) CGFloat progress; 14 | @property (nonatomic) UIColor *color; 15 | @property (nonatomic) CGFloat lineWidth; 16 | @end 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 一款Loading动画的实现思路 2 | 3 | #### 这是原版动画 4 | ![](http://upload-images.jianshu.io/upload_images/1013170-f4ff25b49b577aee.gif?imageMogr2/auto-orient/strip) 5 | 6 | #### 这是我简化后的实现 7 | ![](http://upload-images.jianshu.io/upload_images/1013170-91389ecfed05069b.gif?imageMogr2/auto-orient/strip) 8 | 9 | #### 实现思路 10 | - [一款Loading动画的实现思路(一)](http://www.jianshu.com/p/1c6a2de68753) 11 | - [一款Loading动画的实现思路(二)](http://www.jianshu.com/p/0dac1208a7ad) 12 | - [一款Loading动画的实现思路(三)](http://www.jianshu.com/p/56448d3d3596) 13 | - [一款Loading动画的实现思路(四·完结篇)](http://www.jianshu.com/p/41f277682c91) 14 | 15 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OneLoadingAnimationStep2 4 | // 5 | // Created by thatsoul on 15/11/21. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OneLoadingAnimationView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet OneLoadingAnimationView *animationView; 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | #pragma mark - user event 29 | - (IBAction)onTapStartAnimation:(id)sender { 30 | [self.animationView startAnimation]; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OneLoadingAnimationView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet OneLoadingAnimationView *animationView; 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | #pragma mark - user event 29 | - (IBAction)onTapStartAnimation:(id)sender { 30 | [self.animationView startAnimation]; 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OneLoadingAnimationView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet OneLoadingAnimationView *animationView; 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | #pragma mark - user event 30 | - (IBAction)onTapStartAnimation:(id)sender { 31 | [self.animationView startAnimation]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OneLoadingAnimationView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet OneLoadingAnimationView *animationView; 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | #pragma mark - user event 30 | - (IBAction)onTapStartAnimation:(id)sender { 31 | [self.animationView startAnimation]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OneLoadingAnimationView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet OneLoadingAnimationView *animationView; 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | #pragma mark - user event 30 | - (IBAction)onTapStartAnimation:(id)sender { 31 | [self.animationView startAnimation]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OneLoadingAnimationView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet OneLoadingAnimationView *animationView; 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | #pragma mark - user event 29 | - (IBAction)onTapStartAnimation:(id)sender { 30 | [self.animationView startAnimation]; 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // OneLoadingAnimationCompleteSwift 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | // MARK: - property 13 | @IBOutlet weak var animationView: OneLoadingAnimationView! 14 | 15 | // MARK: - life cycle 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | // Do any additional setup after loading the view, typically from a nib. 19 | self.view.backgroundColor = UIColor(red: 0xf0/255.0, green: 0xf4/255.0, blue: 0xf5/255.0, alpha: 1.0) 20 | } 21 | 22 | // MARK: - user event 23 | @IBAction func onTapStart(sender: AnyObject) { 24 | self.animationView.startSuccess() 25 | } 26 | @IBAction func onTapFail(sender: AnyObject) { 27 | self.animationView.startFail() 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OneLoadingAnimationView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet OneLoadingAnimationView *animationView; 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | self.view.backgroundColor = [UIColor colorWithRed:0xf0/255.0 green:0xf4/255.0 blue:0xf5/255.0 alpha:1.0]; 23 | } 24 | 25 | - (void)didReceiveMemoryWarning { 26 | [super didReceiveMemoryWarning]; 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | #pragma mark - user event 31 | - (IBAction)onTapSuccessAnimation:(id)sender { 32 | [self.animationView startSuccess]; 33 | } 34 | 35 | - (IBAction)onTapFailAnimation:(id)sender { 36 | [self.animationView startFail]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Src/OneLoadingAnimation/ArcToCircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ArcToCircleLayer.h" 10 | 11 | static CGFloat const kLineWidth = 6; 12 | 13 | @implementation ArcToCircleLayer 14 | 15 | @dynamic progress; 16 | 17 | + (BOOL)needsDisplayForKey:(NSString *)key { 18 | if ([key isEqualToString:@"progress"]) { 19 | return YES; 20 | } 21 | 22 | return [super needsDisplayForKey:key]; 23 | } 24 | 25 | - (void)drawInContext:(CGContextRef)ctx { 26 | UIBezierPath *path = [UIBezierPath bezierPath]; 27 | 28 | CGFloat radius = MIN(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)) / 2 - kLineWidth / 2; 29 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 30 | 31 | // O 32 | CGFloat originStart = M_PI * 7 / 2; 33 | CGFloat originEnd = M_PI * 2; 34 | CGFloat currentOrigin = originStart - (originStart - originEnd) * self.progress; 35 | 36 | // D 37 | CGFloat destStart = M_PI * 3; 38 | CGFloat destEnd = 0; 39 | CGFloat currentDest = destStart - (destStart - destEnd) * self.progress; 40 | 41 | [path addArcWithCenter:center radius:radius startAngle: currentOrigin endAngle:currentDest clockwise:NO]; 42 | CGContextAddPath(ctx, path.CGPath); 43 | CGContextSetLineWidth(ctx, kLineWidth); 44 | CGContextSetStrokeColorWithColor(ctx, [UIColor blueColor].CGColor); 45 | CGContextStrokePath(ctx); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/Src/OneLoadingAnimation/ArcToCircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ArcToCircleLayer.h" 10 | 11 | static CGFloat const kLineWidth = 6; 12 | 13 | @implementation ArcToCircleLayer 14 | 15 | @dynamic progress; 16 | 17 | + (BOOL)needsDisplayForKey:(NSString *)key { 18 | if ([key isEqualToString:@"progress"]) { 19 | return YES; 20 | } 21 | 22 | return [super needsDisplayForKey:key]; 23 | } 24 | 25 | - (void)drawInContext:(CGContextRef)ctx { 26 | UIBezierPath *path = [UIBezierPath bezierPath]; 27 | 28 | CGFloat radius = MIN(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)) / 2 - kLineWidth / 2; 29 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 30 | 31 | // O 32 | CGFloat originStart = M_PI * 7 / 2; 33 | CGFloat originEnd = M_PI * 2; 34 | CGFloat currentOrigin = originStart - (originStart - originEnd) * self.progress; 35 | 36 | // D 37 | CGFloat destStart = M_PI * 3; 38 | CGFloat destEnd = 0; 39 | CGFloat currentDest = destStart - (destStart - destEnd) * self.progress; 40 | 41 | [path addArcWithCenter:center radius:radius startAngle: currentOrigin endAngle:currentDest clockwise:NO]; 42 | CGContextAddPath(ctx, path.CGPath); 43 | CGContextSetLineWidth(ctx, kLineWidth); 44 | CGContextSetStrokeColorWithColor(ctx, [UIColor lightGrayColor].CGColor); 45 | CGContextStrokePath(ctx); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/Src/OneLoadingAnimation/ArcToCircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ArcToCircleLayer.h" 10 | 11 | static CGFloat const kLineWidth = 6; 12 | 13 | @implementation ArcToCircleLayer 14 | 15 | @dynamic progress; 16 | 17 | + (BOOL)needsDisplayForKey:(NSString *)key { 18 | if ([key isEqualToString:@"progress"]) { 19 | return YES; 20 | } 21 | 22 | return [super needsDisplayForKey:key]; 23 | } 24 | 25 | - (void)drawInContext:(CGContextRef)ctx { 26 | UIBezierPath *path = [UIBezierPath bezierPath]; 27 | 28 | CGFloat radius = MIN(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)) / 2 - kLineWidth / 2; 29 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 30 | 31 | // O 32 | CGFloat originStart = M_PI * 7 / 2; 33 | CGFloat originEnd = M_PI * 2; 34 | CGFloat currentOrigin = originStart - (originStart - originEnd) * self.progress; 35 | 36 | // D 37 | CGFloat destStart = M_PI * 3; 38 | CGFloat destEnd = 0; 39 | CGFloat currentDest = destStart - (destStart - destEnd) * self.progress; 40 | 41 | [path addArcWithCenter:center radius:radius startAngle: currentOrigin endAngle:currentDest clockwise:NO]; 42 | CGContextAddPath(ctx, path.CGPath); 43 | CGContextSetLineWidth(ctx, kLineWidth); 44 | CGContextSetStrokeColorWithColor(ctx, [UIColor lightGrayColor].CGColor); 45 | CGContextStrokePath(ctx); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Src/OneLoadingAnimation/ArcToCircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ArcToCircleLayer.h" 10 | 11 | static CGFloat const kLineWidth = 6; 12 | 13 | @implementation ArcToCircleLayer 14 | 15 | @dynamic progress; 16 | 17 | + (BOOL)needsDisplayForKey:(NSString *)key { 18 | if ([key isEqualToString:@"progress"]) { 19 | return YES; 20 | } 21 | 22 | return [super needsDisplayForKey:key]; 23 | } 24 | 25 | - (void)drawInContext:(CGContextRef)ctx { 26 | UIBezierPath *path = [UIBezierPath bezierPath]; 27 | 28 | CGFloat radius = MIN(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)) / 2 - kLineWidth / 2; 29 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 30 | 31 | // O 32 | CGFloat originStart = M_PI * 7 / 2; 33 | CGFloat originEnd = M_PI * 2; 34 | CGFloat currentOrigin = originStart - (originStart - originEnd) * self.progress; 35 | 36 | // D 37 | CGFloat destStart = M_PI * 3; 38 | CGFloat destEnd = 0; 39 | CGFloat currentDest = destStart - (destStart - destEnd) * self.progress; 40 | 41 | [path addArcWithCenter:center radius:radius startAngle: currentOrigin endAngle:currentDest clockwise:NO]; 42 | CGContextAddPath(ctx, path.CGPath); 43 | CGContextSetLineWidth(ctx, kLineWidth); 44 | CGContextSetStrokeColorWithColor(ctx, [UIColor blueColor].CGColor); 45 | CGContextStrokePath(ctx); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Src/OneLoadingAnimation/OneLoadingAnimationView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "OneLoadingAnimationView.h" 10 | #import "ArcToCircleLayer.h" 11 | 12 | static CGFloat const kRadius = 40; 13 | static CGFloat const kLineWidth = 6; 14 | static CGFloat const kStep1Duration = 5.0; 15 | 16 | @interface OneLoadingAnimationView () 17 | @property (nonatomic) ArcToCircleLayer *arcToCircleLayer; 18 | @end 19 | 20 | @implementation OneLoadingAnimationView 21 | 22 | - (void)awakeFromNib { 23 | [super awakeFromNib]; 24 | } 25 | 26 | #pragma mark - public 27 | - (void)startAnimation { 28 | [self reset]; 29 | [self doStep1]; 30 | } 31 | 32 | #pragma mark - animation 33 | - (void)reset { 34 | [self.arcToCircleLayer removeFromSuperlayer]; 35 | } 36 | 37 | - (void)doStep1 { 38 | self.arcToCircleLayer = [ArcToCircleLayer layer]; 39 | self.arcToCircleLayer.contentsScale = [UIScreen mainScreen].scale; 40 | [self.layer addSublayer:self.arcToCircleLayer]; 41 | 42 | self.arcToCircleLayer.bounds = CGRectMake(0, 0, kRadius * 2 + kLineWidth, kRadius * 2 + kLineWidth); 43 | self.arcToCircleLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 44 | 45 | // animation 46 | self.arcToCircleLayer.progress = 1; // end status 47 | 48 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"progress"]; 49 | animation.duration = kStep1Duration; 50 | animation.fromValue = @0.0; 51 | animation.toValue = @1.0; 52 | [self.arcToCircleLayer addAnimation:animation forKey:nil]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/Src/OneLoadingAnimation/ArcToCircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ArcToCircleLayer.h" 10 | 11 | @implementation ArcToCircleLayer 12 | 13 | @dynamic progress; 14 | @dynamic color; 15 | @dynamic lineWidth; 16 | 17 | + (BOOL)needsDisplayForKey:(NSString *)key { 18 | if ([key isEqualToString:@"progress"]) { 19 | return YES; 20 | } else if ([key isEqualToString:@"color"]) { 21 | return YES; 22 | } else if ([key isEqualToString:@"lineWidth"]) { 23 | return YES; 24 | } 25 | 26 | return [super needsDisplayForKey:key]; 27 | } 28 | 29 | - (void)drawInContext:(CGContextRef)ctx { 30 | UIBezierPath *path = [UIBezierPath bezierPath]; 31 | 32 | CGFloat radius = MIN(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)) / 2 - self.lineWidth / 2; 33 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 34 | 35 | // O 36 | CGFloat originStart = M_PI * 7 / 2; 37 | CGFloat originEnd = M_PI * 2; 38 | CGFloat currentOrigin = originStart - (originStart - originEnd) * self.progress; 39 | 40 | // D 41 | CGFloat destStart = M_PI * 3; 42 | CGFloat destEnd = 0; 43 | CGFloat currentDest = destStart - (destStart - destEnd) * self.progress; 44 | 45 | [path addArcWithCenter:center radius:radius startAngle: currentOrigin endAngle:currentDest clockwise:NO]; 46 | CGContextAddPath(ctx, path.CGPath); 47 | CGContextSetLineWidth(ctx, self.lineWidth); 48 | CGContextSetStrokeColorWithColor(ctx, self.color.CGColor); 49 | CGContextStrokePath(ctx); 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/Src/OneLoadingAnimation/ArcToCircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ArcToCircleLayer.h" 10 | 11 | static CGFloat const kLineWidth = 6; 12 | 13 | @implementation ArcToCircleLayer 14 | 15 | @dynamic progress; 16 | @dynamic color; 17 | @dynamic lineWidth; 18 | 19 | + (BOOL)needsDisplayForKey:(NSString *)key { 20 | if ([key isEqualToString:@"progress"]) { 21 | return YES; 22 | } else if ([key isEqualToString:@"color"]) { 23 | return YES; 24 | } else if ([key isEqualToString:@"lineWidth"]) { 25 | return YES; 26 | } 27 | 28 | return [super needsDisplayForKey:key]; 29 | } 30 | 31 | - (void)drawInContext:(CGContextRef)ctx { 32 | UIBezierPath *path = [UIBezierPath bezierPath]; 33 | 34 | CGFloat radius = MIN(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)) / 2 - kLineWidth / 2; 35 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 36 | 37 | // O 38 | CGFloat originStart = M_PI * 7 / 2; 39 | CGFloat originEnd = M_PI * 2; 40 | CGFloat currentOrigin = originStart - (originStart - originEnd) * self.progress; 41 | 42 | // D 43 | CGFloat destStart = M_PI * 3; 44 | CGFloat destEnd = 0; 45 | CGFloat currentDest = destStart - (destStart - destEnd) * self.progress; 46 | 47 | [path addArcWithCenter:center radius:radius startAngle: currentOrigin endAngle:currentDest clockwise:NO]; 48 | CGContextAddPath(ctx, path.CGPath); 49 | CGContextSetLineWidth(ctx, self.lineWidth); 50 | CGContextSetStrokeColorWithColor(ctx, self.color.CGColor); 51 | CGContextStrokePath(ctx); 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/Src/OneLoadingAnimation/ArcToCircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.h 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright (c) 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "ArcToCircleLayer.h" 10 | 11 | static CGFloat const kLineWidth = 6; 12 | 13 | @implementation ArcToCircleLayer 14 | 15 | @dynamic progress; 16 | @dynamic color; 17 | @dynamic lineWidth; 18 | 19 | + (BOOL)needsDisplayForKey:(NSString *)key { 20 | if ([key isEqualToString:@"progress"]) { 21 | return YES; 22 | } else if ([key isEqualToString:@"color"]) { 23 | return YES; 24 | } else if ([key isEqualToString:@"lineWidth"]) { 25 | return YES; 26 | } 27 | 28 | return [super needsDisplayForKey:key]; 29 | } 30 | 31 | - (void)drawInContext:(CGContextRef)ctx { 32 | UIBezierPath *path = [UIBezierPath bezierPath]; 33 | 34 | CGFloat radius = MIN(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)) / 2 - kLineWidth / 2; 35 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 36 | 37 | // O 38 | CGFloat originStart = M_PI * 7 / 2; 39 | CGFloat originEnd = M_PI * 2; 40 | CGFloat currentOrigin = originStart - (originStart - originEnd) * self.progress; 41 | 42 | // D 43 | CGFloat destStart = M_PI * 3; 44 | CGFloat destEnd = 0; 45 | CGFloat currentDest = destStart - (destStart - destEnd) * self.progress; 46 | 47 | [path addArcWithCenter:center radius:radius startAngle: currentOrigin endAngle:currentDest clockwise:NO]; 48 | CGContextAddPath(ctx, path.CGPath); 49 | CGContextSetLineWidth(ctx, self.lineWidth); 50 | CGContextSetStrokeColorWithColor(ctx, self.color.CGColor); 51 | CGContextStrokePath(ctx); 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Skip to content 2 | This repository 3 | Search 4 | Pull requests 5 | Issues 6 | Gist 7 | @iamim2 8 | Unwatch 1,374 9 | Unstar 30,404 10 | Fork 11,398 github/gitignore 11 | Code Pull requests 155 Pulse Graphs 12 | Branch: master Find file Copy pathgitignore/Swift.gitignore 13 | 611c239 9 days ago 14 | @natestedman natestedman Add Swift Package Manager to Swift.gitignore 15 | 7 contributors @KrauseFx @martinblech @natestedman @nrbrook @nwest @modocache @bbodenmiller 16 | RawBlameHistory 60 lines (49 sloc) 1.29 KB 17 | # Xcode 18 | # 19 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 20 | 21 | ## Build generated 22 | build/ 23 | DerivedData 24 | 25 | ## Various settings 26 | *.pbxuser 27 | !default.pbxuser 28 | *.mode1v3 29 | !default.mode1v3 30 | *.mode2v3 31 | !default.mode2v3 32 | *.perspectivev3 33 | !default.perspectivev3 34 | xcuserdata 35 | 36 | ## Other 37 | *.xccheckout 38 | *.moved-aside 39 | *.xcuserstate 40 | *.xcscmblueprint 41 | 42 | ## Obj-C/Swift specific 43 | *.hmap 44 | *.ipa 45 | 46 | # Swift Package Manager 47 | # 48 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 49 | # Packages/ 50 | .build/ 51 | 52 | # CocoaPods 53 | # 54 | # We recommend against adding the Pods directory to your .gitignore. However 55 | # you should judge for yourself, the pros and cons are mentioned at: 56 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 57 | # 58 | # Pods/ 59 | 60 | # Carthage 61 | # 62 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 63 | # Carthage/Checkouts 64 | 65 | Carthage/Build 66 | 67 | # fastlane 68 | # 69 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 70 | # screenshots whenever they are needed. 71 | # For more information about the recommended setup visit: 72 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 73 | 74 | fastlane/report.xml 75 | fastlane/screenshots 76 | Status API Training Shop Blog About Pricing 77 | © 2015 GitHub, Inc. Terms Privacy Security Contact Help -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OneLoadingAnimationStep5 4 | // 5 | // Created by thatsoul on 15/12/1. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OneLoadingAnimationStep2 4 | // 5 | // Created by thatsoul on 15/11/21. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OneLoadingAnimationStep3 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OneLoadingAnimationStep4 4 | // 5 | // Created by thatsoul on 15/11/29. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OneLoadingAnimationComplete 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OneLoadingAnimationStep1Another 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // OneLoadingAnimationCompleteSwift 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift/Src/OneLoadingAnimation/ArcToCircleLayer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArcToCircleLayer.swift 3 | // OneLoadingAnimationCompleteSwift 4 | // 5 | // Created by thatsoul on 15/12/13. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ArcToCircleLayer: CALayer { 12 | // MARK: - property 13 | var lineWidth: NSNumber? 14 | var color: UIColor? 15 | var progress: NSNumber? = 0 16 | 17 | // MARK: - override 18 | override class func needsDisplayForKey(key: String) -> Bool{ 19 | switch key { 20 | case "lineWidth", "color", "progress": 21 | return true 22 | default: 23 | break 24 | } 25 | 26 | return super.needsDisplayForKey(key) 27 | } 28 | 29 | // 这个方法是CA系统调用的,比如创建presentationLayer时,看上去自定义的属性值要手动赋值。 30 | override init(layer: AnyObject) { 31 | super.init(layer: layer) // TODO: 这个位置对吗? 32 | 33 | let theLayer: ArcToCircleLayer = layer as! ArcToCircleLayer 34 | self.progress = theLayer.progress 35 | self.color = theLayer.color 36 | self.lineWidth = theLayer.lineWidth 37 | 38 | // print("layer: \(layer) self: \(self)") // 打开这一句,看看log很有趣 39 | } 40 | 41 | // 看上去,如果override init(layer: AnyObject),必须 override init() 和 init?(coder aDecoder: NSCoder) 42 | override init() { 43 | super.init() // TODO: 这样OK吗? 44 | } 45 | 46 | required init?(coder aDecoder: NSCoder) { 47 | super.init(coder: aDecoder) // TODO: 这样OK吗? 48 | } 49 | 50 | override func drawInContext(ctx: CGContext) { 51 | // print("lineWidth: \(lineWidth) color: \(color)") 52 | if lineWidth == nil || color == nil { 53 | return 54 | } 55 | 56 | let path = UIBezierPath() 57 | 58 | let radius = min(CGRectGetWidth(bounds), CGRectGetHeight(bounds)) / 2 - CGFloat(lineWidth!.doubleValue) / 2 59 | let center = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)) 60 | 61 | // O 62 | let originStart = M_PI * 7 / 2 63 | let originEnd = M_PI * 2 64 | let currentOrigin = originStart - (originStart - originEnd) * (progress?.doubleValue)! 65 | 66 | // D 67 | let destStart = M_PI * 3 68 | let destEnd = 0.0 69 | let currentDest = destStart - (destStart - destEnd) * (progress?.doubleValue)! 70 | 71 | path.addArcWithCenter(center, radius: radius, startAngle: CGFloat(currentOrigin), endAngle: CGFloat(currentDest), clockwise: false) 72 | 73 | CGContextAddPath(ctx, path.CGPath) 74 | CGContextSetLineWidth(ctx, CGFloat(lineWidth!.doubleValue)) 75 | 76 | CGContextSetStrokeColorWithColor(ctx, color!.CGColor) 77 | CGContextStrokePath(ctx) 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Src/OneLoadingAnimation/OneLoadingAnimationView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "OneLoadingAnimationView.h" 10 | #import "ArcToCircleLayer.h" 11 | 12 | static CGFloat const kRadius = 40; 13 | static CGFloat const kLineWidth = 6; 14 | static CGFloat const kStep1Duration = 2; 15 | 16 | @interface OneLoadingAnimationView () 17 | @property (nonatomic) CAShapeLayer *arcToCircleLayer; 18 | @end 19 | 20 | @implementation OneLoadingAnimationView 21 | 22 | - (void)awakeFromNib { 23 | [super awakeFromNib]; 24 | } 25 | 26 | #pragma mark - public 27 | - (void)startAnimation { 28 | [self reset]; 29 | [self doStep1]; 30 | } 31 | 32 | #pragma mark - animation 33 | - (void)reset { 34 | [self.arcToCircleLayer removeFromSuperlayer]; 35 | } 36 | 37 | - (void)doStep1 { 38 | self.arcToCircleLayer = [CAShapeLayer layer]; 39 | self.arcToCircleLayer.bounds = CGRectMake(0, 0, kRadius * 2 + kLineWidth, kRadius * 2 + kLineWidth); 40 | self.arcToCircleLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 41 | 42 | UIBezierPath *path = [UIBezierPath bezierPath]; 43 | CGPoint point = CGPointMake(CGRectGetMidX(self.arcToCircleLayer.bounds), CGRectGetMidY(self.arcToCircleLayer.bounds)); 44 | [path addArcWithCenter:point radius:kRadius startAngle:0 endAngle:M_PI * 2 clockwise:NO]; 45 | self.arcToCircleLayer.path = path.CGPath; 46 | self.arcToCircleLayer.lineWidth = kLineWidth; 47 | self.arcToCircleLayer.strokeColor = [UIColor blueColor].CGColor; 48 | self.arcToCircleLayer.fillColor = nil; 49 | 50 | [self.layer addSublayer:self.arcToCircleLayer]; 51 | 52 | // end status 53 | // SS(strokeStart) 54 | CGFloat SSFrom = 0.25; 55 | CGFloat SSTo = 0; 56 | 57 | // SE(strokeEnd) 58 | CGFloat SEFrom = 0.5; 59 | CGFloat SETo = 1.0; 60 | 61 | // transform status 62 | self.arcToCircleLayer.transform = CATransform3DIdentity; 63 | 64 | // animation 65 | CABasicAnimation *ssAnima = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; 66 | ssAnima.fromValue = @(SSFrom); 67 | ssAnima.toValue = @(SSTo); 68 | 69 | CABasicAnimation *seAnima = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 70 | seAnima.fromValue = @(SEFrom); 71 | seAnima.toValue = @(SETo); 72 | 73 | CABasicAnimation *rotateAnima = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 74 | rotateAnima.fromValue = @0; 75 | rotateAnima.toValue = @(-M_PI * 2); 76 | 77 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 78 | animation.animations = @[ssAnima, seAnima, rotateAnima]; 79 | animation.duration = kStep1Duration; 80 | [self.arcToCircleLayer addAnimation:animation forKey:nil]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/Src/OneLoadingAnimation/OneLoadingAnimationView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "OneLoadingAnimationView.h" 10 | #import "ArcToCircleLayer.h" 11 | 12 | static NSString * const kName = @"name"; 13 | 14 | static CGFloat const kRadius = 40; 15 | static CGFloat const kLineWidth = 6; 16 | static CGFloat const kStep1Duration = 1.0; 17 | static CGFloat const kStep2Duration = 3.0; 18 | 19 | @interface OneLoadingAnimationView () 20 | @property (nonatomic) ArcToCircleLayer *arcToCircleLayer; 21 | @property (nonatomic) CAShapeLayer *moveArcLayer; 22 | @end 23 | 24 | @implementation OneLoadingAnimationView 25 | 26 | - (void)awakeFromNib { 27 | [super awakeFromNib]; 28 | } 29 | 30 | #pragma mark - public 31 | - (void)startAnimation { 32 | [self reset]; 33 | [self doStep1]; 34 | } 35 | 36 | #pragma mark - animation 37 | - (void)reset { 38 | [self.arcToCircleLayer removeFromSuperlayer]; 39 | [self.moveArcLayer removeFromSuperlayer]; 40 | } 41 | 42 | // 第1阶段 43 | - (void)doStep1 { 44 | self.arcToCircleLayer = [ArcToCircleLayer layer]; 45 | self.arcToCircleLayer.contentsScale = [UIScreen mainScreen].scale; 46 | [self.layer addSublayer:self.arcToCircleLayer]; 47 | 48 | self.arcToCircleLayer.bounds = CGRectMake(0, 0, kRadius * 2 + kLineWidth, kRadius * 2 + kLineWidth); 49 | self.arcToCircleLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 50 | 51 | // animation 52 | self.arcToCircleLayer.progress = 1; // end status 53 | 54 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"progress"]; 55 | animation.duration = kStep1Duration; 56 | animation.fromValue = @0.0; 57 | animation.toValue = @1.0; 58 | animation.delegate = self; 59 | [animation setValue:@"step1" forKey:kName]; 60 | [self.arcToCircleLayer addAnimation:animation forKey:nil]; 61 | } 62 | 63 | // 第2阶段 64 | - (void)doStep2 { 65 | self.moveArcLayer = [CAShapeLayer layer]; 66 | [self.layer addSublayer:self.moveArcLayer]; 67 | self.moveArcLayer.frame = self.layer.bounds; 68 | // 弧的path 69 | UIBezierPath *moveArcPath = [UIBezierPath bezierPath]; 70 | // 小圆圆心 71 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 72 | // d(x轴上弧圆心与小圆左边缘的距离) 73 | CGFloat d = kRadius / 2; 74 | // 弧圆心 75 | CGPoint arcCenter = CGPointMake(center.x - kRadius - d, center.y); 76 | // 弧半径 77 | CGFloat arcRadius = kRadius * 2 + d; 78 | // O(origin) 79 | CGFloat origin = M_PI * 2; 80 | // D(dest) 81 | CGFloat dest = M_PI * 2 - asin(kRadius * 2 / arcRadius); 82 | [moveArcPath addArcWithCenter:arcCenter radius:arcRadius startAngle:origin endAngle:dest clockwise:NO]; 83 | self.moveArcLayer.path = moveArcPath.CGPath; 84 | self.moveArcLayer.lineWidth = 3; 85 | self.moveArcLayer.strokeColor = [UIColor blueColor].CGColor; 86 | self.moveArcLayer.fillColor = nil; 87 | 88 | // SS(strokeStart) 89 | CGFloat SSFrom = 0; 90 | CGFloat SSTo = 0.9; 91 | 92 | // SE(strokeEnd) 93 | CGFloat SEFrom = 0.1; 94 | CGFloat SETo = 1; 95 | 96 | // end status 97 | self.moveArcLayer.strokeStart = SSTo; 98 | self.moveArcLayer.strokeEnd = SETo; 99 | 100 | // animation 101 | CABasicAnimation *startAnimation = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; 102 | startAnimation.fromValue = @(SSFrom); 103 | startAnimation.toValue = @(SSTo); 104 | 105 | CABasicAnimation *endAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 106 | endAnimation.fromValue = @(SEFrom); 107 | endAnimation.toValue = @(SETo); 108 | 109 | CAAnimationGroup *step2 = [CAAnimationGroup animation]; 110 | step2.animations = @[startAnimation, endAnimation]; 111 | step2.duration = kStep2Duration; 112 | step2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 113 | 114 | [self.moveArcLayer addAnimation:step2 forKey:nil]; 115 | } 116 | 117 | #pragma mark - animation step stop 118 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 119 | if ([[anim valueForKey:kName] isEqualToString:@"step1"]) { 120 | [self doStep2]; 121 | } 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1/OneLoadingAnimationStep1/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep1Another/OneLoadingAnimationStep1Another/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/Src/OneLoadingAnimation/OneLoadingAnimationView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "OneLoadingAnimationView.h" 10 | #import "ArcToCircleLayer.h" 11 | 12 | static NSString * const kName = @"name"; 13 | 14 | static CGFloat const kRadius = 40; 15 | static CGFloat const kLineWidth = 6; 16 | static CGFloat const kStep1Duration = 1.0; 17 | static CGFloat const kStep2Duration = 0.5; 18 | static CGFloat const kStep3Duration = 2.0; 19 | static CGFloat const kVerticalThinLayerWidth = 3; 20 | static CGFloat const kVerticalMoveLayerLength = 15; 21 | 22 | @interface OneLoadingAnimationView () 23 | @property (nonatomic) ArcToCircleLayer *arcToCircleLayer; 24 | @property (nonatomic) CAShapeLayer *moveArcLayer; 25 | @property (nonatomic) CALayer *verticalMoveLayer; 26 | @end 27 | 28 | @implementation OneLoadingAnimationView 29 | 30 | - (void)awakeFromNib { 31 | [super awakeFromNib]; 32 | } 33 | 34 | #pragma mark - public 35 | - (void)startAnimation { 36 | [self reset]; 37 | [self doStep1]; 38 | } 39 | 40 | #pragma mark - animation 41 | - (void)reset { 42 | [self.arcToCircleLayer removeFromSuperlayer]; 43 | [self.moveArcLayer removeFromSuperlayer]; 44 | [self.verticalMoveLayer removeFromSuperlayer]; 45 | } 46 | 47 | // 第1阶段 48 | - (void)doStep1 { 49 | self.arcToCircleLayer = [ArcToCircleLayer layer]; 50 | self.arcToCircleLayer.contentsScale = [UIScreen mainScreen].scale; 51 | [self.layer addSublayer:self.arcToCircleLayer]; 52 | 53 | self.arcToCircleLayer.bounds = CGRectMake(0, 0, kRadius * 2 + kLineWidth, kRadius * 2 + kLineWidth); 54 | self.arcToCircleLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 55 | 56 | // animation 57 | self.arcToCircleLayer.progress = 1; // end status 58 | 59 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"progress"]; 60 | animation.duration = kStep1Duration; 61 | animation.fromValue = @0.0; 62 | animation.toValue = @1.0; 63 | animation.delegate = self; 64 | [animation setValue:@"step1" forKey:kName]; 65 | [self.arcToCircleLayer addAnimation:animation forKey:nil]; 66 | } 67 | 68 | // 第2阶段 69 | - (void)doStep2 { 70 | self.moveArcLayer = [CAShapeLayer layer]; 71 | [self.layer addSublayer:self.moveArcLayer]; 72 | self.moveArcLayer.frame = self.layer.bounds; 73 | // 弧的path 74 | UIBezierPath *moveArcPath = [UIBezierPath bezierPath]; 75 | // 小圆圆心 76 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 77 | // d(x轴上弧圆心与小圆左边缘的距离) 78 | CGFloat d = kRadius / 2; 79 | // 弧圆心 80 | CGPoint arcCenter = CGPointMake(center.x - kRadius - d, center.y); 81 | // 弧半径 82 | CGFloat arcRadius = kRadius * 2 + d; 83 | // O(origin) 84 | CGFloat origin = M_PI * 2; 85 | // D(dest) 86 | CGFloat dest = M_PI * 2 - asin(kRadius * 2 / arcRadius); 87 | [moveArcPath addArcWithCenter:arcCenter radius:arcRadius startAngle:origin endAngle:dest clockwise:NO]; 88 | self.moveArcLayer.path = moveArcPath.CGPath; 89 | self.moveArcLayer.lineWidth = 3; 90 | self.moveArcLayer.strokeColor = [UIColor lightGrayColor].CGColor; 91 | self.moveArcLayer.fillColor = nil; 92 | 93 | // SS(strokeStart) 94 | CGFloat SSFrom = 0; 95 | CGFloat SSTo = 0.9; 96 | 97 | // SE(strokeEnd) 98 | CGFloat SEFrom = 0.1; 99 | CGFloat SETo = 1; 100 | 101 | // end status 102 | self.moveArcLayer.strokeStart = SSTo; 103 | self.moveArcLayer.strokeEnd = SETo; 104 | 105 | // animation 106 | CABasicAnimation *startAnimation = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; 107 | startAnimation.fromValue = @(SSFrom); 108 | startAnimation.toValue = @(SSTo); 109 | 110 | CABasicAnimation *endAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 111 | endAnimation.fromValue = @(SEFrom); 112 | endAnimation.toValue = @(SETo); 113 | 114 | CAAnimationGroup *step2 = [CAAnimationGroup animation]; 115 | step2.animations = @[startAnimation, endAnimation]; 116 | step2.duration = kStep2Duration; 117 | step2.delegate = self; 118 | [step2 setValue:@"step2" forKey:kName]; 119 | step2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 120 | 121 | [self.moveArcLayer addAnimation:step2 forKey:nil]; 122 | } 123 | 124 | // 第3阶段 125 | - (void)doStep3 { 126 | // remove not useful 127 | [self.moveArcLayer removeFromSuperlayer]; 128 | 129 | // step3 layer 130 | self.verticalMoveLayer = [CALayer layer]; 131 | self.verticalMoveLayer.contentsScale = [UIScreen mainScreen].scale; 132 | [self.layer addSublayer:self.verticalMoveLayer]; 133 | 134 | CGFloat height = kVerticalMoveLayerLength; 135 | self.verticalMoveLayer.bounds = CGRectMake(0, 0, kVerticalThinLayerWidth, height); 136 | self.verticalMoveLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds) - kRadius * 2 + height / 2); 137 | self.verticalMoveLayer.backgroundColor = [UIColor blueColor].CGColor; 138 | 139 | // position 140 | CGPoint originPosition = self.verticalMoveLayer.position; 141 | CGPoint destPosition = CGPointMake(originPosition.x, CGRectGetMidY(self.bounds) - kRadius - height / 2); 142 | 143 | // end status 144 | self.verticalMoveLayer.position = destPosition; 145 | 146 | // animation 147 | CABasicAnimation *step3 = [CABasicAnimation animationWithKeyPath:@"position.y"]; 148 | step3.fromValue = @(originPosition.y); 149 | step3.toValue = @(destPosition.y); 150 | step3.duration = kStep3Duration; 151 | [self.verticalMoveLayer addAnimation:step3 forKey:nil]; 152 | } 153 | 154 | #pragma mark - animation step stop 155 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 156 | if ([[anim valueForKey:kName] isEqualToString:@"step1"]) { 157 | [self doStep2]; 158 | } else if ([[anim valueForKey:kName] isEqualToString:@"step2"]) { 159 | [self doStep3]; 160 | } 161 | } 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep2/OneLoadingAnimationStep2/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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep3/OneLoadingAnimationStep3/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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5/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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /OneLoadingAnimationComplete/OneLoadingAnimationComplete/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 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift/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 | 41 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep4/OneLoadingAnimationStep4/Src/OneLoadingAnimation/OneLoadingAnimationView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneLoadingAnimation.m 3 | // OneLoadingAnimationStep1 4 | // 5 | // Created by thatsoul on 15/11/15. 6 | // Copyright © 2015年 chenms.m2. All rights reserved. 7 | // 8 | 9 | #import "OneLoadingAnimationView.h" 10 | #import "ArcToCircleLayer.h" 11 | 12 | static NSString * const kName = @"name"; 13 | 14 | static CGFloat const kRadius = 40; 15 | static CGFloat const kLineWidth = 6; 16 | static CGFloat const kStep1Duration = 1.0; 17 | static CGFloat const kStep2Duration = 0.5; 18 | static CGFloat const kStep3Duration = 0.15; 19 | static CGFloat const kStep4Duration = 5.0; 20 | static CGFloat const kVerticalMoveLayerHeight = 15; 21 | static CGFloat const kVerticalThinLayerWidth = 3; 22 | static CGFloat const kYScale = 0.8; 23 | static CGFloat const kVerticalFatLayerWidth = 6; 24 | 25 | @interface OneLoadingAnimationView () 26 | @property (nonatomic) ArcToCircleLayer *arcToCircleLayer; 27 | @property (nonatomic) CAShapeLayer *moveArcLayer; 28 | @property (nonatomic) CALayer *verticalMoveLayer; 29 | @property (nonatomic) CAShapeLayer *verticalDisappearLayer; 30 | @property (nonatomic) CAShapeLayer *verticalAppearLayer; 31 | @end 32 | 33 | @implementation OneLoadingAnimationView 34 | 35 | - (void)awakeFromNib { 36 | [super awakeFromNib]; 37 | } 38 | 39 | #pragma mark - public 40 | - (void)startAnimation { 41 | [self reset]; 42 | [self doStep1]; 43 | } 44 | 45 | #pragma mark - animation 46 | - (void)reset { 47 | [self.arcToCircleLayer removeFromSuperlayer]; 48 | [self.moveArcLayer removeFromSuperlayer]; 49 | [self.verticalMoveLayer removeFromSuperlayer]; 50 | [self.verticalDisappearLayer removeFromSuperlayer]; 51 | [self.verticalAppearLayer removeFromSuperlayer]; 52 | } 53 | 54 | // 第1阶段 55 | - (void)doStep1 { 56 | self.arcToCircleLayer = [ArcToCircleLayer layer]; 57 | self.arcToCircleLayer.contentsScale = [UIScreen mainScreen].scale; 58 | self.arcToCircleLayer.color = [UIColor lightGrayColor]; 59 | self.arcToCircleLayer.lineWidth = kLineWidth; 60 | [self.layer addSublayer:self.arcToCircleLayer]; 61 | 62 | self.arcToCircleLayer.bounds = CGRectMake(0, 0, kRadius * 2 + kLineWidth, kRadius * 2 + kLineWidth); 63 | self.arcToCircleLayer.bounds = CGRectMake(0, 0, kRadius * 2 + kLineWidth, kRadius * 2 + kLineWidth); 64 | self.arcToCircleLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 65 | 66 | // animation 67 | self.arcToCircleLayer.progress = 1; // end status 68 | 69 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"progress"]; 70 | animation.duration = kStep1Duration; 71 | animation.fromValue = @0.0; 72 | animation.toValue = @1.0; 73 | animation.delegate = self; 74 | [animation setValue:@"step1" forKey:kName]; 75 | [self.arcToCircleLayer addAnimation:animation forKey:nil]; 76 | } 77 | 78 | // 第2阶段 79 | - (void)doStep2 { 80 | self.moveArcLayer = [CAShapeLayer layer]; 81 | [self.layer addSublayer:self.moveArcLayer]; 82 | self.moveArcLayer.frame = self.layer.bounds; 83 | // 弧的path 84 | UIBezierPath *moveArcPath = [UIBezierPath bezierPath]; 85 | // 小圆圆心 86 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 87 | // d(x轴上弧圆心与小圆左边缘的距离) 88 | CGFloat d = kRadius / 2; 89 | // 弧圆心 90 | CGPoint arcCenter = CGPointMake(center.x - kRadius - d, center.y); 91 | // 弧半径 92 | CGFloat arcRadius = kRadius * 2 + d; 93 | // O(origin) 94 | CGFloat origin = M_PI * 2; 95 | // D(dest) 96 | CGFloat dest = M_PI * 2 - asin(kRadius * 2 / arcRadius); 97 | [moveArcPath addArcWithCenter:arcCenter radius:arcRadius startAngle:origin endAngle:dest clockwise:NO]; 98 | self.moveArcLayer.path = moveArcPath.CGPath; 99 | self.moveArcLayer.lineWidth = 3; 100 | self.moveArcLayer.strokeColor = [UIColor lightGrayColor].CGColor; 101 | self.moveArcLayer.fillColor = nil; 102 | 103 | // SS(strokeStart) 104 | CGFloat SSFrom = 0; 105 | CGFloat SSTo = 0.9; 106 | 107 | // SE(strokeEnd) 108 | CGFloat SEFrom = 0.1; 109 | CGFloat SETo = 1; 110 | 111 | // end status 112 | self.moveArcLayer.strokeStart = SSTo; 113 | self.moveArcLayer.strokeEnd = SETo; 114 | 115 | // animation 116 | CABasicAnimation *startAnimation = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; 117 | startAnimation.fromValue = @(SSFrom); 118 | startAnimation.toValue = @(SSTo); 119 | 120 | CABasicAnimation *endAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 121 | endAnimation.fromValue = @(SEFrom); 122 | endAnimation.toValue = @(SETo); 123 | 124 | CAAnimationGroup *step2 = [CAAnimationGroup animation]; 125 | step2.animations = @[startAnimation, endAnimation]; 126 | step2.duration = kStep2Duration; 127 | step2.delegate = self; 128 | [step2 setValue:@"step2" forKey:kName]; 129 | step2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 130 | 131 | [self.moveArcLayer addAnimation:step2 forKey:nil]; 132 | } 133 | 134 | // 第3阶段 135 | - (void)doStep3 { 136 | // remove not useful 137 | [self.moveArcLayer removeFromSuperlayer]; 138 | 139 | // step3 layer 140 | self.verticalMoveLayer = [CALayer layer]; 141 | self.verticalMoveLayer.contentsScale = [UIScreen mainScreen].scale; 142 | [self.layer addSublayer:self.verticalMoveLayer]; 143 | 144 | CGFloat height = kVerticalMoveLayerHeight; 145 | self.verticalMoveLayer.bounds = CGRectMake(0, 0, kVerticalThinLayerWidth, height); 146 | self.verticalMoveLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds) - kRadius * 2 + height / 2); 147 | self.verticalMoveLayer.backgroundColor = [UIColor lightGrayColor].CGColor; 148 | 149 | // position 150 | CGPoint originPosition = self.verticalMoveLayer.position; 151 | CGPoint destPosition = CGPointMake(originPosition.x, CGRectGetMidY(self.bounds) - kRadius - height / 2); 152 | 153 | // end status 154 | self.verticalMoveLayer.position = destPosition; 155 | 156 | // animation 157 | CABasicAnimation *step3 = [CABasicAnimation animationWithKeyPath:@"position.y"]; 158 | step3.fromValue = @(originPosition.y); 159 | step3.toValue = @(destPosition.y); 160 | step3.duration = kStep3Duration; 161 | step3.delegate = self; 162 | [step3 setValue:@"step3" forKey:kName]; 163 | [self.verticalMoveLayer addAnimation:step3 forKey:nil]; 164 | } 165 | 166 | // 第4阶段 167 | - (void)doStep4 { 168 | [self doStep4a]; 169 | [self doStep4b]; 170 | [self doStep4c]; 171 | } 172 | // 4阶段a:小圆变形 173 | - (void)doStep4a { 174 | CGRect frame = self.arcToCircleLayer.frame; 175 | self.arcToCircleLayer.anchorPoint = CGPointMake(0.5, 1); 176 | self.arcToCircleLayer.frame = frame; 177 | self.arcToCircleLayer.color = [UIColor redColor]; 178 | 179 | // y scale 180 | CGFloat yFromScale = 1.0; 181 | CGFloat yToScale = kYScale; 182 | 183 | // x scale 184 | CGFloat xFromScale = 1.0; 185 | CGFloat xToScale = 1.1; 186 | 187 | // end status 188 | self.arcToCircleLayer.transform = CATransform3DMakeScale(xToScale, yToScale, 1); 189 | 190 | // animation 191 | CABasicAnimation *yAnima = [CABasicAnimation animationWithKeyPath:@"transform.scale.y"]; 192 | yAnima.fromValue = @(yFromScale); 193 | yAnima.toValue = @(yToScale); 194 | 195 | CABasicAnimation *xAnima = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"]; 196 | xAnima.fromValue = @(xFromScale); 197 | xAnima.toValue = @(xToScale); 198 | 199 | CAAnimationGroup *anima = [CAAnimationGroup animation]; 200 | anima.animations = @[yAnima, xAnima]; 201 | anima.duration = kStep4Duration; 202 | anima.delegate = self; 203 | [anima setValue:@"step4" forKey:@"name"]; 204 | 205 | [self.arcToCircleLayer addAnimation:anima forKey:nil]; 206 | } 207 | 208 | // 4阶段b:逐渐消失的竖线 209 | - (void)doStep4b { 210 | // remove 211 | [self.verticalMoveLayer removeFromSuperlayer]; 212 | 213 | // new 214 | self.verticalDisappearLayer = [CAShapeLayer layer]; 215 | self.verticalDisappearLayer.frame = self.bounds; 216 | [self.layer addSublayer:self.verticalDisappearLayer]; 217 | 218 | UIBezierPath *path = [UIBezierPath bezierPath]; 219 | CGFloat height = kVerticalMoveLayerHeight; 220 | CGFloat originY = CGRectGetMidY(self.bounds) - kRadius - height; 221 | CGFloat pathHeight = height + kRadius * 2 * (1 - kYScale); 222 | CGFloat destY = originY + pathHeight; 223 | [path moveToPoint:CGPointMake(CGRectGetMidX(self.bounds), originY)]; 224 | [path addLineToPoint:CGPointMake(CGRectGetMidX(self.bounds), destY)]; 225 | self.verticalDisappearLayer.path = path.CGPath; 226 | self.verticalDisappearLayer.lineWidth = kVerticalThinLayerWidth; 227 | self.verticalDisappearLayer.strokeColor = [UIColor greenColor].CGColor; 228 | self.verticalDisappearLayer.fillColor = nil; 229 | 230 | // SS(strokeStart) 231 | CGFloat SSFrom = 0; 232 | CGFloat SSTo = 1.0; 233 | 234 | // SE(strokeEnd) 235 | CGFloat SEFrom = height / pathHeight; 236 | CGFloat SETo = 1.0; 237 | 238 | // end status 239 | self.verticalDisappearLayer.strokeStart = SSTo; 240 | self.verticalDisappearLayer.strokeEnd = SETo; 241 | 242 | // animation 243 | CABasicAnimation *startAnimation = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; 244 | startAnimation.fromValue = @(SSFrom); 245 | startAnimation.toValue = @(SSTo); 246 | 247 | CABasicAnimation *endAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 248 | endAnimation.fromValue = @(SEFrom); 249 | endAnimation.toValue = @(SETo); 250 | 251 | CAAnimationGroup *anima = [CAAnimationGroup animation]; 252 | anima.animations = @[startAnimation, endAnimation]; 253 | anima.duration = kStep4Duration; 254 | [self.verticalDisappearLayer addAnimation:anima forKey:nil]; 255 | } 256 | 257 | // 4阶段c:逐渐出现的竖线 258 | - (void)doStep4c { 259 | self.verticalAppearLayer = [CAShapeLayer layer]; 260 | [self.layer addSublayer:self.verticalAppearLayer]; 261 | self.verticalAppearLayer.frame = self.bounds; 262 | 263 | UIBezierPath *step4cPath = [UIBezierPath bezierPath]; 264 | CGFloat originY = CGRectGetMidY(self.bounds) - kRadius; 265 | CGFloat destY = CGRectGetMidY(self.bounds); 266 | [step4cPath moveToPoint:CGPointMake(CGRectGetMidX(self.bounds), originY)]; 267 | [step4cPath addLineToPoint:CGPointMake(CGRectGetMidX(self.bounds), destY)]; 268 | self.verticalAppearLayer.path = step4cPath.CGPath; 269 | self.verticalAppearLayer.lineWidth = kVerticalFatLayerWidth; 270 | self.verticalAppearLayer.strokeColor = [UIColor blueColor].CGColor; 271 | self.verticalAppearLayer.fillColor = nil; 272 | 273 | 274 | // SS(strokeStart) 275 | CGFloat SSFrom = 0; 276 | CGFloat SSTo = (1 - kYScale) * 2; 277 | 278 | // SE(strokeEnd) 279 | CGFloat SEFrom = 0; 280 | CGFloat SETo = 1; 281 | 282 | // end status 283 | self.verticalAppearLayer.strokeStart = SSTo; 284 | self.verticalAppearLayer.strokeEnd = SETo; 285 | 286 | // animation 287 | CABasicAnimation *startAnimation = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; 288 | startAnimation.fromValue = @(SSFrom); 289 | startAnimation.toValue = @(SSTo); 290 | 291 | CABasicAnimation *endAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 292 | endAnimation.fromValue = @(SEFrom); 293 | endAnimation.toValue = @(SETo); 294 | 295 | CAAnimationGroup *anima = [CAAnimationGroup animation]; 296 | anima.animations = @[startAnimation, endAnimation]; 297 | anima.duration = kStep4Duration; 298 | [self.verticalAppearLayer addAnimation:anima forKey:nil]; 299 | 300 | } 301 | 302 | #pragma mark - animation step stop 303 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 304 | if ([[anim valueForKey:kName] isEqualToString:@"step1"]) { 305 | [self doStep2]; 306 | } else if ([[anim valueForKey:kName] isEqualToString:@"step2"]) { 307 | [self doStep3]; 308 | } else if ([[anim valueForKey:kName] isEqualToString:@"step3"]) { 309 | [self doStep4]; 310 | } 311 | } 312 | 313 | 314 | @end 315 | -------------------------------------------------------------------------------- /OneLoadingAnimationCompleteSwift/OneLoadingAnimationCompleteSwift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A2A12561C1D7CFF001FB1AF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A12551C1D7CFF001FB1AF /* AppDelegate.swift */; }; 11 | 1A2A12581C1D7CFF001FB1AF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A12571C1D7CFF001FB1AF /* ViewController.swift */; }; 12 | 1A2A125B1C1D7CFF001FB1AF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A2A12591C1D7CFF001FB1AF /* Main.storyboard */; }; 13 | 1A2A125D1C1D7CFF001FB1AF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A2A125C1C1D7CFF001FB1AF /* Assets.xcassets */; }; 14 | 1A2A12601C1D7CFF001FB1AF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A2A125E1C1D7CFF001FB1AF /* LaunchScreen.storyboard */; }; 15 | 1A2A12691C1D7DB2001FB1AF /* OneLoadingAnimationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A12681C1D7DB2001FB1AF /* OneLoadingAnimationView.swift */; }; 16 | 1A2A126B1C1D7DD0001FB1AF /* ArcToCircleLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A126A1C1D7DD0001FB1AF /* ArcToCircleLayer.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 1A2A12521C1D7CFF001FB1AF /* OneLoadingAnimationCompleteSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OneLoadingAnimationCompleteSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 1A2A12551C1D7CFF001FB1AF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | 1A2A12571C1D7CFF001FB1AF /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 23 | 1A2A125A1C1D7CFF001FB1AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | 1A2A125C1C1D7CFF001FB1AF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 1A2A125F1C1D7CFF001FB1AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | 1A2A12611C1D7CFF001FB1AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | 1A2A12681C1D7DB2001FB1AF /* OneLoadingAnimationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OneLoadingAnimationView.swift; sourceTree = ""; }; 28 | 1A2A126A1C1D7DD0001FB1AF /* ArcToCircleLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArcToCircleLayer.swift; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 1A2A124F1C1D7CFF001FB1AF /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 1A2A12491C1D7CFF001FB1AF = { 43 | isa = PBXGroup; 44 | children = ( 45 | 1A2A12541C1D7CFF001FB1AF /* OneLoadingAnimationCompleteSwift */, 46 | 1A2A12531C1D7CFF001FB1AF /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 1A2A12531C1D7CFF001FB1AF /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 1A2A12521C1D7CFF001FB1AF /* OneLoadingAnimationCompleteSwift.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 1A2A12541C1D7CFF001FB1AF /* OneLoadingAnimationCompleteSwift */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 1A2A12551C1D7CFF001FB1AF /* AppDelegate.swift */, 62 | 1A2A12571C1D7CFF001FB1AF /* ViewController.swift */, 63 | 1A2A12591C1D7CFF001FB1AF /* Main.storyboard */, 64 | 1A2A12671C1D7D91001FB1AF /* OneLoadingAnimation */, 65 | 1A2A125C1C1D7CFF001FB1AF /* Assets.xcassets */, 66 | 1A2A125E1C1D7CFF001FB1AF /* LaunchScreen.storyboard */, 67 | 1A2A12611C1D7CFF001FB1AF /* Info.plist */, 68 | ); 69 | path = OneLoadingAnimationCompleteSwift; 70 | sourceTree = ""; 71 | }; 72 | 1A2A12671C1D7D91001FB1AF /* OneLoadingAnimation */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 1A2A12681C1D7DB2001FB1AF /* OneLoadingAnimationView.swift */, 76 | 1A2A126A1C1D7DD0001FB1AF /* ArcToCircleLayer.swift */, 77 | ); 78 | name = OneLoadingAnimation; 79 | path = Src/OneLoadingAnimation; 80 | sourceTree = ""; 81 | }; 82 | /* End PBXGroup section */ 83 | 84 | /* Begin PBXNativeTarget section */ 85 | 1A2A12511C1D7CFF001FB1AF /* OneLoadingAnimationCompleteSwift */ = { 86 | isa = PBXNativeTarget; 87 | buildConfigurationList = 1A2A12641C1D7CFF001FB1AF /* Build configuration list for PBXNativeTarget "OneLoadingAnimationCompleteSwift" */; 88 | buildPhases = ( 89 | 1A2A124E1C1D7CFF001FB1AF /* Sources */, 90 | 1A2A124F1C1D7CFF001FB1AF /* Frameworks */, 91 | 1A2A12501C1D7CFF001FB1AF /* Resources */, 92 | ); 93 | buildRules = ( 94 | ); 95 | dependencies = ( 96 | ); 97 | name = OneLoadingAnimationCompleteSwift; 98 | productName = OneLoadingAnimationCompleteSwift; 99 | productReference = 1A2A12521C1D7CFF001FB1AF /* OneLoadingAnimationCompleteSwift.app */; 100 | productType = "com.apple.product-type.application"; 101 | }; 102 | /* End PBXNativeTarget section */ 103 | 104 | /* Begin PBXProject section */ 105 | 1A2A124A1C1D7CFF001FB1AF /* Project object */ = { 106 | isa = PBXProject; 107 | attributes = { 108 | LastSwiftUpdateCheck = 0710; 109 | LastUpgradeCheck = 0710; 110 | ORGANIZATIONNAME = chenms.m2; 111 | TargetAttributes = { 112 | 1A2A12511C1D7CFF001FB1AF = { 113 | CreatedOnToolsVersion = 7.1.1; 114 | }; 115 | }; 116 | }; 117 | buildConfigurationList = 1A2A124D1C1D7CFF001FB1AF /* Build configuration list for PBXProject "OneLoadingAnimationCompleteSwift" */; 118 | compatibilityVersion = "Xcode 3.2"; 119 | developmentRegion = English; 120 | hasScannedForEncodings = 0; 121 | knownRegions = ( 122 | en, 123 | Base, 124 | ); 125 | mainGroup = 1A2A12491C1D7CFF001FB1AF; 126 | productRefGroup = 1A2A12531C1D7CFF001FB1AF /* Products */; 127 | projectDirPath = ""; 128 | projectRoot = ""; 129 | targets = ( 130 | 1A2A12511C1D7CFF001FB1AF /* OneLoadingAnimationCompleteSwift */, 131 | ); 132 | }; 133 | /* End PBXProject section */ 134 | 135 | /* Begin PBXResourcesBuildPhase section */ 136 | 1A2A12501C1D7CFF001FB1AF /* Resources */ = { 137 | isa = PBXResourcesBuildPhase; 138 | buildActionMask = 2147483647; 139 | files = ( 140 | 1A2A12601C1D7CFF001FB1AF /* LaunchScreen.storyboard in Resources */, 141 | 1A2A125D1C1D7CFF001FB1AF /* Assets.xcassets in Resources */, 142 | 1A2A125B1C1D7CFF001FB1AF /* Main.storyboard in Resources */, 143 | ); 144 | runOnlyForDeploymentPostprocessing = 0; 145 | }; 146 | /* End PBXResourcesBuildPhase section */ 147 | 148 | /* Begin PBXSourcesBuildPhase section */ 149 | 1A2A124E1C1D7CFF001FB1AF /* Sources */ = { 150 | isa = PBXSourcesBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | 1A2A12691C1D7DB2001FB1AF /* OneLoadingAnimationView.swift in Sources */, 154 | 1A2A126B1C1D7DD0001FB1AF /* ArcToCircleLayer.swift in Sources */, 155 | 1A2A12581C1D7CFF001FB1AF /* ViewController.swift in Sources */, 156 | 1A2A12561C1D7CFF001FB1AF /* AppDelegate.swift in Sources */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXSourcesBuildPhase section */ 161 | 162 | /* Begin PBXVariantGroup section */ 163 | 1A2A12591C1D7CFF001FB1AF /* Main.storyboard */ = { 164 | isa = PBXVariantGroup; 165 | children = ( 166 | 1A2A125A1C1D7CFF001FB1AF /* Base */, 167 | ); 168 | name = Main.storyboard; 169 | sourceTree = ""; 170 | }; 171 | 1A2A125E1C1D7CFF001FB1AF /* LaunchScreen.storyboard */ = { 172 | isa = PBXVariantGroup; 173 | children = ( 174 | 1A2A125F1C1D7CFF001FB1AF /* Base */, 175 | ); 176 | name = LaunchScreen.storyboard; 177 | sourceTree = ""; 178 | }; 179 | /* End PBXVariantGroup section */ 180 | 181 | /* Begin XCBuildConfiguration section */ 182 | 1A2A12621C1D7CFF001FB1AF /* Debug */ = { 183 | isa = XCBuildConfiguration; 184 | buildSettings = { 185 | ALWAYS_SEARCH_USER_PATHS = NO; 186 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 187 | CLANG_CXX_LIBRARY = "libc++"; 188 | CLANG_ENABLE_MODULES = YES; 189 | CLANG_ENABLE_OBJC_ARC = YES; 190 | CLANG_WARN_BOOL_CONVERSION = YES; 191 | CLANG_WARN_CONSTANT_CONVERSION = YES; 192 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 193 | CLANG_WARN_EMPTY_BODY = YES; 194 | CLANG_WARN_ENUM_CONVERSION = YES; 195 | CLANG_WARN_INT_CONVERSION = YES; 196 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 197 | CLANG_WARN_UNREACHABLE_CODE = YES; 198 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 199 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 200 | COPY_PHASE_STRIP = NO; 201 | DEBUG_INFORMATION_FORMAT = dwarf; 202 | ENABLE_STRICT_OBJC_MSGSEND = YES; 203 | ENABLE_TESTABILITY = YES; 204 | GCC_C_LANGUAGE_STANDARD = gnu99; 205 | GCC_DYNAMIC_NO_PIC = NO; 206 | GCC_NO_COMMON_BLOCKS = YES; 207 | GCC_OPTIMIZATION_LEVEL = 0; 208 | GCC_PREPROCESSOR_DEFINITIONS = ( 209 | "DEBUG=1", 210 | "$(inherited)", 211 | ); 212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 214 | GCC_WARN_UNDECLARED_SELECTOR = YES; 215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 216 | GCC_WARN_UNUSED_FUNCTION = YES; 217 | GCC_WARN_UNUSED_VARIABLE = YES; 218 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 219 | MTL_ENABLE_DEBUG_INFO = YES; 220 | ONLY_ACTIVE_ARCH = YES; 221 | SDKROOT = iphoneos; 222 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 223 | TARGETED_DEVICE_FAMILY = "1,2"; 224 | }; 225 | name = Debug; 226 | }; 227 | 1A2A12631C1D7CFF001FB1AF /* Release */ = { 228 | isa = XCBuildConfiguration; 229 | buildSettings = { 230 | ALWAYS_SEARCH_USER_PATHS = NO; 231 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 232 | CLANG_CXX_LIBRARY = "libc++"; 233 | CLANG_ENABLE_MODULES = YES; 234 | CLANG_ENABLE_OBJC_ARC = YES; 235 | CLANG_WARN_BOOL_CONVERSION = YES; 236 | CLANG_WARN_CONSTANT_CONVERSION = YES; 237 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 238 | CLANG_WARN_EMPTY_BODY = YES; 239 | CLANG_WARN_ENUM_CONVERSION = YES; 240 | CLANG_WARN_INT_CONVERSION = YES; 241 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 242 | CLANG_WARN_UNREACHABLE_CODE = YES; 243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 245 | COPY_PHASE_STRIP = NO; 246 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 247 | ENABLE_NS_ASSERTIONS = NO; 248 | ENABLE_STRICT_OBJC_MSGSEND = YES; 249 | GCC_C_LANGUAGE_STANDARD = gnu99; 250 | GCC_NO_COMMON_BLOCKS = YES; 251 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 252 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 253 | GCC_WARN_UNDECLARED_SELECTOR = YES; 254 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 255 | GCC_WARN_UNUSED_FUNCTION = YES; 256 | GCC_WARN_UNUSED_VARIABLE = YES; 257 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 258 | MTL_ENABLE_DEBUG_INFO = NO; 259 | SDKROOT = iphoneos; 260 | TARGETED_DEVICE_FAMILY = "1,2"; 261 | VALIDATE_PRODUCT = YES; 262 | }; 263 | name = Release; 264 | }; 265 | 1A2A12651C1D7CFF001FB1AF /* Debug */ = { 266 | isa = XCBuildConfiguration; 267 | buildSettings = { 268 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 269 | INFOPLIST_FILE = OneLoadingAnimationCompleteSwift/Info.plist; 270 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 271 | PRODUCT_BUNDLE_IDENTIFIER = chenms.m2.OneLoadingAnimationCompleteSwift; 272 | PRODUCT_NAME = "$(TARGET_NAME)"; 273 | }; 274 | name = Debug; 275 | }; 276 | 1A2A12661C1D7CFF001FB1AF /* Release */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 280 | INFOPLIST_FILE = OneLoadingAnimationCompleteSwift/Info.plist; 281 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 282 | PRODUCT_BUNDLE_IDENTIFIER = chenms.m2.OneLoadingAnimationCompleteSwift; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | }; 285 | name = Release; 286 | }; 287 | /* End XCBuildConfiguration section */ 288 | 289 | /* Begin XCConfigurationList section */ 290 | 1A2A124D1C1D7CFF001FB1AF /* Build configuration list for PBXProject "OneLoadingAnimationCompleteSwift" */ = { 291 | isa = XCConfigurationList; 292 | buildConfigurations = ( 293 | 1A2A12621C1D7CFF001FB1AF /* Debug */, 294 | 1A2A12631C1D7CFF001FB1AF /* Release */, 295 | ); 296 | defaultConfigurationIsVisible = 0; 297 | defaultConfigurationName = Release; 298 | }; 299 | 1A2A12641C1D7CFF001FB1AF /* Build configuration list for PBXNativeTarget "OneLoadingAnimationCompleteSwift" */ = { 300 | isa = XCConfigurationList; 301 | buildConfigurations = ( 302 | 1A2A12651C1D7CFF001FB1AF /* Debug */, 303 | 1A2A12661C1D7CFF001FB1AF /* Release */, 304 | ); 305 | defaultConfigurationIsVisible = 0; 306 | }; 307 | /* End XCConfigurationList section */ 308 | }; 309 | rootObject = 1A2A124A1C1D7CFF001FB1AF /* Project object */; 310 | } 311 | -------------------------------------------------------------------------------- /OneLoadingAnimationStep5/OneLoadingAnimationStep5.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A3245671C0DF12B00F90578 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3245661C0DF12B00F90578 /* main.m */; }; 11 | 1A32456A1C0DF12B00F90578 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3245691C0DF12B00F90578 /* AppDelegate.m */; }; 12 | 1A32456D1C0DF12B00F90578 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A32456C1C0DF12B00F90578 /* ViewController.m */; }; 13 | 1A3245701C0DF12B00F90578 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A32456E1C0DF12B00F90578 /* Main.storyboard */; }; 14 | 1A3245721C0DF12B00F90578 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A3245711C0DF12B00F90578 /* Assets.xcassets */; }; 15 | 1A3245751C0DF12B00F90578 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A3245731C0DF12B00F90578 /* LaunchScreen.storyboard */; }; 16 | 1A3245811C0DF18700F90578 /* ArcToCircleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A32457E1C0DF18700F90578 /* ArcToCircleLayer.m */; }; 17 | 1A3245821C0DF18700F90578 /* OneLoadingAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3245801C0DF18700F90578 /* OneLoadingAnimationView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 1A3245621C0DF12B00F90578 /* OneLoadingAnimationStep5.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OneLoadingAnimationStep5.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 1A3245661C0DF12B00F90578 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | 1A3245681C0DF12B00F90578 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | 1A3245691C0DF12B00F90578 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | 1A32456B1C0DF12B00F90578 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | 1A32456C1C0DF12B00F90578 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | 1A32456F1C0DF12B00F90578 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | 1A3245711C0DF12B00F90578 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | 1A3245741C0DF12B00F90578 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 1A3245761C0DF12B00F90578 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 1A32457D1C0DF18700F90578 /* ArcToCircleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArcToCircleLayer.h; sourceTree = ""; }; 32 | 1A32457E1C0DF18700F90578 /* ArcToCircleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArcToCircleLayer.m; sourceTree = ""; }; 33 | 1A32457F1C0DF18700F90578 /* OneLoadingAnimationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OneLoadingAnimationView.h; sourceTree = ""; }; 34 | 1A3245801C0DF18700F90578 /* OneLoadingAnimationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OneLoadingAnimationView.m; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 1A32455F1C0DF12B00F90578 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 1A3245591C0DF12B00F90578 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 1A3245641C0DF12B00F90578 /* OneLoadingAnimationStep5 */, 52 | 1A3245631C0DF12B00F90578 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 1A3245631C0DF12B00F90578 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 1A3245621C0DF12B00F90578 /* OneLoadingAnimationStep5.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 1A3245641C0DF12B00F90578 /* OneLoadingAnimationStep5 */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 1A3245681C0DF12B00F90578 /* AppDelegate.h */, 68 | 1A3245691C0DF12B00F90578 /* AppDelegate.m */, 69 | 1A32456B1C0DF12B00F90578 /* ViewController.h */, 70 | 1A32456C1C0DF12B00F90578 /* ViewController.m */, 71 | 1A32456E1C0DF12B00F90578 /* Main.storyboard */, 72 | 1A32457C1C0DF18700F90578 /* OneLoadingAnimation */, 73 | 1A3245711C0DF12B00F90578 /* Assets.xcassets */, 74 | 1A3245731C0DF12B00F90578 /* LaunchScreen.storyboard */, 75 | 1A3245761C0DF12B00F90578 /* Info.plist */, 76 | 1A3245651C0DF12B00F90578 /* Supporting Files */, 77 | ); 78 | path = OneLoadingAnimationStep5; 79 | sourceTree = ""; 80 | }; 81 | 1A3245651C0DF12B00F90578 /* Supporting Files */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 1A3245661C0DF12B00F90578 /* main.m */, 85 | ); 86 | name = "Supporting Files"; 87 | sourceTree = ""; 88 | }; 89 | 1A32457C1C0DF18700F90578 /* OneLoadingAnimation */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 1A32457F1C0DF18700F90578 /* OneLoadingAnimationView.h */, 93 | 1A3245801C0DF18700F90578 /* OneLoadingAnimationView.m */, 94 | 1A32457D1C0DF18700F90578 /* ArcToCircleLayer.h */, 95 | 1A32457E1C0DF18700F90578 /* ArcToCircleLayer.m */, 96 | ); 97 | name = OneLoadingAnimation; 98 | path = Src/OneLoadingAnimation; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 1A3245611C0DF12B00F90578 /* OneLoadingAnimationStep5 */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 1A3245791C0DF12B00F90578 /* Build configuration list for PBXNativeTarget "OneLoadingAnimationStep5" */; 107 | buildPhases = ( 108 | 1A32455E1C0DF12B00F90578 /* Sources */, 109 | 1A32455F1C0DF12B00F90578 /* Frameworks */, 110 | 1A3245601C0DF12B00F90578 /* Resources */, 111 | ); 112 | buildRules = ( 113 | ); 114 | dependencies = ( 115 | ); 116 | name = OneLoadingAnimationStep5; 117 | productName = OneLoadingAnimationStep5; 118 | productReference = 1A3245621C0DF12B00F90578 /* OneLoadingAnimationStep5.app */; 119 | productType = "com.apple.product-type.application"; 120 | }; 121 | /* End PBXNativeTarget section */ 122 | 123 | /* Begin PBXProject section */ 124 | 1A32455A1C0DF12B00F90578 /* Project object */ = { 125 | isa = PBXProject; 126 | attributes = { 127 | LastUpgradeCheck = 0700; 128 | ORGANIZATIONNAME = chenms.m2; 129 | TargetAttributes = { 130 | 1A3245611C0DF12B00F90578 = { 131 | CreatedOnToolsVersion = 7.0.1; 132 | }; 133 | }; 134 | }; 135 | buildConfigurationList = 1A32455D1C0DF12B00F90578 /* Build configuration list for PBXProject "OneLoadingAnimationStep5" */; 136 | compatibilityVersion = "Xcode 3.2"; 137 | developmentRegion = English; 138 | hasScannedForEncodings = 0; 139 | knownRegions = ( 140 | en, 141 | Base, 142 | ); 143 | mainGroup = 1A3245591C0DF12B00F90578; 144 | productRefGroup = 1A3245631C0DF12B00F90578 /* Products */; 145 | projectDirPath = ""; 146 | projectRoot = ""; 147 | targets = ( 148 | 1A3245611C0DF12B00F90578 /* OneLoadingAnimationStep5 */, 149 | ); 150 | }; 151 | /* End PBXProject section */ 152 | 153 | /* Begin PBXResourcesBuildPhase section */ 154 | 1A3245601C0DF12B00F90578 /* Resources */ = { 155 | isa = PBXResourcesBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 1A3245751C0DF12B00F90578 /* LaunchScreen.storyboard in Resources */, 159 | 1A3245721C0DF12B00F90578 /* Assets.xcassets in Resources */, 160 | 1A3245701C0DF12B00F90578 /* Main.storyboard in Resources */, 161 | ); 162 | runOnlyForDeploymentPostprocessing = 0; 163 | }; 164 | /* End PBXResourcesBuildPhase section */ 165 | 166 | /* Begin PBXSourcesBuildPhase section */ 167 | 1A32455E1C0DF12B00F90578 /* Sources */ = { 168 | isa = PBXSourcesBuildPhase; 169 | buildActionMask = 2147483647; 170 | files = ( 171 | 1A3245821C0DF18700F90578 /* OneLoadingAnimationView.m in Sources */, 172 | 1A32456D1C0DF12B00F90578 /* ViewController.m in Sources */, 173 | 1A3245811C0DF18700F90578 /* ArcToCircleLayer.m in Sources */, 174 | 1A32456A1C0DF12B00F90578 /* AppDelegate.m in Sources */, 175 | 1A3245671C0DF12B00F90578 /* main.m in Sources */, 176 | ); 177 | runOnlyForDeploymentPostprocessing = 0; 178 | }; 179 | /* End PBXSourcesBuildPhase section */ 180 | 181 | /* Begin PBXVariantGroup section */ 182 | 1A32456E1C0DF12B00F90578 /* Main.storyboard */ = { 183 | isa = PBXVariantGroup; 184 | children = ( 185 | 1A32456F1C0DF12B00F90578 /* Base */, 186 | ); 187 | name = Main.storyboard; 188 | sourceTree = ""; 189 | }; 190 | 1A3245731C0DF12B00F90578 /* LaunchScreen.storyboard */ = { 191 | isa = PBXVariantGroup; 192 | children = ( 193 | 1A3245741C0DF12B00F90578 /* Base */, 194 | ); 195 | name = LaunchScreen.storyboard; 196 | sourceTree = ""; 197 | }; 198 | /* End PBXVariantGroup section */ 199 | 200 | /* Begin XCBuildConfiguration section */ 201 | 1A3245771C0DF12B00F90578 /* Debug */ = { 202 | isa = XCBuildConfiguration; 203 | buildSettings = { 204 | ALWAYS_SEARCH_USER_PATHS = NO; 205 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 206 | CLANG_CXX_LIBRARY = "libc++"; 207 | CLANG_ENABLE_MODULES = YES; 208 | CLANG_ENABLE_OBJC_ARC = YES; 209 | CLANG_WARN_BOOL_CONVERSION = YES; 210 | CLANG_WARN_CONSTANT_CONVERSION = YES; 211 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 212 | CLANG_WARN_EMPTY_BODY = YES; 213 | CLANG_WARN_ENUM_CONVERSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 216 | CLANG_WARN_UNREACHABLE_CODE = YES; 217 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 218 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 219 | COPY_PHASE_STRIP = NO; 220 | DEBUG_INFORMATION_FORMAT = dwarf; 221 | ENABLE_STRICT_OBJC_MSGSEND = YES; 222 | ENABLE_TESTABILITY = YES; 223 | GCC_C_LANGUAGE_STANDARD = gnu99; 224 | GCC_DYNAMIC_NO_PIC = NO; 225 | GCC_NO_COMMON_BLOCKS = YES; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PREPROCESSOR_DEFINITIONS = ( 228 | "DEBUG=1", 229 | "$(inherited)", 230 | ); 231 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 232 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 233 | GCC_WARN_UNDECLARED_SELECTOR = YES; 234 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 235 | GCC_WARN_UNUSED_FUNCTION = YES; 236 | GCC_WARN_UNUSED_VARIABLE = YES; 237 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 238 | MTL_ENABLE_DEBUG_INFO = YES; 239 | ONLY_ACTIVE_ARCH = YES; 240 | SDKROOT = iphoneos; 241 | TARGETED_DEVICE_FAMILY = "1,2"; 242 | }; 243 | name = Debug; 244 | }; 245 | 1A3245781C0DF12B00F90578 /* Release */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 250 | CLANG_CXX_LIBRARY = "libc++"; 251 | CLANG_ENABLE_MODULES = YES; 252 | CLANG_ENABLE_OBJC_ARC = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_CONSTANT_CONVERSION = YES; 255 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 256 | CLANG_WARN_EMPTY_BODY = YES; 257 | CLANG_WARN_ENUM_CONVERSION = YES; 258 | CLANG_WARN_INT_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | TARGETED_DEVICE_FAMILY = "1,2"; 279 | VALIDATE_PRODUCT = YES; 280 | }; 281 | name = Release; 282 | }; 283 | 1A32457A1C0DF12B00F90578 /* Debug */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 287 | INFOPLIST_FILE = OneLoadingAnimationStep5/Info.plist; 288 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 289 | PRODUCT_BUNDLE_IDENTIFIER = chenms.m2.OneLoadingAnimationStep5; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | }; 292 | name = Debug; 293 | }; 294 | 1A32457B1C0DF12B00F90578 /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | INFOPLIST_FILE = OneLoadingAnimationStep5/Info.plist; 299 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 300 | PRODUCT_BUNDLE_IDENTIFIER = chenms.m2.OneLoadingAnimationStep5; 301 | PRODUCT_NAME = "$(TARGET_NAME)"; 302 | }; 303 | name = Release; 304 | }; 305 | /* End XCBuildConfiguration section */ 306 | 307 | /* Begin XCConfigurationList section */ 308 | 1A32455D1C0DF12B00F90578 /* Build configuration list for PBXProject "OneLoadingAnimationStep5" */ = { 309 | isa = XCConfigurationList; 310 | buildConfigurations = ( 311 | 1A3245771C0DF12B00F90578 /* Debug */, 312 | 1A3245781C0DF12B00F90578 /* Release */, 313 | ); 314 | defaultConfigurationIsVisible = 0; 315 | defaultConfigurationName = Release; 316 | }; 317 | 1A3245791C0DF12B00F90578 /* Build configuration list for PBXNativeTarget "OneLoadingAnimationStep5" */ = { 318 | isa = XCConfigurationList; 319 | buildConfigurations = ( 320 | 1A32457A1C0DF12B00F90578 /* Debug */, 321 | 1A32457B1C0DF12B00F90578 /* Release */, 322 | ); 323 | defaultConfigurationIsVisible = 0; 324 | defaultConfigurationName = Release; 325 | }; 326 | /* End XCConfigurationList section */ 327 | }; 328 | rootObject = 1A32455A1C0DF12B00F90578 /* Project object */; 329 | } 330 | --------------------------------------------------------------------------------