├── YTLoadingAnimationDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── TonyAng.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── TonyAng.xcuserdatad │ └── xcschemes │ ├── YTLoadingAnimationDemo.xcscheme │ └── xcschememanagement.plist ├── YTLoadingAnimationDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── DGActivityIndicatorView │ ├── Animations │ │ ├── DGActivityIndicatorBallBeatAnimation.h │ │ ├── DGActivityIndicatorBallBeatAnimation.m │ │ ├── DGActivityIndicatorBallClipRotateAnimation.h │ │ ├── DGActivityIndicatorBallClipRotateAnimation.m │ │ ├── DGActivityIndicatorBallClipRotateMultipleAnimation.h │ │ ├── DGActivityIndicatorBallClipRotateMultipleAnimation.m │ │ ├── DGActivityIndicatorBallClipRotatePulseAnimation.h │ │ ├── DGActivityIndicatorBallClipRotatePulseAnimation.m │ │ ├── DGActivityIndicatorBallGridBeatAnimation.h │ │ ├── DGActivityIndicatorBallGridBeatAnimation.m │ │ ├── DGActivityIndicatorBallGridPulseAnimation.h │ │ ├── DGActivityIndicatorBallGridPulseAnimation.m │ │ ├── DGActivityIndicatorBallPulseAnimation.h │ │ ├── DGActivityIndicatorBallPulseAnimation.m │ │ ├── DGActivityIndicatorBallPulseSyncAnimation.h │ │ ├── DGActivityIndicatorBallPulseSyncAnimation.m │ │ ├── DGActivityIndicatorBallRotateAnimation.h │ │ ├── DGActivityIndicatorBallRotateAnimation.m │ │ ├── DGActivityIndicatorBallScaleAnimation.h │ │ ├── DGActivityIndicatorBallScaleAnimation.m │ │ ├── DGActivityIndicatorBallScaleMultipleAnimation.h │ │ ├── DGActivityIndicatorBallScaleMultipleAnimation.m │ │ ├── DGActivityIndicatorBallScaleRippleAnimation.h │ │ ├── DGActivityIndicatorBallScaleRippleAnimation.m │ │ ├── DGActivityIndicatorBallScaleRippleMultipleAnimation.h │ │ ├── DGActivityIndicatorBallScaleRippleMultipleAnimation.m │ │ ├── DGActivityIndicatorBallSpinFadeLoader.h │ │ ├── DGActivityIndicatorBallSpinFadeLoader.m │ │ ├── DGActivityIndicatorBallTrianglePathAnimation.h │ │ ├── DGActivityIndicatorBallTrianglePathAnimation.m │ │ ├── DGActivityIndicatorBallZigZagAnimation.h │ │ ├── DGActivityIndicatorBallZigZagAnimation.m │ │ ├── DGActivityIndicatorBallZigZagDeflectAnimation.h │ │ ├── DGActivityIndicatorBallZigZagDeflectAnimation.m │ │ ├── DGActivityIndicatorCookieTerminatorAnimation.h │ │ ├── DGActivityIndicatorCookieTerminatorAnimation.m │ │ ├── DGActivityIndicatorDoubleBounceAnimation.h │ │ ├── DGActivityIndicatorDoubleBounceAnimation.m │ │ ├── DGActivityIndicatorFiveDotsAnimation.h │ │ ├── DGActivityIndicatorFiveDotsAnimation.m │ │ ├── DGActivityIndicatorLineScaleAnimation.h │ │ ├── DGActivityIndicatorLineScaleAnimation.m │ │ ├── DGActivityIndicatorLineScalePartyAnimation.h │ │ ├── DGActivityIndicatorLineScalePartyAnimation.m │ │ ├── DGActivityIndicatorLineScalePulseOutAnimation.h │ │ ├── DGActivityIndicatorLineScalePulseOutAnimation.m │ │ ├── DGActivityIndicatorLineScalePulseOutRapidAnimation.h │ │ ├── DGActivityIndicatorLineScalePulseOutRapidAnimation.m │ │ ├── DGActivityIndicatorNineDotsAnimation.h │ │ ├── DGActivityIndicatorNineDotsAnimation.m │ │ ├── DGActivityIndicatorRotatingSandglassAnimation.h │ │ ├── DGActivityIndicatorRotatingSandglassAnimation.m │ │ ├── DGActivityIndicatorRotatingSquaresAnimation.h │ │ ├── DGActivityIndicatorRotatingSquaresAnimation.m │ │ ├── DGActivityIndicatorRotatingTrigonAnimation.h │ │ ├── DGActivityIndicatorRotatingTrigonAnimation.m │ │ ├── DGActivityIndicatorThreeDotsAnimation.h │ │ ├── DGActivityIndicatorThreeDotsAnimation.m │ │ ├── DGActivityIndicatorTriangleSkewSpinAnimation.h │ │ ├── DGActivityIndicatorTriangleSkewSpinAnimation.m │ │ ├── DGActivityIndicatorTriplePulseAnimation.h │ │ ├── DGActivityIndicatorTriplePulseAnimation.m │ │ ├── DGActivityIndicatorTripleRingsAnimation.h │ │ ├── DGActivityIndicatorTripleRingsAnimation.m │ │ ├── DGActivityIndicatorTwoDotsAnimation.h │ │ └── DGActivityIndicatorTwoDotsAnimation.m │ ├── DGActivityIndicatorAnimationProtocol.h │ ├── DGActivityIndicatorView.h │ └── DGActivityIndicatorView.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── YTLoadingAnimationDemoTests ├── Info.plist └── YTLoadingAnimationDemoTests.m └── YTLoadingAnimationDemoUITests ├── Info.plist └── YTLoadingAnimationDemoUITests.m /YTLoadingAnimationDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 71CD95C51CAE5DF600C88825 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95C41CAE5DF600C88825 /* main.m */; }; 11 | 71CD95C81CAE5DF600C88825 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95C71CAE5DF600C88825 /* AppDelegate.m */; }; 12 | 71CD95CB1CAE5DF600C88825 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95CA1CAE5DF600C88825 /* ViewController.m */; }; 13 | 71CD95CE1CAE5DF600C88825 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71CD95CC1CAE5DF600C88825 /* Main.storyboard */; }; 14 | 71CD95D01CAE5DF600C88825 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 71CD95CF1CAE5DF600C88825 /* Assets.xcassets */; }; 15 | 71CD95D31CAE5DF600C88825 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71CD95D11CAE5DF600C88825 /* LaunchScreen.storyboard */; }; 16 | 71CD95DE1CAE5DF600C88825 /* YTLoadingAnimationDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95DD1CAE5DF600C88825 /* YTLoadingAnimationDemoTests.m */; }; 17 | 71CD95E91CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95E81CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.m */; }; 18 | 71CD963D1CAE5E2500C88825 /* DGActivityIndicatorBallBeatAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95F91CAE5E2500C88825 /* DGActivityIndicatorBallBeatAnimation.m */; }; 19 | 71CD963E1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95FB1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateAnimation.m */; }; 20 | 71CD963F1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateMultipleAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95FD1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateMultipleAnimation.m */; }; 21 | 71CD96401CAE5E2500C88825 /* DGActivityIndicatorBallClipRotatePulseAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD95FF1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotatePulseAnimation.m */; }; 22 | 71CD96411CAE5E2500C88825 /* DGActivityIndicatorBallGridBeatAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96011CAE5E2500C88825 /* DGActivityIndicatorBallGridBeatAnimation.m */; }; 23 | 71CD96421CAE5E2500C88825 /* DGActivityIndicatorBallGridPulseAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96031CAE5E2500C88825 /* DGActivityIndicatorBallGridPulseAnimation.m */; }; 24 | 71CD96431CAE5E2500C88825 /* DGActivityIndicatorBallPulseAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96051CAE5E2500C88825 /* DGActivityIndicatorBallPulseAnimation.m */; }; 25 | 71CD96441CAE5E2500C88825 /* DGActivityIndicatorBallPulseSyncAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96071CAE5E2500C88825 /* DGActivityIndicatorBallPulseSyncAnimation.m */; }; 26 | 71CD96451CAE5E2500C88825 /* DGActivityIndicatorBallRotateAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96091CAE5E2500C88825 /* DGActivityIndicatorBallRotateAnimation.m */; }; 27 | 71CD96461CAE5E2500C88825 /* DGActivityIndicatorBallScaleAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD960B1CAE5E2500C88825 /* DGActivityIndicatorBallScaleAnimation.m */; }; 28 | 71CD96471CAE5E2500C88825 /* DGActivityIndicatorBallScaleMultipleAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD960D1CAE5E2500C88825 /* DGActivityIndicatorBallScaleMultipleAnimation.m */; }; 29 | 71CD96481CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD960F1CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleAnimation.m */; }; 30 | 71CD96491CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleMultipleAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96111CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleMultipleAnimation.m */; }; 31 | 71CD964A1CAE5E2500C88825 /* DGActivityIndicatorBallSpinFadeLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96131CAE5E2500C88825 /* DGActivityIndicatorBallSpinFadeLoader.m */; }; 32 | 71CD964B1CAE5E2500C88825 /* DGActivityIndicatorBallTrianglePathAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96151CAE5E2500C88825 /* DGActivityIndicatorBallTrianglePathAnimation.m */; }; 33 | 71CD964C1CAE5E2500C88825 /* DGActivityIndicatorBallZigZagAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96171CAE5E2500C88825 /* DGActivityIndicatorBallZigZagAnimation.m */; }; 34 | 71CD964D1CAE5E2500C88825 /* DGActivityIndicatorBallZigZagDeflectAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96191CAE5E2500C88825 /* DGActivityIndicatorBallZigZagDeflectAnimation.m */; }; 35 | 71CD964E1CAE5E2500C88825 /* DGActivityIndicatorCookieTerminatorAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD961B1CAE5E2500C88825 /* DGActivityIndicatorCookieTerminatorAnimation.m */; }; 36 | 71CD964F1CAE5E2500C88825 /* DGActivityIndicatorDoubleBounceAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD961D1CAE5E2500C88825 /* DGActivityIndicatorDoubleBounceAnimation.m */; }; 37 | 71CD96501CAE5E2500C88825 /* DGActivityIndicatorFiveDotsAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD961F1CAE5E2500C88825 /* DGActivityIndicatorFiveDotsAnimation.m */; }; 38 | 71CD96511CAE5E2500C88825 /* DGActivityIndicatorLineScaleAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96211CAE5E2500C88825 /* DGActivityIndicatorLineScaleAnimation.m */; }; 39 | 71CD96521CAE5E2500C88825 /* DGActivityIndicatorLineScalePartyAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96231CAE5E2500C88825 /* DGActivityIndicatorLineScalePartyAnimation.m */; }; 40 | 71CD96531CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96251CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutAnimation.m */; }; 41 | 71CD96541CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutRapidAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96271CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutRapidAnimation.m */; }; 42 | 71CD96551CAE5E2500C88825 /* DGActivityIndicatorNineDotsAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96291CAE5E2500C88825 /* DGActivityIndicatorNineDotsAnimation.m */; }; 43 | 71CD96561CAE5E2500C88825 /* DGActivityIndicatorRotatingSandglassAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD962B1CAE5E2500C88825 /* DGActivityIndicatorRotatingSandglassAnimation.m */; }; 44 | 71CD96571CAE5E2500C88825 /* DGActivityIndicatorRotatingSquaresAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD962D1CAE5E2500C88825 /* DGActivityIndicatorRotatingSquaresAnimation.m */; }; 45 | 71CD96581CAE5E2500C88825 /* DGActivityIndicatorRotatingTrigonAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD962F1CAE5E2500C88825 /* DGActivityIndicatorRotatingTrigonAnimation.m */; }; 46 | 71CD96591CAE5E2500C88825 /* DGActivityIndicatorThreeDotsAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96311CAE5E2500C88825 /* DGActivityIndicatorThreeDotsAnimation.m */; }; 47 | 71CD965A1CAE5E2500C88825 /* DGActivityIndicatorTriangleSkewSpinAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96331CAE5E2500C88825 /* DGActivityIndicatorTriangleSkewSpinAnimation.m */; }; 48 | 71CD965B1CAE5E2500C88825 /* DGActivityIndicatorTriplePulseAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96351CAE5E2500C88825 /* DGActivityIndicatorTriplePulseAnimation.m */; }; 49 | 71CD965C1CAE5E2500C88825 /* DGActivityIndicatorTripleRingsAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96371CAE5E2500C88825 /* DGActivityIndicatorTripleRingsAnimation.m */; }; 50 | 71CD965D1CAE5E2500C88825 /* DGActivityIndicatorTwoDotsAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD96391CAE5E2500C88825 /* DGActivityIndicatorTwoDotsAnimation.m */; }; 51 | 71CD965E1CAE5E2500C88825 /* DGActivityIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD963C1CAE5E2500C88825 /* DGActivityIndicatorView.m */; }; 52 | /* End PBXBuildFile section */ 53 | 54 | /* Begin PBXContainerItemProxy section */ 55 | 71CD95DA1CAE5DF600C88825 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = 71CD95B81CAE5DF600C88825 /* Project object */; 58 | proxyType = 1; 59 | remoteGlobalIDString = 71CD95BF1CAE5DF600C88825; 60 | remoteInfo = YTLoadingAnimationDemo; 61 | }; 62 | 71CD95E51CAE5DF600C88825 /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = 71CD95B81CAE5DF600C88825 /* Project object */; 65 | proxyType = 1; 66 | remoteGlobalIDString = 71CD95BF1CAE5DF600C88825; 67 | remoteInfo = YTLoadingAnimationDemo; 68 | }; 69 | /* End PBXContainerItemProxy section */ 70 | 71 | /* Begin PBXFileReference section */ 72 | 71CD95C01CAE5DF600C88825 /* YTLoadingAnimationDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YTLoadingAnimationDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | 71CD95C41CAE5DF600C88825 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 74 | 71CD95C61CAE5DF600C88825 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 75 | 71CD95C71CAE5DF600C88825 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 76 | 71CD95C91CAE5DF600C88825 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 77 | 71CD95CA1CAE5DF600C88825 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 78 | 71CD95CD1CAE5DF600C88825 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 79 | 71CD95CF1CAE5DF600C88825 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 80 | 71CD95D21CAE5DF600C88825 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 81 | 71CD95D41CAE5DF600C88825 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 82 | 71CD95D91CAE5DF600C88825 /* YTLoadingAnimationDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YTLoadingAnimationDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | 71CD95DD1CAE5DF600C88825 /* YTLoadingAnimationDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YTLoadingAnimationDemoTests.m; sourceTree = ""; }; 84 | 71CD95DF1CAE5DF600C88825 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 85 | 71CD95E41CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YTLoadingAnimationDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 86 | 71CD95E81CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YTLoadingAnimationDemoUITests.m; sourceTree = ""; }; 87 | 71CD95EA1CAE5DF600C88825 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 88 | 71CD95F81CAE5E2500C88825 /* DGActivityIndicatorBallBeatAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallBeatAnimation.h; sourceTree = ""; }; 89 | 71CD95F91CAE5E2500C88825 /* DGActivityIndicatorBallBeatAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallBeatAnimation.m; sourceTree = ""; }; 90 | 71CD95FA1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallClipRotateAnimation.h; sourceTree = ""; }; 91 | 71CD95FB1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallClipRotateAnimation.m; sourceTree = ""; }; 92 | 71CD95FC1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateMultipleAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallClipRotateMultipleAnimation.h; sourceTree = ""; }; 93 | 71CD95FD1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateMultipleAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallClipRotateMultipleAnimation.m; sourceTree = ""; }; 94 | 71CD95FE1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotatePulseAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallClipRotatePulseAnimation.h; sourceTree = ""; }; 95 | 71CD95FF1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotatePulseAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallClipRotatePulseAnimation.m; sourceTree = ""; }; 96 | 71CD96001CAE5E2500C88825 /* DGActivityIndicatorBallGridBeatAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallGridBeatAnimation.h; sourceTree = ""; }; 97 | 71CD96011CAE5E2500C88825 /* DGActivityIndicatorBallGridBeatAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallGridBeatAnimation.m; sourceTree = ""; }; 98 | 71CD96021CAE5E2500C88825 /* DGActivityIndicatorBallGridPulseAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallGridPulseAnimation.h; sourceTree = ""; }; 99 | 71CD96031CAE5E2500C88825 /* DGActivityIndicatorBallGridPulseAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallGridPulseAnimation.m; sourceTree = ""; }; 100 | 71CD96041CAE5E2500C88825 /* DGActivityIndicatorBallPulseAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallPulseAnimation.h; sourceTree = ""; }; 101 | 71CD96051CAE5E2500C88825 /* DGActivityIndicatorBallPulseAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallPulseAnimation.m; sourceTree = ""; }; 102 | 71CD96061CAE5E2500C88825 /* DGActivityIndicatorBallPulseSyncAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallPulseSyncAnimation.h; sourceTree = ""; }; 103 | 71CD96071CAE5E2500C88825 /* DGActivityIndicatorBallPulseSyncAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallPulseSyncAnimation.m; sourceTree = ""; }; 104 | 71CD96081CAE5E2500C88825 /* DGActivityIndicatorBallRotateAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallRotateAnimation.h; sourceTree = ""; }; 105 | 71CD96091CAE5E2500C88825 /* DGActivityIndicatorBallRotateAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallRotateAnimation.m; sourceTree = ""; }; 106 | 71CD960A1CAE5E2500C88825 /* DGActivityIndicatorBallScaleAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallScaleAnimation.h; sourceTree = ""; }; 107 | 71CD960B1CAE5E2500C88825 /* DGActivityIndicatorBallScaleAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallScaleAnimation.m; sourceTree = ""; }; 108 | 71CD960C1CAE5E2500C88825 /* DGActivityIndicatorBallScaleMultipleAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallScaleMultipleAnimation.h; sourceTree = ""; }; 109 | 71CD960D1CAE5E2500C88825 /* DGActivityIndicatorBallScaleMultipleAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallScaleMultipleAnimation.m; sourceTree = ""; }; 110 | 71CD960E1CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallScaleRippleAnimation.h; sourceTree = ""; }; 111 | 71CD960F1CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallScaleRippleAnimation.m; sourceTree = ""; }; 112 | 71CD96101CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleMultipleAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallScaleRippleMultipleAnimation.h; sourceTree = ""; }; 113 | 71CD96111CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleMultipleAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallScaleRippleMultipleAnimation.m; sourceTree = ""; }; 114 | 71CD96121CAE5E2500C88825 /* DGActivityIndicatorBallSpinFadeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallSpinFadeLoader.h; sourceTree = ""; }; 115 | 71CD96131CAE5E2500C88825 /* DGActivityIndicatorBallSpinFadeLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallSpinFadeLoader.m; sourceTree = ""; }; 116 | 71CD96141CAE5E2500C88825 /* DGActivityIndicatorBallTrianglePathAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallTrianglePathAnimation.h; sourceTree = ""; }; 117 | 71CD96151CAE5E2500C88825 /* DGActivityIndicatorBallTrianglePathAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallTrianglePathAnimation.m; sourceTree = ""; }; 118 | 71CD96161CAE5E2500C88825 /* DGActivityIndicatorBallZigZagAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallZigZagAnimation.h; sourceTree = ""; }; 119 | 71CD96171CAE5E2500C88825 /* DGActivityIndicatorBallZigZagAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallZigZagAnimation.m; sourceTree = ""; }; 120 | 71CD96181CAE5E2500C88825 /* DGActivityIndicatorBallZigZagDeflectAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorBallZigZagDeflectAnimation.h; sourceTree = ""; }; 121 | 71CD96191CAE5E2500C88825 /* DGActivityIndicatorBallZigZagDeflectAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorBallZigZagDeflectAnimation.m; sourceTree = ""; }; 122 | 71CD961A1CAE5E2500C88825 /* DGActivityIndicatorCookieTerminatorAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorCookieTerminatorAnimation.h; sourceTree = ""; }; 123 | 71CD961B1CAE5E2500C88825 /* DGActivityIndicatorCookieTerminatorAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorCookieTerminatorAnimation.m; sourceTree = ""; }; 124 | 71CD961C1CAE5E2500C88825 /* DGActivityIndicatorDoubleBounceAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorDoubleBounceAnimation.h; sourceTree = ""; }; 125 | 71CD961D1CAE5E2500C88825 /* DGActivityIndicatorDoubleBounceAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorDoubleBounceAnimation.m; sourceTree = ""; }; 126 | 71CD961E1CAE5E2500C88825 /* DGActivityIndicatorFiveDotsAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorFiveDotsAnimation.h; sourceTree = ""; }; 127 | 71CD961F1CAE5E2500C88825 /* DGActivityIndicatorFiveDotsAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorFiveDotsAnimation.m; sourceTree = ""; }; 128 | 71CD96201CAE5E2500C88825 /* DGActivityIndicatorLineScaleAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorLineScaleAnimation.h; sourceTree = ""; }; 129 | 71CD96211CAE5E2500C88825 /* DGActivityIndicatorLineScaleAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorLineScaleAnimation.m; sourceTree = ""; }; 130 | 71CD96221CAE5E2500C88825 /* DGActivityIndicatorLineScalePartyAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorLineScalePartyAnimation.h; sourceTree = ""; }; 131 | 71CD96231CAE5E2500C88825 /* DGActivityIndicatorLineScalePartyAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorLineScalePartyAnimation.m; sourceTree = ""; }; 132 | 71CD96241CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorLineScalePulseOutAnimation.h; sourceTree = ""; }; 133 | 71CD96251CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorLineScalePulseOutAnimation.m; sourceTree = ""; }; 134 | 71CD96261CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutRapidAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorLineScalePulseOutRapidAnimation.h; sourceTree = ""; }; 135 | 71CD96271CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutRapidAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorLineScalePulseOutRapidAnimation.m; sourceTree = ""; }; 136 | 71CD96281CAE5E2500C88825 /* DGActivityIndicatorNineDotsAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorNineDotsAnimation.h; sourceTree = ""; }; 137 | 71CD96291CAE5E2500C88825 /* DGActivityIndicatorNineDotsAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorNineDotsAnimation.m; sourceTree = ""; }; 138 | 71CD962A1CAE5E2500C88825 /* DGActivityIndicatorRotatingSandglassAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorRotatingSandglassAnimation.h; sourceTree = ""; }; 139 | 71CD962B1CAE5E2500C88825 /* DGActivityIndicatorRotatingSandglassAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorRotatingSandglassAnimation.m; sourceTree = ""; }; 140 | 71CD962C1CAE5E2500C88825 /* DGActivityIndicatorRotatingSquaresAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorRotatingSquaresAnimation.h; sourceTree = ""; }; 141 | 71CD962D1CAE5E2500C88825 /* DGActivityIndicatorRotatingSquaresAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorRotatingSquaresAnimation.m; sourceTree = ""; }; 142 | 71CD962E1CAE5E2500C88825 /* DGActivityIndicatorRotatingTrigonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorRotatingTrigonAnimation.h; sourceTree = ""; }; 143 | 71CD962F1CAE5E2500C88825 /* DGActivityIndicatorRotatingTrigonAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorRotatingTrigonAnimation.m; sourceTree = ""; }; 144 | 71CD96301CAE5E2500C88825 /* DGActivityIndicatorThreeDotsAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorThreeDotsAnimation.h; sourceTree = ""; }; 145 | 71CD96311CAE5E2500C88825 /* DGActivityIndicatorThreeDotsAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorThreeDotsAnimation.m; sourceTree = ""; }; 146 | 71CD96321CAE5E2500C88825 /* DGActivityIndicatorTriangleSkewSpinAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorTriangleSkewSpinAnimation.h; sourceTree = ""; }; 147 | 71CD96331CAE5E2500C88825 /* DGActivityIndicatorTriangleSkewSpinAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorTriangleSkewSpinAnimation.m; sourceTree = ""; }; 148 | 71CD96341CAE5E2500C88825 /* DGActivityIndicatorTriplePulseAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorTriplePulseAnimation.h; sourceTree = ""; }; 149 | 71CD96351CAE5E2500C88825 /* DGActivityIndicatorTriplePulseAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorTriplePulseAnimation.m; sourceTree = ""; }; 150 | 71CD96361CAE5E2500C88825 /* DGActivityIndicatorTripleRingsAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorTripleRingsAnimation.h; sourceTree = ""; }; 151 | 71CD96371CAE5E2500C88825 /* DGActivityIndicatorTripleRingsAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorTripleRingsAnimation.m; sourceTree = ""; }; 152 | 71CD96381CAE5E2500C88825 /* DGActivityIndicatorTwoDotsAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorTwoDotsAnimation.h; sourceTree = ""; }; 153 | 71CD96391CAE5E2500C88825 /* DGActivityIndicatorTwoDotsAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorTwoDotsAnimation.m; sourceTree = ""; }; 154 | 71CD963A1CAE5E2500C88825 /* DGActivityIndicatorAnimationProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorAnimationProtocol.h; sourceTree = ""; }; 155 | 71CD963B1CAE5E2500C88825 /* DGActivityIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGActivityIndicatorView.h; sourceTree = ""; }; 156 | 71CD963C1CAE5E2500C88825 /* DGActivityIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGActivityIndicatorView.m; sourceTree = ""; }; 157 | /* End PBXFileReference section */ 158 | 159 | /* Begin PBXFrameworksBuildPhase section */ 160 | 71CD95BD1CAE5DF600C88825 /* Frameworks */ = { 161 | isa = PBXFrameworksBuildPhase; 162 | buildActionMask = 2147483647; 163 | files = ( 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | 71CD95D61CAE5DF600C88825 /* Frameworks */ = { 168 | isa = PBXFrameworksBuildPhase; 169 | buildActionMask = 2147483647; 170 | files = ( 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | 71CD95E11CAE5DF600C88825 /* Frameworks */ = { 175 | isa = PBXFrameworksBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | }; 181 | /* End PBXFrameworksBuildPhase section */ 182 | 183 | /* Begin PBXGroup section */ 184 | 71CD95B71CAE5DF600C88825 = { 185 | isa = PBXGroup; 186 | children = ( 187 | 71CD95C21CAE5DF600C88825 /* YTLoadingAnimationDemo */, 188 | 71CD95DC1CAE5DF600C88825 /* YTLoadingAnimationDemoTests */, 189 | 71CD95E71CAE5DF600C88825 /* YTLoadingAnimationDemoUITests */, 190 | 71CD95C11CAE5DF600C88825 /* Products */, 191 | ); 192 | sourceTree = ""; 193 | }; 194 | 71CD95C11CAE5DF600C88825 /* Products */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 71CD95C01CAE5DF600C88825 /* YTLoadingAnimationDemo.app */, 198 | 71CD95D91CAE5DF600C88825 /* YTLoadingAnimationDemoTests.xctest */, 199 | 71CD95E41CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.xctest */, 200 | ); 201 | name = Products; 202 | sourceTree = ""; 203 | }; 204 | 71CD95C21CAE5DF600C88825 /* YTLoadingAnimationDemo */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 71CD95F61CAE5E2500C88825 /* DGActivityIndicatorView */, 208 | 71CD95C61CAE5DF600C88825 /* AppDelegate.h */, 209 | 71CD95C71CAE5DF600C88825 /* AppDelegate.m */, 210 | 71CD95C91CAE5DF600C88825 /* ViewController.h */, 211 | 71CD95CA1CAE5DF600C88825 /* ViewController.m */, 212 | 71CD95CC1CAE5DF600C88825 /* Main.storyboard */, 213 | 71CD95CF1CAE5DF600C88825 /* Assets.xcassets */, 214 | 71CD95D11CAE5DF600C88825 /* LaunchScreen.storyboard */, 215 | 71CD95D41CAE5DF600C88825 /* Info.plist */, 216 | 71CD95C31CAE5DF600C88825 /* Supporting Files */, 217 | ); 218 | path = YTLoadingAnimationDemo; 219 | sourceTree = ""; 220 | }; 221 | 71CD95C31CAE5DF600C88825 /* Supporting Files */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | 71CD95C41CAE5DF600C88825 /* main.m */, 225 | ); 226 | name = "Supporting Files"; 227 | sourceTree = ""; 228 | }; 229 | 71CD95DC1CAE5DF600C88825 /* YTLoadingAnimationDemoTests */ = { 230 | isa = PBXGroup; 231 | children = ( 232 | 71CD95DD1CAE5DF600C88825 /* YTLoadingAnimationDemoTests.m */, 233 | 71CD95DF1CAE5DF600C88825 /* Info.plist */, 234 | ); 235 | path = YTLoadingAnimationDemoTests; 236 | sourceTree = ""; 237 | }; 238 | 71CD95E71CAE5DF600C88825 /* YTLoadingAnimationDemoUITests */ = { 239 | isa = PBXGroup; 240 | children = ( 241 | 71CD95E81CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.m */, 242 | 71CD95EA1CAE5DF600C88825 /* Info.plist */, 243 | ); 244 | path = YTLoadingAnimationDemoUITests; 245 | sourceTree = ""; 246 | }; 247 | 71CD95F61CAE5E2500C88825 /* DGActivityIndicatorView */ = { 248 | isa = PBXGroup; 249 | children = ( 250 | 71CD95F71CAE5E2500C88825 /* Animations */, 251 | 71CD963A1CAE5E2500C88825 /* DGActivityIndicatorAnimationProtocol.h */, 252 | 71CD963B1CAE5E2500C88825 /* DGActivityIndicatorView.h */, 253 | 71CD963C1CAE5E2500C88825 /* DGActivityIndicatorView.m */, 254 | ); 255 | path = DGActivityIndicatorView; 256 | sourceTree = ""; 257 | }; 258 | 71CD95F71CAE5E2500C88825 /* Animations */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | 71CD95F81CAE5E2500C88825 /* DGActivityIndicatorBallBeatAnimation.h */, 262 | 71CD95F91CAE5E2500C88825 /* DGActivityIndicatorBallBeatAnimation.m */, 263 | 71CD95FA1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateAnimation.h */, 264 | 71CD95FB1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateAnimation.m */, 265 | 71CD95FC1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateMultipleAnimation.h */, 266 | 71CD95FD1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateMultipleAnimation.m */, 267 | 71CD95FE1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotatePulseAnimation.h */, 268 | 71CD95FF1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotatePulseAnimation.m */, 269 | 71CD96001CAE5E2500C88825 /* DGActivityIndicatorBallGridBeatAnimation.h */, 270 | 71CD96011CAE5E2500C88825 /* DGActivityIndicatorBallGridBeatAnimation.m */, 271 | 71CD96021CAE5E2500C88825 /* DGActivityIndicatorBallGridPulseAnimation.h */, 272 | 71CD96031CAE5E2500C88825 /* DGActivityIndicatorBallGridPulseAnimation.m */, 273 | 71CD96041CAE5E2500C88825 /* DGActivityIndicatorBallPulseAnimation.h */, 274 | 71CD96051CAE5E2500C88825 /* DGActivityIndicatorBallPulseAnimation.m */, 275 | 71CD96061CAE5E2500C88825 /* DGActivityIndicatorBallPulseSyncAnimation.h */, 276 | 71CD96071CAE5E2500C88825 /* DGActivityIndicatorBallPulseSyncAnimation.m */, 277 | 71CD96081CAE5E2500C88825 /* DGActivityIndicatorBallRotateAnimation.h */, 278 | 71CD96091CAE5E2500C88825 /* DGActivityIndicatorBallRotateAnimation.m */, 279 | 71CD960A1CAE5E2500C88825 /* DGActivityIndicatorBallScaleAnimation.h */, 280 | 71CD960B1CAE5E2500C88825 /* DGActivityIndicatorBallScaleAnimation.m */, 281 | 71CD960C1CAE5E2500C88825 /* DGActivityIndicatorBallScaleMultipleAnimation.h */, 282 | 71CD960D1CAE5E2500C88825 /* DGActivityIndicatorBallScaleMultipleAnimation.m */, 283 | 71CD960E1CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleAnimation.h */, 284 | 71CD960F1CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleAnimation.m */, 285 | 71CD96101CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleMultipleAnimation.h */, 286 | 71CD96111CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleMultipleAnimation.m */, 287 | 71CD96121CAE5E2500C88825 /* DGActivityIndicatorBallSpinFadeLoader.h */, 288 | 71CD96131CAE5E2500C88825 /* DGActivityIndicatorBallSpinFadeLoader.m */, 289 | 71CD96141CAE5E2500C88825 /* DGActivityIndicatorBallTrianglePathAnimation.h */, 290 | 71CD96151CAE5E2500C88825 /* DGActivityIndicatorBallTrianglePathAnimation.m */, 291 | 71CD96161CAE5E2500C88825 /* DGActivityIndicatorBallZigZagAnimation.h */, 292 | 71CD96171CAE5E2500C88825 /* DGActivityIndicatorBallZigZagAnimation.m */, 293 | 71CD96181CAE5E2500C88825 /* DGActivityIndicatorBallZigZagDeflectAnimation.h */, 294 | 71CD96191CAE5E2500C88825 /* DGActivityIndicatorBallZigZagDeflectAnimation.m */, 295 | 71CD961A1CAE5E2500C88825 /* DGActivityIndicatorCookieTerminatorAnimation.h */, 296 | 71CD961B1CAE5E2500C88825 /* DGActivityIndicatorCookieTerminatorAnimation.m */, 297 | 71CD961C1CAE5E2500C88825 /* DGActivityIndicatorDoubleBounceAnimation.h */, 298 | 71CD961D1CAE5E2500C88825 /* DGActivityIndicatorDoubleBounceAnimation.m */, 299 | 71CD961E1CAE5E2500C88825 /* DGActivityIndicatorFiveDotsAnimation.h */, 300 | 71CD961F1CAE5E2500C88825 /* DGActivityIndicatorFiveDotsAnimation.m */, 301 | 71CD96201CAE5E2500C88825 /* DGActivityIndicatorLineScaleAnimation.h */, 302 | 71CD96211CAE5E2500C88825 /* DGActivityIndicatorLineScaleAnimation.m */, 303 | 71CD96221CAE5E2500C88825 /* DGActivityIndicatorLineScalePartyAnimation.h */, 304 | 71CD96231CAE5E2500C88825 /* DGActivityIndicatorLineScalePartyAnimation.m */, 305 | 71CD96241CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutAnimation.h */, 306 | 71CD96251CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutAnimation.m */, 307 | 71CD96261CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutRapidAnimation.h */, 308 | 71CD96271CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutRapidAnimation.m */, 309 | 71CD96281CAE5E2500C88825 /* DGActivityIndicatorNineDotsAnimation.h */, 310 | 71CD96291CAE5E2500C88825 /* DGActivityIndicatorNineDotsAnimation.m */, 311 | 71CD962A1CAE5E2500C88825 /* DGActivityIndicatorRotatingSandglassAnimation.h */, 312 | 71CD962B1CAE5E2500C88825 /* DGActivityIndicatorRotatingSandglassAnimation.m */, 313 | 71CD962C1CAE5E2500C88825 /* DGActivityIndicatorRotatingSquaresAnimation.h */, 314 | 71CD962D1CAE5E2500C88825 /* DGActivityIndicatorRotatingSquaresAnimation.m */, 315 | 71CD962E1CAE5E2500C88825 /* DGActivityIndicatorRotatingTrigonAnimation.h */, 316 | 71CD962F1CAE5E2500C88825 /* DGActivityIndicatorRotatingTrigonAnimation.m */, 317 | 71CD96301CAE5E2500C88825 /* DGActivityIndicatorThreeDotsAnimation.h */, 318 | 71CD96311CAE5E2500C88825 /* DGActivityIndicatorThreeDotsAnimation.m */, 319 | 71CD96321CAE5E2500C88825 /* DGActivityIndicatorTriangleSkewSpinAnimation.h */, 320 | 71CD96331CAE5E2500C88825 /* DGActivityIndicatorTriangleSkewSpinAnimation.m */, 321 | 71CD96341CAE5E2500C88825 /* DGActivityIndicatorTriplePulseAnimation.h */, 322 | 71CD96351CAE5E2500C88825 /* DGActivityIndicatorTriplePulseAnimation.m */, 323 | 71CD96361CAE5E2500C88825 /* DGActivityIndicatorTripleRingsAnimation.h */, 324 | 71CD96371CAE5E2500C88825 /* DGActivityIndicatorTripleRingsAnimation.m */, 325 | 71CD96381CAE5E2500C88825 /* DGActivityIndicatorTwoDotsAnimation.h */, 326 | 71CD96391CAE5E2500C88825 /* DGActivityIndicatorTwoDotsAnimation.m */, 327 | ); 328 | path = Animations; 329 | sourceTree = ""; 330 | }; 331 | /* End PBXGroup section */ 332 | 333 | /* Begin PBXNativeTarget section */ 334 | 71CD95BF1CAE5DF600C88825 /* YTLoadingAnimationDemo */ = { 335 | isa = PBXNativeTarget; 336 | buildConfigurationList = 71CD95ED1CAE5DF600C88825 /* Build configuration list for PBXNativeTarget "YTLoadingAnimationDemo" */; 337 | buildPhases = ( 338 | 71CD95BC1CAE5DF600C88825 /* Sources */, 339 | 71CD95BD1CAE5DF600C88825 /* Frameworks */, 340 | 71CD95BE1CAE5DF600C88825 /* Resources */, 341 | ); 342 | buildRules = ( 343 | ); 344 | dependencies = ( 345 | ); 346 | name = YTLoadingAnimationDemo; 347 | productName = YTLoadingAnimationDemo; 348 | productReference = 71CD95C01CAE5DF600C88825 /* YTLoadingAnimationDemo.app */; 349 | productType = "com.apple.product-type.application"; 350 | }; 351 | 71CD95D81CAE5DF600C88825 /* YTLoadingAnimationDemoTests */ = { 352 | isa = PBXNativeTarget; 353 | buildConfigurationList = 71CD95F01CAE5DF600C88825 /* Build configuration list for PBXNativeTarget "YTLoadingAnimationDemoTests" */; 354 | buildPhases = ( 355 | 71CD95D51CAE5DF600C88825 /* Sources */, 356 | 71CD95D61CAE5DF600C88825 /* Frameworks */, 357 | 71CD95D71CAE5DF600C88825 /* Resources */, 358 | ); 359 | buildRules = ( 360 | ); 361 | dependencies = ( 362 | 71CD95DB1CAE5DF600C88825 /* PBXTargetDependency */, 363 | ); 364 | name = YTLoadingAnimationDemoTests; 365 | productName = YTLoadingAnimationDemoTests; 366 | productReference = 71CD95D91CAE5DF600C88825 /* YTLoadingAnimationDemoTests.xctest */; 367 | productType = "com.apple.product-type.bundle.unit-test"; 368 | }; 369 | 71CD95E31CAE5DF600C88825 /* YTLoadingAnimationDemoUITests */ = { 370 | isa = PBXNativeTarget; 371 | buildConfigurationList = 71CD95F31CAE5DF600C88825 /* Build configuration list for PBXNativeTarget "YTLoadingAnimationDemoUITests" */; 372 | buildPhases = ( 373 | 71CD95E01CAE5DF600C88825 /* Sources */, 374 | 71CD95E11CAE5DF600C88825 /* Frameworks */, 375 | 71CD95E21CAE5DF600C88825 /* Resources */, 376 | ); 377 | buildRules = ( 378 | ); 379 | dependencies = ( 380 | 71CD95E61CAE5DF600C88825 /* PBXTargetDependency */, 381 | ); 382 | name = YTLoadingAnimationDemoUITests; 383 | productName = YTLoadingAnimationDemoUITests; 384 | productReference = 71CD95E41CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.xctest */; 385 | productType = "com.apple.product-type.bundle.ui-testing"; 386 | }; 387 | /* End PBXNativeTarget section */ 388 | 389 | /* Begin PBXProject section */ 390 | 71CD95B81CAE5DF600C88825 /* Project object */ = { 391 | isa = PBXProject; 392 | attributes = { 393 | LastUpgradeCheck = 0730; 394 | ORGANIZATIONNAME = TonyAng; 395 | TargetAttributes = { 396 | 71CD95BF1CAE5DF600C88825 = { 397 | CreatedOnToolsVersion = 7.3; 398 | }; 399 | 71CD95D81CAE5DF600C88825 = { 400 | CreatedOnToolsVersion = 7.3; 401 | TestTargetID = 71CD95BF1CAE5DF600C88825; 402 | }; 403 | 71CD95E31CAE5DF600C88825 = { 404 | CreatedOnToolsVersion = 7.3; 405 | TestTargetID = 71CD95BF1CAE5DF600C88825; 406 | }; 407 | }; 408 | }; 409 | buildConfigurationList = 71CD95BB1CAE5DF600C88825 /* Build configuration list for PBXProject "YTLoadingAnimationDemo" */; 410 | compatibilityVersion = "Xcode 3.2"; 411 | developmentRegion = English; 412 | hasScannedForEncodings = 0; 413 | knownRegions = ( 414 | en, 415 | Base, 416 | ); 417 | mainGroup = 71CD95B71CAE5DF600C88825; 418 | productRefGroup = 71CD95C11CAE5DF600C88825 /* Products */; 419 | projectDirPath = ""; 420 | projectRoot = ""; 421 | targets = ( 422 | 71CD95BF1CAE5DF600C88825 /* YTLoadingAnimationDemo */, 423 | 71CD95D81CAE5DF600C88825 /* YTLoadingAnimationDemoTests */, 424 | 71CD95E31CAE5DF600C88825 /* YTLoadingAnimationDemoUITests */, 425 | ); 426 | }; 427 | /* End PBXProject section */ 428 | 429 | /* Begin PBXResourcesBuildPhase section */ 430 | 71CD95BE1CAE5DF600C88825 /* Resources */ = { 431 | isa = PBXResourcesBuildPhase; 432 | buildActionMask = 2147483647; 433 | files = ( 434 | 71CD95D31CAE5DF600C88825 /* LaunchScreen.storyboard in Resources */, 435 | 71CD95D01CAE5DF600C88825 /* Assets.xcassets in Resources */, 436 | 71CD95CE1CAE5DF600C88825 /* Main.storyboard in Resources */, 437 | ); 438 | runOnlyForDeploymentPostprocessing = 0; 439 | }; 440 | 71CD95D71CAE5DF600C88825 /* Resources */ = { 441 | isa = PBXResourcesBuildPhase; 442 | buildActionMask = 2147483647; 443 | files = ( 444 | ); 445 | runOnlyForDeploymentPostprocessing = 0; 446 | }; 447 | 71CD95E21CAE5DF600C88825 /* Resources */ = { 448 | isa = PBXResourcesBuildPhase; 449 | buildActionMask = 2147483647; 450 | files = ( 451 | ); 452 | runOnlyForDeploymentPostprocessing = 0; 453 | }; 454 | /* End PBXResourcesBuildPhase section */ 455 | 456 | /* Begin PBXSourcesBuildPhase section */ 457 | 71CD95BC1CAE5DF600C88825 /* Sources */ = { 458 | isa = PBXSourcesBuildPhase; 459 | buildActionMask = 2147483647; 460 | files = ( 461 | 71CD96491CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleMultipleAnimation.m in Sources */, 462 | 71CD964C1CAE5E2500C88825 /* DGActivityIndicatorBallZigZagAnimation.m in Sources */, 463 | 71CD96471CAE5E2500C88825 /* DGActivityIndicatorBallScaleMultipleAnimation.m in Sources */, 464 | 71CD96521CAE5E2500C88825 /* DGActivityIndicatorLineScalePartyAnimation.m in Sources */, 465 | 71CD964B1CAE5E2500C88825 /* DGActivityIndicatorBallTrianglePathAnimation.m in Sources */, 466 | 71CD965D1CAE5E2500C88825 /* DGActivityIndicatorTwoDotsAnimation.m in Sources */, 467 | 71CD964E1CAE5E2500C88825 /* DGActivityIndicatorCookieTerminatorAnimation.m in Sources */, 468 | 71CD96551CAE5E2500C88825 /* DGActivityIndicatorNineDotsAnimation.m in Sources */, 469 | 71CD963F1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateMultipleAnimation.m in Sources */, 470 | 71CD964D1CAE5E2500C88825 /* DGActivityIndicatorBallZigZagDeflectAnimation.m in Sources */, 471 | 71CD96591CAE5E2500C88825 /* DGActivityIndicatorThreeDotsAnimation.m in Sources */, 472 | 71CD965C1CAE5E2500C88825 /* DGActivityIndicatorTripleRingsAnimation.m in Sources */, 473 | 71CD96531CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutAnimation.m in Sources */, 474 | 71CD965E1CAE5E2500C88825 /* DGActivityIndicatorView.m in Sources */, 475 | 71CD963E1CAE5E2500C88825 /* DGActivityIndicatorBallClipRotateAnimation.m in Sources */, 476 | 71CD96421CAE5E2500C88825 /* DGActivityIndicatorBallGridPulseAnimation.m in Sources */, 477 | 71CD964A1CAE5E2500C88825 /* DGActivityIndicatorBallSpinFadeLoader.m in Sources */, 478 | 71CD96581CAE5E2500C88825 /* DGActivityIndicatorRotatingTrigonAnimation.m in Sources */, 479 | 71CD95CB1CAE5DF600C88825 /* ViewController.m in Sources */, 480 | 71CD96501CAE5E2500C88825 /* DGActivityIndicatorFiveDotsAnimation.m in Sources */, 481 | 71CD96441CAE5E2500C88825 /* DGActivityIndicatorBallPulseSyncAnimation.m in Sources */, 482 | 71CD963D1CAE5E2500C88825 /* DGActivityIndicatorBallBeatAnimation.m in Sources */, 483 | 71CD96431CAE5E2500C88825 /* DGActivityIndicatorBallPulseAnimation.m in Sources */, 484 | 71CD965A1CAE5E2500C88825 /* DGActivityIndicatorTriangleSkewSpinAnimation.m in Sources */, 485 | 71CD96511CAE5E2500C88825 /* DGActivityIndicatorLineScaleAnimation.m in Sources */, 486 | 71CD96461CAE5E2500C88825 /* DGActivityIndicatorBallScaleAnimation.m in Sources */, 487 | 71CD96481CAE5E2500C88825 /* DGActivityIndicatorBallScaleRippleAnimation.m in Sources */, 488 | 71CD95C81CAE5DF600C88825 /* AppDelegate.m in Sources */, 489 | 71CD96401CAE5E2500C88825 /* DGActivityIndicatorBallClipRotatePulseAnimation.m in Sources */, 490 | 71CD965B1CAE5E2500C88825 /* DGActivityIndicatorTriplePulseAnimation.m in Sources */, 491 | 71CD95C51CAE5DF600C88825 /* main.m in Sources */, 492 | 71CD96541CAE5E2500C88825 /* DGActivityIndicatorLineScalePulseOutRapidAnimation.m in Sources */, 493 | 71CD964F1CAE5E2500C88825 /* DGActivityIndicatorDoubleBounceAnimation.m in Sources */, 494 | 71CD96451CAE5E2500C88825 /* DGActivityIndicatorBallRotateAnimation.m in Sources */, 495 | 71CD96571CAE5E2500C88825 /* DGActivityIndicatorRotatingSquaresAnimation.m in Sources */, 496 | 71CD96411CAE5E2500C88825 /* DGActivityIndicatorBallGridBeatAnimation.m in Sources */, 497 | 71CD96561CAE5E2500C88825 /* DGActivityIndicatorRotatingSandglassAnimation.m in Sources */, 498 | ); 499 | runOnlyForDeploymentPostprocessing = 0; 500 | }; 501 | 71CD95D51CAE5DF600C88825 /* Sources */ = { 502 | isa = PBXSourcesBuildPhase; 503 | buildActionMask = 2147483647; 504 | files = ( 505 | 71CD95DE1CAE5DF600C88825 /* YTLoadingAnimationDemoTests.m in Sources */, 506 | ); 507 | runOnlyForDeploymentPostprocessing = 0; 508 | }; 509 | 71CD95E01CAE5DF600C88825 /* Sources */ = { 510 | isa = PBXSourcesBuildPhase; 511 | buildActionMask = 2147483647; 512 | files = ( 513 | 71CD95E91CAE5DF600C88825 /* YTLoadingAnimationDemoUITests.m in Sources */, 514 | ); 515 | runOnlyForDeploymentPostprocessing = 0; 516 | }; 517 | /* End PBXSourcesBuildPhase section */ 518 | 519 | /* Begin PBXTargetDependency section */ 520 | 71CD95DB1CAE5DF600C88825 /* PBXTargetDependency */ = { 521 | isa = PBXTargetDependency; 522 | target = 71CD95BF1CAE5DF600C88825 /* YTLoadingAnimationDemo */; 523 | targetProxy = 71CD95DA1CAE5DF600C88825 /* PBXContainerItemProxy */; 524 | }; 525 | 71CD95E61CAE5DF600C88825 /* PBXTargetDependency */ = { 526 | isa = PBXTargetDependency; 527 | target = 71CD95BF1CAE5DF600C88825 /* YTLoadingAnimationDemo */; 528 | targetProxy = 71CD95E51CAE5DF600C88825 /* PBXContainerItemProxy */; 529 | }; 530 | /* End PBXTargetDependency section */ 531 | 532 | /* Begin PBXVariantGroup section */ 533 | 71CD95CC1CAE5DF600C88825 /* Main.storyboard */ = { 534 | isa = PBXVariantGroup; 535 | children = ( 536 | 71CD95CD1CAE5DF600C88825 /* Base */, 537 | ); 538 | name = Main.storyboard; 539 | sourceTree = ""; 540 | }; 541 | 71CD95D11CAE5DF600C88825 /* LaunchScreen.storyboard */ = { 542 | isa = PBXVariantGroup; 543 | children = ( 544 | 71CD95D21CAE5DF600C88825 /* Base */, 545 | ); 546 | name = LaunchScreen.storyboard; 547 | sourceTree = ""; 548 | }; 549 | /* End PBXVariantGroup section */ 550 | 551 | /* Begin XCBuildConfiguration section */ 552 | 71CD95EB1CAE5DF600C88825 /* Debug */ = { 553 | isa = XCBuildConfiguration; 554 | buildSettings = { 555 | ALWAYS_SEARCH_USER_PATHS = NO; 556 | CLANG_ANALYZER_NONNULL = YES; 557 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 558 | CLANG_CXX_LIBRARY = "libc++"; 559 | CLANG_ENABLE_MODULES = YES; 560 | CLANG_ENABLE_OBJC_ARC = YES; 561 | CLANG_WARN_BOOL_CONVERSION = YES; 562 | CLANG_WARN_CONSTANT_CONVERSION = YES; 563 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 564 | CLANG_WARN_EMPTY_BODY = YES; 565 | CLANG_WARN_ENUM_CONVERSION = YES; 566 | CLANG_WARN_INT_CONVERSION = YES; 567 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 568 | CLANG_WARN_UNREACHABLE_CODE = YES; 569 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 570 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 571 | COPY_PHASE_STRIP = NO; 572 | DEBUG_INFORMATION_FORMAT = dwarf; 573 | ENABLE_STRICT_OBJC_MSGSEND = YES; 574 | ENABLE_TESTABILITY = YES; 575 | GCC_C_LANGUAGE_STANDARD = gnu99; 576 | GCC_DYNAMIC_NO_PIC = NO; 577 | GCC_NO_COMMON_BLOCKS = YES; 578 | GCC_OPTIMIZATION_LEVEL = 0; 579 | GCC_PREPROCESSOR_DEFINITIONS = ( 580 | "DEBUG=1", 581 | "$(inherited)", 582 | ); 583 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 584 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 585 | GCC_WARN_UNDECLARED_SELECTOR = YES; 586 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 587 | GCC_WARN_UNUSED_FUNCTION = YES; 588 | GCC_WARN_UNUSED_VARIABLE = YES; 589 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 590 | MTL_ENABLE_DEBUG_INFO = YES; 591 | ONLY_ACTIVE_ARCH = YES; 592 | SDKROOT = iphoneos; 593 | TARGETED_DEVICE_FAMILY = "1,2"; 594 | }; 595 | name = Debug; 596 | }; 597 | 71CD95EC1CAE5DF600C88825 /* Release */ = { 598 | isa = XCBuildConfiguration; 599 | buildSettings = { 600 | ALWAYS_SEARCH_USER_PATHS = NO; 601 | CLANG_ANALYZER_NONNULL = YES; 602 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 603 | CLANG_CXX_LIBRARY = "libc++"; 604 | CLANG_ENABLE_MODULES = YES; 605 | CLANG_ENABLE_OBJC_ARC = YES; 606 | CLANG_WARN_BOOL_CONVERSION = YES; 607 | CLANG_WARN_CONSTANT_CONVERSION = YES; 608 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 609 | CLANG_WARN_EMPTY_BODY = YES; 610 | CLANG_WARN_ENUM_CONVERSION = YES; 611 | CLANG_WARN_INT_CONVERSION = YES; 612 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 613 | CLANG_WARN_UNREACHABLE_CODE = YES; 614 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 615 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 616 | COPY_PHASE_STRIP = NO; 617 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 618 | ENABLE_NS_ASSERTIONS = NO; 619 | ENABLE_STRICT_OBJC_MSGSEND = YES; 620 | GCC_C_LANGUAGE_STANDARD = gnu99; 621 | GCC_NO_COMMON_BLOCKS = YES; 622 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 623 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 624 | GCC_WARN_UNDECLARED_SELECTOR = YES; 625 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 626 | GCC_WARN_UNUSED_FUNCTION = YES; 627 | GCC_WARN_UNUSED_VARIABLE = YES; 628 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 629 | MTL_ENABLE_DEBUG_INFO = NO; 630 | SDKROOT = iphoneos; 631 | TARGETED_DEVICE_FAMILY = "1,2"; 632 | VALIDATE_PRODUCT = YES; 633 | }; 634 | name = Release; 635 | }; 636 | 71CD95EE1CAE5DF600C88825 /* Debug */ = { 637 | isa = XCBuildConfiguration; 638 | buildSettings = { 639 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 640 | INFOPLIST_FILE = YTLoadingAnimationDemo/Info.plist; 641 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 642 | PRODUCT_BUNDLE_IDENTIFIER = hzxcbkj.YTLoadingAnimationDemo; 643 | PRODUCT_NAME = "$(TARGET_NAME)"; 644 | }; 645 | name = Debug; 646 | }; 647 | 71CD95EF1CAE5DF600C88825 /* Release */ = { 648 | isa = XCBuildConfiguration; 649 | buildSettings = { 650 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 651 | INFOPLIST_FILE = YTLoadingAnimationDemo/Info.plist; 652 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 653 | PRODUCT_BUNDLE_IDENTIFIER = hzxcbkj.YTLoadingAnimationDemo; 654 | PRODUCT_NAME = "$(TARGET_NAME)"; 655 | }; 656 | name = Release; 657 | }; 658 | 71CD95F11CAE5DF600C88825 /* Debug */ = { 659 | isa = XCBuildConfiguration; 660 | buildSettings = { 661 | BUNDLE_LOADER = "$(TEST_HOST)"; 662 | INFOPLIST_FILE = YTLoadingAnimationDemoTests/Info.plist; 663 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 664 | PRODUCT_BUNDLE_IDENTIFIER = hzxcbkj.YTLoadingAnimationDemoTests; 665 | PRODUCT_NAME = "$(TARGET_NAME)"; 666 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YTLoadingAnimationDemo.app/YTLoadingAnimationDemo"; 667 | }; 668 | name = Debug; 669 | }; 670 | 71CD95F21CAE5DF600C88825 /* Release */ = { 671 | isa = XCBuildConfiguration; 672 | buildSettings = { 673 | BUNDLE_LOADER = "$(TEST_HOST)"; 674 | INFOPLIST_FILE = YTLoadingAnimationDemoTests/Info.plist; 675 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 676 | PRODUCT_BUNDLE_IDENTIFIER = hzxcbkj.YTLoadingAnimationDemoTests; 677 | PRODUCT_NAME = "$(TARGET_NAME)"; 678 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YTLoadingAnimationDemo.app/YTLoadingAnimationDemo"; 679 | }; 680 | name = Release; 681 | }; 682 | 71CD95F41CAE5DF600C88825 /* Debug */ = { 683 | isa = XCBuildConfiguration; 684 | buildSettings = { 685 | INFOPLIST_FILE = YTLoadingAnimationDemoUITests/Info.plist; 686 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 687 | PRODUCT_BUNDLE_IDENTIFIER = hzxcbkj.YTLoadingAnimationDemoUITests; 688 | PRODUCT_NAME = "$(TARGET_NAME)"; 689 | TEST_TARGET_NAME = YTLoadingAnimationDemo; 690 | }; 691 | name = Debug; 692 | }; 693 | 71CD95F51CAE5DF600C88825 /* Release */ = { 694 | isa = XCBuildConfiguration; 695 | buildSettings = { 696 | INFOPLIST_FILE = YTLoadingAnimationDemoUITests/Info.plist; 697 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 698 | PRODUCT_BUNDLE_IDENTIFIER = hzxcbkj.YTLoadingAnimationDemoUITests; 699 | PRODUCT_NAME = "$(TARGET_NAME)"; 700 | TEST_TARGET_NAME = YTLoadingAnimationDemo; 701 | }; 702 | name = Release; 703 | }; 704 | /* End XCBuildConfiguration section */ 705 | 706 | /* Begin XCConfigurationList section */ 707 | 71CD95BB1CAE5DF600C88825 /* Build configuration list for PBXProject "YTLoadingAnimationDemo" */ = { 708 | isa = XCConfigurationList; 709 | buildConfigurations = ( 710 | 71CD95EB1CAE5DF600C88825 /* Debug */, 711 | 71CD95EC1CAE5DF600C88825 /* Release */, 712 | ); 713 | defaultConfigurationIsVisible = 0; 714 | defaultConfigurationName = Release; 715 | }; 716 | 71CD95ED1CAE5DF600C88825 /* Build configuration list for PBXNativeTarget "YTLoadingAnimationDemo" */ = { 717 | isa = XCConfigurationList; 718 | buildConfigurations = ( 719 | 71CD95EE1CAE5DF600C88825 /* Debug */, 720 | 71CD95EF1CAE5DF600C88825 /* Release */, 721 | ); 722 | defaultConfigurationIsVisible = 0; 723 | }; 724 | 71CD95F01CAE5DF600C88825 /* Build configuration list for PBXNativeTarget "YTLoadingAnimationDemoTests" */ = { 725 | isa = XCConfigurationList; 726 | buildConfigurations = ( 727 | 71CD95F11CAE5DF600C88825 /* Debug */, 728 | 71CD95F21CAE5DF600C88825 /* Release */, 729 | ); 730 | defaultConfigurationIsVisible = 0; 731 | }; 732 | 71CD95F31CAE5DF600C88825 /* Build configuration list for PBXNativeTarget "YTLoadingAnimationDemoUITests" */ = { 733 | isa = XCConfigurationList; 734 | buildConfigurations = ( 735 | 71CD95F41CAE5DF600C88825 /* Debug */, 736 | 71CD95F51CAE5DF600C88825 /* Release */, 737 | ); 738 | defaultConfigurationIsVisible = 0; 739 | }; 740 | /* End XCConfigurationList section */ 741 | }; 742 | rootObject = 71CD95B81CAE5DF600C88825 /* Project object */; 743 | } 744 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo.xcodeproj/project.xcworkspace/xcuserdata/TonyAng.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HZTonyAng/YTLoadingAnimationDemo/2dbecc607be2338ee1a82760f9ed78aa0b65ce54/YTLoadingAnimationDemo.xcodeproj/project.xcworkspace/xcuserdata/TonyAng.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /YTLoadingAnimationDemo.xcodeproj/xcuserdata/TonyAng.xcuserdatad/xcschemes/YTLoadingAnimationDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo.xcodeproj/xcuserdata/TonyAng.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | YTLoadingAnimationDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 71CD95BF1CAE5DF600C88825 16 | 17 | primary 18 | 19 | 20 | 71CD95D81CAE5DF600C88825 21 | 22 | primary 23 | 24 | 25 | 71CD95E31CAE5DF600C88825 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // YTLoadingAnimationDemo 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. 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 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // YTLoadingAnimationDemo 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 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 | self.window.backgroundColor = [UIColor whiteColor]; 21 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] init]]; 22 | 23 | [self.window makeKeyAndVisible]; 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application { 28 | // 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. 29 | // 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. 30 | } 31 | 32 | - (void)applicationDidEnterBackground:(UIApplication *)application { 33 | // 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. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | - (void)applicationWillTerminate:(UIApplication *)application { 46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/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 | } -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/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 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallBeatAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallBeatAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallBeatAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallBeatAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallBeatAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallBeatAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallBeatAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 0.7f; 15 | NSArray *beginTimes = @[@0.35f, @0.0f, @0.35f]; 16 | CGFloat circleSpacing = 2.0f; 17 | CGFloat circleSize = (size.width - circleSpacing * 2) / 3; 18 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 19 | CGFloat y = (layer.bounds.size.height - circleSize) / 2; 20 | 21 | // Scale animation 22 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 23 | 24 | scaleAnimation.duration = duration; 25 | scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 26 | scaleAnimation.values = @[@1.0f, @0.75f, @1.0f]; 27 | 28 | // Opacity animation 29 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 30 | 31 | opacityAnimation.duration = duration; 32 | opacityAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 33 | opacityAnimation.values = @[@1.0f, @0.2f, @1.0f]; 34 | 35 | // Aniamtion 36 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 37 | 38 | animation.duration = duration; 39 | animation.animations = @[scaleAnimation, opacityAnimation]; 40 | animation.repeatCount = HUGE_VALF; 41 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 42 | 43 | // Draw circles 44 | for (int i = 0; i < 3; i++) { 45 | CAShapeLayer *circle = [CAShapeLayer layer]; 46 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, circleSize, circleSize) cornerRadius:circleSize / 2]; 47 | 48 | animation.beginTime = [beginTimes[i] floatValue]; 49 | circle.fillColor = tintColor.CGColor; 50 | circle.path = circlePath.CGPath; 51 | [circle addAnimation:animation forKey:@"animation"]; 52 | circle.frame = CGRectMake(x + circleSize * i + circleSpacing * i, y, circleSize, circleSize); 53 | [layer addSublayer:circle]; 54 | } 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotateAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallClipRotateAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallClipRotateAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotateAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallClipRotateAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallClipRotateAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallClipRotateAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 0.75f; 15 | 16 | // Scale animation 17 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 18 | 19 | scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)], 20 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.6f, 0.6f, 1.0f)], 21 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)]]; 22 | scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 23 | 24 | // Rotate animation 25 | CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 26 | 27 | rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)]; 28 | rotateAnimation.keyTimes = scaleAnimation.keyTimes; 29 | 30 | // Animation 31 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 32 | 33 | animation.animations = @[scaleAnimation, rotateAnimation]; 34 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 35 | animation.duration = duration; 36 | animation.repeatCount = HUGE_VALF; 37 | 38 | // Draw ball clip 39 | CAShapeLayer *circle = [CAShapeLayer layer]; 40 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(size.width / 2, size.height / 2) radius:size.width / 2 startAngle:1.5 * M_PI endAngle:M_PI clockwise:true]; 41 | 42 | circle.path = circlePath.CGPath; 43 | circle.lineWidth = 2; 44 | circle.fillColor = nil; 45 | circle.strokeColor = tintColor.CGColor; 46 | 47 | circle.frame = CGRectMake((layer.bounds.size.width - size.width) / 2, (layer.bounds.size.height - size.height) / 2, size.width, size.height); 48 | [circle addAnimation:animation forKey:@"animation"]; 49 | [layer addSublayer:circle]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotateMultipleAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallClipRotateMultipleAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallClipRotateMultipleAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotateMultipleAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallClipRotateMultipleAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallClipRotateMultipleAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallClipRotateMultipleAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat bigDuration = 1.0f; 15 | CGFloat smallDuration = bigDuration / 2; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 17 | 18 | // Big circle 19 | { 20 | CGFloat circleSize = size.width; 21 | CAShapeLayer *circle = [CAShapeLayer layer]; 22 | UIBezierPath *circlePath = [UIBezierPath bezierPath]; 23 | 24 | [circlePath addArcWithCenter:CGPointMake(circleSize / 2, circleSize / 2) radius:circleSize / 2 startAngle:-3 * M_PI / 4 endAngle:-M_PI / 4 clockwise:true]; 25 | [circlePath moveToPoint:CGPointMake(circleSize / 2 - circleSize / 2 * cosf(M_PI / 4), circleSize / 2 + circleSize / 2 * sinf(M_PI / 4))]; 26 | [circlePath addArcWithCenter:CGPointMake(circleSize / 2, circleSize / 2) radius:circleSize / 2 startAngle:-5 * M_PI / 4 endAngle:-7 * M_PI / 4 clockwise:false]; 27 | circle.path = circlePath.CGPath; 28 | circle.lineWidth = 2; 29 | circle.fillColor = nil; 30 | circle.strokeColor = tintColor.CGColor; 31 | 32 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 33 | [circle addAnimation: [self createAnimationInDuration:bigDuration withTimingFunction:timingFunction reverse:false] forKey:@"animation"]; 34 | [layer addSublayer:circle]; 35 | } 36 | 37 | // Small circle 38 | { 39 | CGFloat circleSize = size.width / 2; 40 | CAShapeLayer *circle = [CAShapeLayer layer]; 41 | UIBezierPath *circlePath = [UIBezierPath bezierPath]; 42 | 43 | [circlePath addArcWithCenter:CGPointMake(circleSize / 2, circleSize / 2) radius:circleSize / 2 startAngle:3 * M_PI / 4 endAngle:5 * M_PI / 4 clockwise:true]; 44 | [circlePath moveToPoint:CGPointMake(circleSize / 2 + circleSize / 2 * cosf(M_PI / 4), circleSize / 2 - circleSize / 2 * sinf(M_PI / 4))]; 45 | [circlePath addArcWithCenter:CGPointMake(circleSize / 2, circleSize / 2) radius:circleSize / 2 startAngle:-M_PI / 4 endAngle:M_PI / 4 clockwise:true]; 46 | circle.path = circlePath.CGPath; 47 | circle.lineWidth = 2; 48 | circle.fillColor = nil; 49 | circle.strokeColor = tintColor.CGColor; 50 | 51 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 52 | [circle addAnimation:[self createAnimationInDuration:smallDuration withTimingFunction:timingFunction reverse:true] forKey:@"animation"]; 53 | [layer addSublayer:circle]; 54 | } 55 | } 56 | 57 | - (CAAnimation *)createAnimationInDuration:(CGFloat) duration withTimingFunction:(CAMediaTimingFunction *) timingFunction reverse:(BOOL) reverse { 58 | // Scale animation 59 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 60 | 61 | scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 62 | scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)], 63 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.6f, 0.6f, 1.0f)], 64 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)]]; 65 | scaleAnimation.duration = duration; 66 | scaleAnimation.timingFunctions = @[timingFunction, timingFunction]; 67 | 68 | // Rotate animation 69 | CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 70 | 71 | if (!reverse) { 72 | rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)]; 73 | } else { 74 | rotateAnimation.values = @[@0, @-M_PI, @(-2 * M_PI)]; 75 | } 76 | rotateAnimation.keyTimes = scaleAnimation.keyTimes; 77 | rotateAnimation.duration = duration; 78 | rotateAnimation.timingFunctions = @[timingFunction, timingFunction]; 79 | 80 | // Animation 81 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 82 | 83 | animation.animations = @[scaleAnimation, rotateAnimation]; 84 | animation.repeatCount = HUGE_VALF; 85 | animation.duration = duration; 86 | 87 | return animation; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotatePulseAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallClipRotatePulseAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallClipRotatePulseAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotatePulseAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallClipRotatePulseAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallClipRotatePulseAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallClipRotatePulseAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.0f; 15 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.09f :0.57f :0.49f :0.9f]; 16 | 17 | // Small circle 18 | { 19 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 20 | 21 | scaleAnimation.keyTimes = @[@0.0f, @0.3f, @1.0f]; 22 | scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)], 23 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.3f, 0.3f, 1.0f)], 24 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)]]; 25 | scaleAnimation.duration = duration; 26 | scaleAnimation.repeatCount = HUGE_VALF; 27 | scaleAnimation.timingFunctions = @[timingFunction, timingFunction]; 28 | 29 | CGFloat circleSize = size.width / 2; 30 | CALayer *circle = [CALayer layer]; 31 | 32 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 33 | circle.backgroundColor = tintColor.CGColor; 34 | circle.cornerRadius = circleSize / 2; 35 | [circle addAnimation:scaleAnimation forKey:@"animation"]; 36 | [layer addSublayer:circle]; 37 | } 38 | 39 | // Big circle 40 | { 41 | // Scale animation 42 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 43 | 44 | scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 45 | scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)], 46 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.6f, 0.6f, 1.0f)], 47 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)]]; 48 | scaleAnimation.duration = duration; 49 | scaleAnimation.timingFunctions = @[timingFunction, timingFunction]; 50 | 51 | // Rotate animation 52 | CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 53 | 54 | rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)]; 55 | rotateAnimation.keyTimes = scaleAnimation.keyTimes; 56 | rotateAnimation.duration = duration; 57 | rotateAnimation.timingFunctions = @[timingFunction, timingFunction]; 58 | 59 | // Animation 60 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 61 | 62 | animation.animations = @[scaleAnimation, rotateAnimation]; 63 | animation.duration = duration; 64 | animation.repeatCount = HUGE_VALF; 65 | 66 | // Draw big circle 67 | CGFloat circleSize = size.width; 68 | CAShapeLayer *circle = [CAShapeLayer layer]; 69 | UIBezierPath *circlePath = [UIBezierPath bezierPath]; 70 | 71 | [circlePath addArcWithCenter:CGPointMake(circleSize / 2, circleSize / 2) radius:circleSize / 2 startAngle:-3 * M_PI / 4 endAngle:-M_PI / 4 clockwise:true]; 72 | [circlePath moveToPoint:CGPointMake(circleSize / 2 - circleSize / 2 * cosf(M_PI / 4), circleSize / 2 + circleSize / 2 * sinf(M_PI / 4))]; 73 | [circlePath addArcWithCenter:CGPointMake(circleSize / 2, circleSize / 2) radius:circleSize / 2 startAngle:-5 * M_PI / 4 endAngle:-7 * M_PI / 4 clockwise:false]; 74 | circle.path = circlePath.CGPath; 75 | circle.lineWidth = 2; 76 | circle.fillColor = nil; 77 | circle.strokeColor = tintColor.CGColor; 78 | 79 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 80 | [circle addAnimation:animation forKey:@"animation"]; 81 | [layer addSublayer:circle]; 82 | } 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallGridBeatAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallGridBeatAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallGridBeatAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallGridBeatAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallGridBeatAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallGridBeatAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallGridBeatAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | NSArray *durations = @[@0.96f, @0.93f, @1.19f, @1.13f, @1.34f, @0.94f, @1.2f, @0.82f, @1.19f]; 15 | NSArray *timeOffsets = @[@0.36f, @0.4f, @0.68f, @0.41f, @0.71f, @-0.15f, @-0.12f, @0.01f, @0.32f]; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 17 | CGFloat circleSpacing = 2; 18 | CGFloat circleSize = (size.width - circleSpacing * 2) / 3; 19 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 20 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 21 | 22 | // Animation 23 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 24 | 25 | animation.beginTime = CACurrentMediaTime(); 26 | animation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 27 | animation.values = @[@1.0f, @0.7f, @1.0f]; 28 | animation.repeatCount = HUGE_VALF; 29 | animation.timingFunctions = @[timingFunction, timingFunction]; 30 | 31 | // Draw circle 32 | for (int i = 0; i < 3; i++) { 33 | for (int j = 0; j < 3; j++) { 34 | CALayer *circle = [self createCirleWith:circleSize color:tintColor]; 35 | 36 | animation.duration = [durations[3 * i + j] floatValue]; 37 | animation.timeOffset = [timeOffsets[3 * i + j] floatValue]; 38 | circle.frame = CGRectMake(x + circleSize * j + circleSpacing * j, y + circleSize * i + circleSpacing * i, circleSize, circleSize); 39 | [circle addAnimation:animation forKey:@"animation"]; 40 | [layer addSublayer:circle]; 41 | } 42 | } 43 | } 44 | 45 | - (CALayer *)createCirleWith:(CGFloat)size color:(UIColor *)color { 46 | CAShapeLayer *circle = [CAShapeLayer layer]; 47 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, size, size) cornerRadius:size / 2]; 48 | 49 | circle.fillColor = color.CGColor; 50 | circle.path = circlePath.CGPath; 51 | 52 | return circle; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallGridPulseAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallGridPulseAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallGridPulseAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallGridPulseAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallGridPulseAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallGridPulseAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallGridPulseAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | NSArray *durations = @[@0.72f, @1.02f, @1.28f, @1.42f, @1.45f, @1.18f, @0.87f, @1.45f, @1.06f]; 15 | NSArray *timeOffsets = @[@-0.06f, @0.25f, @-0.17f, @0.48f, @0.31f, @0.03f, @0.46f, @0.78f, @0.45f]; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 17 | CGFloat circleSpacing = 2; 18 | CGFloat circleSize = (size.width - circleSpacing * 2) / 3; 19 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 20 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 21 | 22 | // Scale animation 23 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 24 | 25 | scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 26 | scaleAnimation.values = @[@1.0f, @0.5f, @1.0f]; 27 | scaleAnimation.timingFunctions = @[timingFunction, timingFunction]; 28 | 29 | // Animation 30 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 31 | 32 | opacityAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 33 | opacityAnimation.values = @[@1.0f, @0.7f, @1.0f]; 34 | opacityAnimation.timingFunctions = @[timingFunction, timingFunction]; 35 | 36 | // Animation 37 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 38 | 39 | animation.animations = @[scaleAnimation, opacityAnimation]; 40 | animation.beginTime = CACurrentMediaTime(); 41 | animation.repeatCount = HUGE_VALF; 42 | 43 | // Draw circle 44 | for (int i = 0; i < 3; i++) { 45 | for (int j = 0; j < 3; j++) { 46 | CALayer *circle = [self createCirleWith:circleSize color:tintColor]; 47 | 48 | animation.duration = [durations[3 * i + j] floatValue]; 49 | animation.timeOffset = [timeOffsets[3 * i + j] floatValue]; 50 | circle.frame = CGRectMake(x + circleSize * j + circleSpacing * j, y + circleSize * i + circleSpacing * i, circleSize, circleSize); 51 | [circle addAnimation:animation forKey:@"animation"]; 52 | [layer addSublayer:circle]; 53 | } 54 | } 55 | } 56 | 57 | - (CALayer *)createCirleWith:(CGFloat)size color:(UIColor *)color { 58 | CAShapeLayer *circle = [CAShapeLayer layer]; 59 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, size, size) cornerRadius:size / 2]; 60 | 61 | circle.fillColor = color.CGColor; 62 | circle.path = circlePath.CGPath; 63 | 64 | return circle; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallPulseAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallPulseAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallPulseAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallPulseAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallPulseAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallPulseAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallPulseAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat circlePadding = 5.0f; 15 | CGFloat circleSize = (size.width - 2 * circlePadding) / 3; 16 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 17 | CGFloat y = (layer.bounds.size.height - circleSize) / 2; 18 | CGFloat duration = 0.75f; 19 | NSArray *timeBegins = @[@0.12f, @0.24f, @0.36f]; 20 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.2f :0.68f :0.18f :1.08f]; 21 | 22 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 23 | 24 | animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)], 25 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.3f, 0.3f, 1.0f)], 26 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)]]; 27 | animation.keyTimes = @[@0.0f, @0.3f, @1.0f]; 28 | animation.timingFunctions = @[timingFunction, timingFunction]; 29 | animation.duration = duration; 30 | animation.repeatCount = HUGE_VALF; 31 | 32 | for (int i = 0; i < 3; i++) { 33 | CALayer *circle = [CALayer layer]; 34 | 35 | circle.frame = CGRectMake(x + i * circleSize + i * circlePadding, y, circleSize, circleSize); 36 | circle.backgroundColor = tintColor.CGColor; 37 | circle.cornerRadius = circle.bounds.size.width / 2; 38 | animation.beginTime = [timeBegins[i] floatValue]; 39 | [circle addAnimation:animation forKey:@"animation"]; 40 | [layer addSublayer:circle]; 41 | } 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallPulseSyncAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallPulseSyncAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallPulseSyncAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallPulseSyncAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallPulseSyncAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallPulseSyncAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallPulseSyncAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 0.6f; 15 | NSArray *beginTimes = @[@0.07f, @0.14f, @0.21f]; 16 | CGFloat circleSpacing = 2.0f; 17 | CGFloat circleSize = (size.width - circleSpacing * 2) / 3; 18 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 19 | CGFloat y = (layer.bounds.size.height - circleSize) / 2; 20 | CGFloat deltaY = (size.height / 2 - circleSize / 2) / 2; 21 | CAMediaTimingFunction *timingFunciton = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 22 | 23 | // Animation 24 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"]; 25 | 26 | animation.duration = duration; 27 | animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f]; 28 | animation.values = @[@0.0f, @(deltaY), @(-deltaY), @0.0f]; 29 | animation.timingFunctions = @[timingFunciton, timingFunciton, timingFunciton]; 30 | animation.repeatCount = HUGE_VALF; 31 | 32 | // Draw circles 33 | for (int i = 0; i < 3; i++) { 34 | CAShapeLayer *circle = [CAShapeLayer layer]; 35 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, circleSize, circleSize) cornerRadius:circleSize / 2]; 36 | 37 | animation.beginTime = [beginTimes[i] floatValue]; 38 | circle.fillColor = tintColor.CGColor; 39 | circle.path = circlePath.CGPath; 40 | [circle addAnimation:animation forKey:@"animation"]; 41 | circle.frame = CGRectMake(x + circleSize * i + circleSpacing * i, y, circleSize, circleSize); 42 | [layer addSublayer:circle]; 43 | } 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallRotateAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallRotateAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallRotateAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallRotateAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallRotateAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallRotateAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallRotateAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.0f; 15 | CGFloat circleSize = size.width / 5; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.7f :-0.13f :0.22f :0.86f]; 17 | 18 | // Scale animation 19 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 20 | 21 | scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 22 | scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)], 23 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.6f, 0.6f, 1.0f)], 24 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)]]; 25 | scaleAnimation.duration = duration; 26 | scaleAnimation.timingFunctions = @[timingFunction, timingFunction]; 27 | 28 | // Rotate animation 29 | CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 30 | 31 | rotateAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 32 | rotateAnimation.values = @[@0, @-M_PI, @(-2 * M_PI)]; 33 | rotateAnimation.duration = duration; 34 | rotateAnimation.timingFunctions = @[timingFunction, timingFunction]; 35 | 36 | // Animation 37 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 38 | 39 | animation.animations = @[scaleAnimation, rotateAnimation]; 40 | animation.duration = duration; 41 | animation.repeatCount = HUGE_VALF; 42 | 43 | // Draw circles 44 | CALayer *leftCircle = [CALayer layer]; 45 | 46 | leftCircle.backgroundColor = tintColor.CGColor; 47 | leftCircle.opacity = 0.8f; 48 | leftCircle.cornerRadius = circleSize / 2; 49 | leftCircle.frame = CGRectMake(0, (size.height - circleSize) / 2, circleSize, circleSize); 50 | 51 | CALayer *rightCircle = [CALayer layer]; 52 | 53 | rightCircle.backgroundColor = tintColor.CGColor; 54 | rightCircle.opacity = 0.8f; 55 | rightCircle.cornerRadius = circleSize / 2; 56 | rightCircle.frame = CGRectMake(size.width - circleSize, (size.height - circleSize) / 2, circleSize, circleSize); 57 | 58 | CALayer *centerCircle = [CALayer layer]; 59 | 60 | centerCircle.backgroundColor = tintColor.CGColor; 61 | centerCircle.cornerRadius = circleSize / 2; 62 | centerCircle.frame = CGRectMake((size.width - circleSize) / 2, (size.height - circleSize) / 2, circleSize, circleSize); 63 | 64 | CALayer *circle = [CALayer layer]; 65 | 66 | circle.frame = CGRectMake((layer.bounds.size.width - size.width) / 2, (layer.bounds.size.height - size.height) / 2, size.width, size.height); 67 | [circle addSublayer:leftCircle]; 68 | [circle addSublayer:rightCircle]; 69 | [circle addSublayer:centerCircle]; 70 | [circle addAnimation:animation forKey:@"animation"]; 71 | [layer addSublayer:circle]; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallScaleAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallScaleAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallScaleAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.0f; 15 | 16 | // Scale animation 17 | CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 18 | 19 | scaleAnimation.duration = duration; 20 | scaleAnimation.fromValue = @0.0f; 21 | scaleAnimation.toValue = @1.0f; 22 | 23 | // Opacity animation 24 | CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; 25 | 26 | opacityAnimation.duration = duration; 27 | opacityAnimation.fromValue = @1.0f; 28 | opacityAnimation.toValue = @0.0f; 29 | 30 | // Animation 31 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 32 | 33 | animation.animations = @[scaleAnimation, opacityAnimation]; 34 | animation.duration = duration; 35 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 36 | animation.repeatCount = HUGE_VALF; 37 | 38 | // Draw circle 39 | CAShapeLayer *circle = [CAShapeLayer layer]; 40 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect: CGRectMake(0, 0, size.width, size.height) cornerRadius:size.width / 2]; 41 | 42 | circle.fillColor = tintColor.CGColor; 43 | circle.path = circlePath.CGPath; 44 | [circle addAnimation:animation forKey:@"animation"]; 45 | circle.frame = CGRectMake((layer.bounds.size.width - size.width) / 2, (layer.bounds.size.height - size.height) / 2, size.width, size.height); 46 | [layer addSublayer:circle]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleMultipleAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleMultipleAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallScaleMultipleAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleMultipleAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleMultipleAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallScaleMultipleAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallScaleMultipleAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.0f; 15 | NSArray *beginTimes = @[@0.0f, @0.2f, @0.4f]; 16 | 17 | // Scale animation 18 | CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 19 | 20 | scaleAnimation.duration = duration; 21 | scaleAnimation.fromValue = @0.0f; 22 | scaleAnimation.toValue = @1.0f; 23 | 24 | // Opacity animation 25 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 26 | 27 | opacityAnimation.duration = duration; 28 | opacityAnimation.keyTimes = @[@0.0f, @0.05f, @1.0f]; 29 | opacityAnimation.values = @[@0.0f, @1.0f, @0.0f]; 30 | 31 | // Animation 32 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 33 | 34 | animation.animations = @[scaleAnimation, opacityAnimation]; 35 | animation.duration = duration; 36 | animation.repeatCount = HUGE_VALF; 37 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 38 | 39 | for (int i = 0; i < 3; i++) { 40 | CAShapeLayer *circle = [CAShapeLayer layer]; 41 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, size.width, size.height) cornerRadius:size.width / 2]; 42 | 43 | animation.beginTime = [beginTimes[i] floatValue]; 44 | circle.fillColor = tintColor.CGColor; 45 | circle.path = circlePath.CGPath; 46 | circle.opacity = 0.0f; 47 | [circle addAnimation:animation forKey:@"animation"]; 48 | circle.frame = CGRectMake((layer.bounds.size.width - size.width) / 2, (layer.bounds.size.height - size.height) / 2, size.width, size.height); 49 | [layer addSublayer:circle]; 50 | } 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleRippleAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleTrippleAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallScaleRippleAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleRippleAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleTrippleAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallScaleRippleAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallScaleRippleAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.0f; 15 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.21f :0.53f :0.56f :0.8f]; 16 | 17 | // Scale animation 18 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 19 | 20 | scaleAnimation.duration = duration; 21 | scaleAnimation.keyTimes = @[@0.0f, @0.7f]; 22 | scaleAnimation.values = @[@0.1f, @1.0f]; 23 | scaleAnimation.timingFunction = timingFunction; 24 | 25 | // Opacity animation 26 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 27 | 28 | opacityAnimation.duration = duration; 29 | opacityAnimation.keyTimes = @[@0.0f, @0.7f, @1.0f]; 30 | opacityAnimation.values = @[@1.0f, @0.7f, @0.0f]; 31 | opacityAnimation.timingFunctions = @[timingFunction, timingFunction]; 32 | 33 | // Animation 34 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 35 | 36 | animation.animations = @[scaleAnimation, opacityAnimation]; 37 | animation.duration = duration; 38 | animation.repeatCount = HUGE_VALF; 39 | 40 | // Draw circle 41 | CAShapeLayer *circle = [CAShapeLayer layer]; 42 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, size.width, size.height) cornerRadius:size.width / 2]; 43 | 44 | circle.fillColor = nil; 45 | circle.lineWidth = 2; 46 | circle.strokeColor = tintColor.CGColor; 47 | circle.path = circlePath.CGPath; 48 | [circle addAnimation:animation forKey:@"animation"]; 49 | circle.frame = CGRectMake((layer.bounds.size.width - size.width) / 2, (layer.bounds.size.height - size.height) / 2, size.width, size.height); 50 | [layer addSublayer:circle]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleRippleMultipleAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleRippleMultipleAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallScaleRippleMultipleAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleRippleMultipleAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallScaleRippleMultipleAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallScaleRippleMultipleAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallScaleRippleMultipleAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.25f; 15 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.21f :0.53f :0.56f :0.8f]; 16 | NSArray *timeOffsets = @[@0.0f, @0.2f, @0.4f]; 17 | 18 | // Scale animation 19 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 20 | 21 | scaleAnimation.duration = duration; 22 | scaleAnimation.keyTimes = @[@0.0f, @0.7f]; 23 | scaleAnimation.values = @[@0.1f, @1.0f]; 24 | scaleAnimation.timingFunction = timingFunction; 25 | 26 | // Opacity animation 27 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 28 | 29 | opacityAnimation.duration = duration; 30 | opacityAnimation.keyTimes = @[@0.0f, @0.7f, @1.0f]; 31 | opacityAnimation.values = @[@1.0f, @0.7f, @0.0f]; 32 | opacityAnimation.timingFunctions = @[timingFunction, timingFunction]; 33 | 34 | // Animation 35 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 36 | 37 | animation.animations = @[scaleAnimation, opacityAnimation]; 38 | animation.duration = duration; 39 | animation.repeatCount = HUGE_VALF; 40 | animation.beginTime = CACurrentMediaTime(); 41 | 42 | // Draw circles 43 | for (int i = 0; i < 3; i++) { 44 | CAShapeLayer *circle = [CAShapeLayer layer]; 45 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, size.width, size.height) cornerRadius:size.width / 2]; 46 | 47 | animation.timeOffset = [timeOffsets[i] floatValue]; 48 | circle.fillColor = nil; 49 | circle.lineWidth = 2; 50 | circle.strokeColor = tintColor.CGColor; 51 | circle.path = circlePath.CGPath; 52 | [circle addAnimation:animation forKey:@"animation"]; 53 | circle.frame = CGRectMake((layer.bounds.size.width - size.width) / 2, (layer.bounds.size.height - size.height) / 2, size.width, size.height); 54 | [layer addSublayer:circle]; 55 | } 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallSpinFadeLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallSpinFadeLoader.h 3 | // CheeseDigest 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallSpinFadeLoader : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallSpinFadeLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallSpinFadeLoader.m 3 | // CheeseDigest 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallSpinFadeLoader.h" 10 | 11 | @implementation DGActivityIndicatorBallSpinFadeLoader 12 | 13 | 14 | #pragma mark - 15 | #pragma mark DGActivityIndicatorAnimation Protocol 16 | 17 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 18 | 19 | CGFloat circleSpacing = -2; 20 | CGFloat circleSize = (size.width - 4 * circleSpacing) / 5; 21 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 22 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 23 | 24 | CFTimeInterval duration = 1; 25 | NSTimeInterval beginTime = CACurrentMediaTime(); 26 | 27 | NSArray *beginTimes = @[@0, @0.12, @0.24, @0.36, @0.48, @0.6, @0.72, @0.84]; 28 | 29 | CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 30 | 31 | scaleAnimation.keyTimes = @[@0, @0.5, @1]; 32 | scaleAnimation.values = @[@1, @0.4, @1]; 33 | scaleAnimation.duration = duration; 34 | 35 | 36 | CAKeyframeAnimation *opacityAnimaton = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 37 | 38 | 39 | opacityAnimaton.keyTimes = @[@0, @0.5, @1]; 40 | opacityAnimaton.values = @[@1, @0.3, @1]; 41 | opacityAnimaton.duration = duration; 42 | 43 | 44 | 45 | 46 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 47 | animationGroup.animations = @[scaleAnimation, opacityAnimaton]; 48 | animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 49 | animationGroup.duration = duration; 50 | animationGroup.repeatCount = HUGE; 51 | animationGroup.removedOnCompletion = NO; 52 | 53 | 54 | for (int i = 0; i < 8; i++) { 55 | CALayer *circle = [self circleLayer:(M_PI_4 * i) size:circleSize origin:CGPointMake(x, y) containerSize:size color:tintColor]; 56 | animationGroup.beginTime = beginTime + [beginTimes[i] doubleValue]; 57 | 58 | [layer addSublayer:circle]; 59 | [circle addAnimation:animationGroup forKey:@"animation"]; 60 | } 61 | 62 | } 63 | 64 | 65 | - (CALayer *)circleLayer:(CGFloat)angle size:(CGFloat)size origin:(CGPoint)origin containerSize:(CGSize)containerSize color:(UIColor *)color{ 66 | CGFloat radius = containerSize.width/2; 67 | CALayer *circle = [self createLayerWith:CGSizeMake(size, size) color:color]; 68 | CGRect frame = CGRectMake((origin.x + radius * (cos(angle) + 1) - size / 2), origin.y + radius * (sin(angle) + 1) - size / 2, size, size); 69 | circle.frame = frame; 70 | 71 | return circle; 72 | } 73 | 74 | - (CALayer *)createLayerWith:(CGSize)size color:(UIColor *)color{ 75 | CAShapeLayer *layer = [CAShapeLayer layer]; 76 | UIBezierPath *path = [UIBezierPath bezierPath]; 77 | 78 | [path addArcWithCenter:CGPointMake(size.width / 2,size.height / 2) radius:(size.width / 2) startAngle:0 endAngle:2 * M_PI clockwise:NO]; 79 | layer.fillColor = color.CGColor; 80 | layer.backgroundColor = nil; 81 | layer.path = path.CGPath; 82 | 83 | return layer; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallTrianglePathAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallTrianglePathAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallTrianglePathAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallTrianglePathAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallTrianglePathAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallTrianglePathAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallTrianglePathAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 2.0f; 15 | CGFloat circleSize = size.width / 5; 16 | CGFloat deltaX = size.width / 2 - circleSize / 2; 17 | CGFloat deltaY = size.height / 2 - circleSize / 2; 18 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 19 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 20 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 21 | 22 | // Animation 23 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 24 | 25 | animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f]; 26 | animation.duration = duration; 27 | animation.timingFunctions = @[timingFunction, timingFunction, timingFunction]; 28 | animation.repeatCount = HUGE_VALF; 29 | 30 | // Top-center circle 31 | CALayer *topCenterCircle = [self createCircleWithSize:circleSize color:tintColor]; 32 | 33 | [self changeAnimation:animation values:@[@"{0,0}", @"{hx,fy}", @"{-hx,fy}", @"{0,0}"] deltaX:deltaX deltaY:deltaY]; 34 | topCenterCircle.frame = CGRectMake(x + size.width / 2 - circleSize / 2, y, circleSize, circleSize); 35 | [topCenterCircle addAnimation:animation forKey:@"animation"]; 36 | [layer addSublayer:topCenterCircle]; 37 | 38 | // Bottom-left circle 39 | CALayer *bottomLeftCircle = [self createCircleWithSize:circleSize color:tintColor]; 40 | 41 | [self changeAnimation:animation values:@[@"{0,0}", @"{hx,-fy}", @"{fx,0}", @"{0,0}"] deltaX:deltaX deltaY:deltaY]; 42 | bottomLeftCircle.frame = CGRectMake(x, y + size.height - circleSize, circleSize, circleSize); 43 | [bottomLeftCircle addAnimation:animation forKey:@"animation"]; 44 | [layer addSublayer:bottomLeftCircle]; 45 | 46 | // Bottom-right circle 47 | CALayer *bottomRigthCircle = [self createCircleWithSize:circleSize color:tintColor]; 48 | 49 | [self changeAnimation:animation values:@[@"{0,0}", @"{-fx,0}", @"{-hx,-fy}", @"{0,0}"] deltaX:deltaX deltaY:deltaY]; 50 | bottomRigthCircle.frame = CGRectMake(x + size.width - circleSize, y + size.height - circleSize, circleSize, circleSize); 51 | [bottomRigthCircle addAnimation:animation forKey:@"animation"]; 52 | [layer addSublayer:bottomRigthCircle]; 53 | } 54 | 55 | - (CALayer *)createCircleWithSize:(CGFloat)size color:(UIColor *)color { 56 | CAShapeLayer *circle = [CAShapeLayer layer]; 57 | UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, size, size) cornerRadius:size / 2]; 58 | 59 | circle.fillColor = nil; 60 | circle.strokeColor = color.CGColor; 61 | circle.lineWidth = 1; 62 | circle.path = circlePath.CGPath; 63 | 64 | return circle; 65 | } 66 | 67 | - (CAAnimation *)changeAnimation:(CAKeyframeAnimation *)animation values:(NSArray *)rawValues deltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY { 68 | NSMutableArray *values = [NSMutableArray arrayWithCapacity:5]; 69 | 70 | for (NSString *rawValue in rawValues) { 71 | CGPoint point = CGPointFromString([self translate:rawValue withDeltaX:deltaX deltaY:deltaY]); 72 | 73 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeTranslation(point.x, point.y, 0)]]; 74 | } 75 | animation.values = values; 76 | 77 | return animation; 78 | } 79 | 80 | - (NSString *)translate:(NSString *)valueString withDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY { 81 | NSMutableString *valueMutableString = [NSMutableString stringWithString:valueString]; 82 | CGFloat fullDeltaX = 2 * deltaX; 83 | CGFloat fullDeltaY = 2 * deltaY; 84 | NSRange range; 85 | 86 | range.location = 0; 87 | range.length = valueString.length; 88 | 89 | [valueMutableString replaceOccurrencesOfString:@"hx" withString:[NSString stringWithFormat:@"%f", deltaX] options:NSCaseInsensitiveSearch range:range]; 90 | range.length = valueMutableString.length; 91 | [valueMutableString replaceOccurrencesOfString:@"fx" withString:[NSString stringWithFormat:@"%f", fullDeltaX] options:NSCaseInsensitiveSearch range:range]; 92 | range.length = valueMutableString.length; 93 | [valueMutableString replaceOccurrencesOfString:@"hy" withString:[NSString stringWithFormat:@"%f", deltaY] options:NSCaseInsensitiveSearch range:range]; 94 | range.length = valueMutableString.length; 95 | [valueMutableString replaceOccurrencesOfString:@"fy" withString:[NSString stringWithFormat:@"%f", fullDeltaY] options:NSCaseInsensitiveSearch range:range]; 96 | 97 | return valueMutableString; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallZigZagAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallZigZagAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallZigZagAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallZigZagAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallZigZagAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallZigZagAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallZigZagAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 0.7f; 15 | CGFloat circleSize = size.width / 5; 16 | CGFloat deltaX = size.width / 2 - circleSize / 2; 17 | CGFloat deltaY = size.height / 2 - circleSize / 2; 18 | 19 | // Circle 1 animation 20 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 21 | 22 | animation.duration = duration; 23 | animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f]; 24 | animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)], 25 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-deltaX, -deltaY, 0)], 26 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(deltaX, -deltaY, 0)], 27 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)]]; 28 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 29 | animation.repeatCount = HUGE_VALF; 30 | 31 | // Draw circle 1 32 | { 33 | CALayer *circle = [CALayer layer]; 34 | 35 | circle.backgroundColor = tintColor.CGColor; 36 | circle.cornerRadius = circleSize / 2; 37 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 38 | [circle addAnimation:animation forKey:@"animation"]; 39 | [layer addSublayer:circle]; 40 | } 41 | 42 | // Circle 2 animation 43 | animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)], 44 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(deltaX, deltaY, 0)], 45 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-deltaX, deltaY, 0)], 46 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)]]; 47 | 48 | // Draw circle 2 49 | { 50 | CALayer *circle = [CALayer layer]; 51 | 52 | circle.backgroundColor = tintColor.CGColor; 53 | circle.cornerRadius = circleSize / 2; 54 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 55 | [circle addAnimation:animation forKey:@"animation"]; 56 | [layer addSublayer:circle]; 57 | } 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallZigZagDeflectAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallZigZagDeflectAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorBallZigZagDeflectAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorBallZigZagDeflectAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorBallZigZagDeflectAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorBallZigZagDeflectAnimation.h" 10 | 11 | @implementation DGActivityIndicatorBallZigZagDeflectAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 0.75f; 15 | CGFloat circleSize = size.width / 5; 16 | CGFloat deltaX = size.width / 2 - circleSize / 2; 17 | CGFloat deltaY = size.height / 2 - circleSize / 2; 18 | 19 | // Circle 1 animation 20 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 21 | 22 | animation.duration = duration; 23 | animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f]; 24 | animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)], 25 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-deltaX, -deltaY, 0)], 26 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(deltaX, -deltaY, 0)], 27 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)]]; 28 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 29 | animation.repeatCount = HUGE_VALF; 30 | animation.autoreverses = true; 31 | 32 | // Draw circle 1 33 | { 34 | CALayer *circle = [CALayer layer]; 35 | 36 | circle.backgroundColor = tintColor.CGColor; 37 | circle.cornerRadius = circleSize / 2; 38 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 39 | [circle addAnimation:animation forKey:@"animation"]; 40 | [layer addSublayer:circle]; 41 | } 42 | 43 | // Circle 2 animation 44 | animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)], 45 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(deltaX, deltaY, 0)], 46 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-deltaX, deltaY, 0)], 47 | [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, 0, 0)]]; 48 | 49 | // Draw circle 2 50 | { 51 | CALayer *circle = [CALayer layer]; 52 | 53 | circle.backgroundColor = tintColor.CGColor; 54 | circle.cornerRadius = circleSize / 2; 55 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize) / 2, (layer.bounds.size.height - circleSize) / 2, circleSize, circleSize); 56 | [circle addAnimation:animation forKey:@"animation"]; 57 | [layer addSublayer:circle]; 58 | } 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorCookieTerminatorAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorCookieTerminatorAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorCookieTerminatorAnimation : NSObject 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorCookieTerminatorAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorCookieTerminatorAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorCookieTerminatorAnimation.h" 10 | 11 | @implementation DGActivityIndicatorCookieTerminatorAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | NSTimeInterval beginTime = CACurrentMediaTime(); 18 | 19 | CGFloat cookieTerminatorSize = ceilf(size.width / 3.0f); 20 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 21 | CGFloat oY = layer.bounds.size.height / 2.0f; 22 | CGPoint cookieTerminatorCenter = CGPointMake(oX, oY); 23 | 24 | UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:cookieTerminatorCenter radius:cookieTerminatorSize startAngle:M_PI_4 endAngle:M_PI * 1.75f clockwise:YES]; 25 | [path addLineToPoint:cookieTerminatorCenter]; 26 | [path closePath]; 27 | 28 | CAShapeLayer *cookieTerminatorLayer = [CAShapeLayer layer]; 29 | cookieTerminatorLayer.anchorPoint = CGPointMake(0.5f, 0.5f); 30 | cookieTerminatorLayer.fillColor = tintColor.CGColor; 31 | cookieTerminatorLayer.path = path.CGPath; 32 | [layer addSublayer:cookieTerminatorLayer]; 33 | 34 | path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(0.0f, 0.0f) radius:cookieTerminatorSize startAngle:M_PI_2 endAngle:M_PI * 1.5f clockwise:YES]; 35 | [path closePath]; 36 | for (int i = 0; i < 2; i++) { 37 | CAShapeLayer *jawLayer = [CAShapeLayer layer]; 38 | jawLayer.path = path.CGPath; 39 | jawLayer.fillColor = tintColor.CGColor; 40 | jawLayer.position = cookieTerminatorCenter; 41 | jawLayer.anchorPoint = CGPointMake(0.5f, 0.5f); 42 | jawLayer.opacity = 1.0f; 43 | jawLayer.transform = CATransform3DMakeRotation((1.0f - 2.0f * i) * M_PI_4, 0.0f, 0.0f, 1.0f); 44 | 45 | CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; 46 | transformAnimation.removedOnCompletion = NO; 47 | transformAnimation.beginTime = beginTime; 48 | transformAnimation.duration = 0.3f; 49 | transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation((1.0f - 2.0f * i) * M_PI_4, 0.0f, 0.0f, 1.0f)]; 50 | transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation((1.0f - 2.0f * i) * M_PI_2, 0.0f, 0.0f, 1.0f)]; 51 | transformAnimation.autoreverses = YES; 52 | transformAnimation.repeatCount = HUGE_VALF; 53 | transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut]; 54 | 55 | [layer addSublayer:jawLayer]; 56 | [jawLayer addAnimation:transformAnimation forKey:@"animation"]; 57 | } 58 | 59 | CGFloat cookieSize = ceilf(size.width / 6.0f); 60 | CGFloat cookiePadding = cookieSize * 2.0f; 61 | for (int i = 0; i < 3; i++) { 62 | CALayer *cookieLayer = [CALayer layer]; 63 | cookieLayer.frame = CGRectMake(cookieTerminatorCenter.x + (cookieSize + cookiePadding) * 3.0f - cookieTerminatorSize, oY - cookieSize / 2.0f, cookieSize, cookieSize); 64 | cookieLayer.backgroundColor = tintColor.CGColor; 65 | cookieLayer.anchorPoint = CGPointMake(0.5f, 0.5f); 66 | cookieLayer.opacity = 1.0f; 67 | cookieLayer.cornerRadius = cookieSize / 2.0f; 68 | 69 | CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; 70 | transformAnimation.duration = 1.8f; 71 | transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 3.0f); 72 | transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f)]; 73 | transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-3.0f * (cookieSize + cookiePadding), 0.0f, 0.0f)]; 74 | transformAnimation.repeatCount = HUGE_VALF; 75 | transformAnimation.removedOnCompletion = NO; 76 | transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]; 77 | 78 | [layer addSublayer:cookieLayer]; 79 | [cookieLayer addAnimation:transformAnimation forKey:@"animation"]; 80 | } 81 | } 82 | @end 83 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorDoubleBounceAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorDoubleBounceAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorDoubleBounceAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorDoubleBounceAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorDoubleBounceAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorDoubleBounceAnimation.h" 10 | 11 | @implementation DGActivityIndicatorDoubleBounceAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | NSTimeInterval beginTime = CACurrentMediaTime(); 18 | 19 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 20 | CGFloat oY = (layer.bounds.size.height - size.height) / 2.0f; 21 | for (int i = 0; i < 2; i++) { 22 | CALayer *circle = [CALayer layer]; 23 | circle.frame = CGRectMake(oX, oY, size.width, size.height); 24 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 25 | circle.opacity = 0.5f; 26 | circle.cornerRadius = size.height / 2.0f; 27 | circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f); 28 | circle.backgroundColor = tintColor.CGColor; 29 | 30 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 31 | transformAnimation.removedOnCompletion = NO; 32 | transformAnimation.repeatCount = HUGE_VALF; 33 | transformAnimation.duration = 2.0f; 34 | transformAnimation.beginTime = beginTime - (1.0f * i); 35 | transformAnimation.keyTimes = @[@(0.0f), @(0.5f), @(1.0f)]; 36 | 37 | transformAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 38 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 39 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 40 | 41 | transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.0f, 0.0f)], 42 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)], 43 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.0f, 0.0f)]]; 44 | 45 | [layer addSublayer:circle]; 46 | [circle addAnimation:transformAnimation forKey:@"animation"]; 47 | } 48 | 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorFiveDotsAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorFiveDotsAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorFiveDotsAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorFiveDotsAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorFiveDotsAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorFiveDotsAnimation.h" 10 | 11 | @implementation DGActivityIndicatorFiveDotsAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | NSTimeInterval beginTime = CACurrentMediaTime(); 18 | 19 | CGFloat circleSize = size.width / 5.0f; 20 | 21 | CGFloat oX = (layer.bounds.size.width - circleSize * 5) / 2.0f; 22 | CGFloat oY = (layer.bounds.size.height - circleSize) / 2.0f; 23 | for (int i = 0; i < 3; i++) { 24 | CALayer *circle = [CALayer layer]; 25 | circle.frame = CGRectMake(oX + circleSize * 2 * i, oY, circleSize, circleSize); 26 | circle.backgroundColor = tintColor.CGColor; 27 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 28 | circle.opacity = 1.0f; 29 | circle.cornerRadius = circle.bounds.size.height / 2.0f; 30 | 31 | CATransform3D t1 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 32 | t1 = CATransform3DScale(t1, 1.0f, 1.0f, 0.0f); 33 | 34 | CATransform3D t2 = CATransform3DMakeTranslation(0.0f, -2 * circleSize, 0.0f); 35 | t2 = CATransform3DScale(t2, 1.0f, 1.0f, 0.0f); 36 | 37 | CATransform3D t3 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 38 | t3 = CATransform3DScale(t3, 0.3f, 0.3f, 0.0f); 39 | 40 | CATransform3D t4 = CATransform3DMakeTranslation(0.0f, 2 * circleSize, 0.0f); 41 | t4 = CATransform3DScale(t4, 1.0f, 1.0f, 0.0f); 42 | 43 | CATransform3D t5 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 44 | t5 = CATransform3DScale(t5, 1.f, 1.0f, 0.0f); 45 | 46 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 47 | transformAnimation.values = @[[NSValue valueWithCATransform3D:t1], 48 | [NSValue valueWithCATransform3D:t2], 49 | [NSValue valueWithCATransform3D:t3], 50 | [NSValue valueWithCATransform3D:t4], 51 | [NSValue valueWithCATransform3D:t5]]; 52 | transformAnimation.removedOnCompletion = NO; 53 | transformAnimation.beginTime = beginTime; 54 | transformAnimation.repeatCount = HUGE_VALF; 55 | transformAnimation.duration = 1.0f; 56 | transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 57 | 58 | [layer addSublayer:circle]; 59 | [circle addAnimation:transformAnimation forKey:@"animation"]; 60 | } 61 | 62 | for (int i = 0; i < 2; i++) { 63 | CALayer *circle = [CALayer layer]; 64 | circle.frame = CGRectMake((layer.bounds.size.width - circleSize * 5) / 2.0f + circleSize + circleSize * 2 * i, (layer.bounds.size.height - circleSize) / 2.0f, circleSize, circleSize); 65 | circle.backgroundColor = tintColor.CGColor; 66 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 67 | circle.opacity = 1.0f; 68 | circle.cornerRadius = circle.bounds.size.height / 2.0f; 69 | 70 | CATransform3D t1 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 71 | t1 = CATransform3DScale(t1, 0.3f, 0.3f, 0.0f); 72 | 73 | CATransform3D t2 = CATransform3DMakeTranslation(0.0f, 2 * circleSize, 0.0f); 74 | t2 = CATransform3DScale(t2, 1.0f, 1.0f, 0.0f); 75 | 76 | CATransform3D t3 = CATransform3DMakeTranslation(0.0f, -2 * circleSize, 0.0f); 77 | t3 = CATransform3DScale(t3, 1.f, 1.0f, 0.0f); 78 | 79 | CATransform3D t4 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 80 | t4 = CATransform3DScale(t4, 0.3f, 0.3f, 0.0f); 81 | 82 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 83 | transformAnimation.values = @[[NSValue valueWithCATransform3D:t1], 84 | [NSValue valueWithCATransform3D:t2], 85 | [NSValue valueWithCATransform3D:t3], 86 | [NSValue valueWithCATransform3D:t4]]; 87 | transformAnimation.keyTimes = @[@(0.0f), @(0.25f), @(0.75f), @(1.0f)]; 88 | transformAnimation.removedOnCompletion = NO; 89 | transformAnimation.beginTime = beginTime; 90 | transformAnimation.repeatCount = HUGE_VALF; 91 | transformAnimation.duration = 1.0f; 92 | transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 93 | 94 | [layer addSublayer:circle]; 95 | [circle addAnimation:transformAnimation forKey:@"animation"]; 96 | } 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScaleAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScaleAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorLineScaleAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScaleAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScaleAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorLineScaleAnimation.h" 10 | 11 | @implementation DGActivityIndicatorLineScaleAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.0f; 15 | NSArray *beginTimes = @[@0.1f, @0.2f, @0.3f, @0.4f, @0.5f]; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.2f :0.68f :0.18f :1.08f]; 17 | CGFloat lineSize = size.width / 9; 18 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 19 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 20 | 21 | // Animation 22 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale.y"]; 23 | 24 | animation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 25 | animation.values = @[@1.0f, @0.4f, @1.0f]; 26 | animation.timingFunctions = @[timingFunction, timingFunction]; 27 | animation.repeatCount = HUGE_VALF; 28 | animation.duration = duration; 29 | 30 | for (int i = 0; i < 5; i++) { 31 | CAShapeLayer *line = [CAShapeLayer layer]; 32 | UIBezierPath *linePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, lineSize, size.height) cornerRadius:lineSize / 2]; 33 | 34 | animation.beginTime = [beginTimes[i] floatValue]; 35 | line.fillColor = tintColor.CGColor; 36 | line.path = linePath.CGPath; 37 | [line addAnimation:animation forKey:@"animation"]; 38 | line.frame = CGRectMake(x + lineSize * 2 * i, y, lineSize, size.height); 39 | [layer addSublayer:line]; 40 | } 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScalePartyAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScalePartyAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorLineScalePartyAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScalePartyAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScalePartyAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorLineScalePartyAnimation.h" 10 | 11 | @implementation DGActivityIndicatorLineScalePartyAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | NSArray *durations = @[@1.26f, @0.43f, @1.01f, @0.73f]; 15 | NSArray *beginTimes = @[@0.77f, @0.29f, @0.28f, @0.74f]; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 17 | CGFloat lineSize = size.width / 7; 18 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 19 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 20 | 21 | // Animation 22 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 23 | 24 | animation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 25 | animation.values = @[@1.0f, @0.5f, @1.0f]; 26 | animation.timingFunctions = @[timingFunction, timingFunction]; 27 | animation.repeatCount = HUGE_VALF; 28 | 29 | for (int i = 0; i < 4; i++) { 30 | CAShapeLayer *line = [CAShapeLayer layer]; 31 | UIBezierPath *linePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, lineSize, size.height) cornerRadius:lineSize / 2]; 32 | 33 | animation.duration = [durations[i] floatValue]; 34 | animation.beginTime = [beginTimes[i] floatValue]; 35 | line.fillColor = tintColor.CGColor; 36 | line.path = linePath.CGPath; 37 | [line addAnimation:animation forKey:@"animation"]; 38 | line.frame = CGRectMake(x + lineSize * 2 * i, y, lineSize, size.height); 39 | [layer addSublayer:line]; 40 | } 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScalePulseOutAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScalePulseOutAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorLineScalePulseOutAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScalePulseOutAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScalePulseOutAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorLineScalePulseOutAnimation.h" 10 | 11 | @implementation DGActivityIndicatorLineScalePulseOutAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 1.0f; 15 | NSArray *beginTimes = @[@0.4f, @0.2f, @0.0f, @0.2f, @0.4f]; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.85f :0.25f :0.37f :0.85f]; 17 | CGFloat lineSize = size.width / 9; 18 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 19 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 20 | 21 | // Animation 22 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale.y"]; 23 | 24 | animation.keyTimes = @[@0.0f, @0.5f, @1.0f]; 25 | animation.values = @[@1.0f, @0.4f, @1.0f]; 26 | animation.timingFunctions = @[timingFunction, timingFunction]; 27 | animation.repeatCount = HUGE_VALF; 28 | animation.duration = duration; 29 | 30 | for (int i = 0; i < 5; i++) { 31 | CAShapeLayer *line = [CAShapeLayer layer]; 32 | UIBezierPath *linePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, lineSize, size.height) cornerRadius:lineSize / 2]; 33 | 34 | animation.beginTime = [beginTimes[i] floatValue]; 35 | line.fillColor = tintColor.CGColor; 36 | line.path = linePath.CGPath; 37 | [line addAnimation:animation forKey:@"animation"]; 38 | line.frame = CGRectMake(x + lineSize * 2 * i, y, lineSize, size.height); 39 | [layer addSublayer:line]; 40 | } 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScalePulseOutRapidAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScalePulseOutRapidAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorLineScalePulseOutRapidAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorLineScalePulseOutRapidAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorLineScalePulseOutRapidAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorLineScalePulseOutRapidAnimation.h" 10 | 11 | @implementation DGActivityIndicatorLineScalePulseOutRapidAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 0.9f; 15 | NSArray *beginTimes = @[@0.5f, @0.25f, @0.0f, @0.25f, @0.5f]; 16 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.11f :0.49f :0.38f :0.78f]; 17 | CGFloat lineSize = size.width / 9; 18 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 19 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 20 | 21 | // Animation 22 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale.y"]; 23 | 24 | animation.keyTimes = @[@0.0f, @0.8f, @0.9f]; 25 | animation.values = @[@1.0f, @0.3f, @1.0f]; 26 | animation.timingFunctions = @[timingFunction, timingFunction]; 27 | animation.repeatCount = HUGE_VALF; 28 | animation.duration = duration; 29 | 30 | for (int i = 0; i < 5; i++) { 31 | CAShapeLayer *line = [CAShapeLayer layer]; 32 | UIBezierPath *linePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, lineSize, size.height) cornerRadius:lineSize / 2]; 33 | 34 | animation.beginTime = [beginTimes[i] floatValue]; 35 | line.fillColor = tintColor.CGColor; 36 | line.path = linePath.CGPath; 37 | [line addAnimation:animation forKey:@"animation"]; 38 | line.frame = CGRectMake(x + lineSize * 2 * i, y, lineSize, size.height); 39 | [layer addSublayer:line]; 40 | } 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorNineDotsAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorNineDotsAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorNineDotsAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorNineDotsAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorNineDotsAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorNineDotsAnimation.h" 10 | 11 | @implementation DGActivityIndicatorNineDotsAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | NSTimeInterval beginTime = CACurrentMediaTime(); 18 | 19 | CGFloat circleSize = size.width / 4.0f; 20 | CGFloat circlePadding = circleSize / 2.0f; 21 | 22 | CGFloat oX = (layer.bounds.size.width - circleSize * 3 - circlePadding * 2) / 2.0f; 23 | CGFloat oY = (layer.bounds.size.height - circleSize * 3 - circlePadding * 2) / 2.0f; 24 | 25 | NSArray *timeOffsets = @[@(0.11f), @(0.42f), @(0.0f), 26 | @(0.65f), @(0.48f), @(0.2f), 27 | @(0.63f), @(0.95f), @(0.62f)]; 28 | NSArray *durations = @[@(0.72f), @(1.02f), @(1.28f), 29 | @(1.42f), @(1.45f), @(1.18f), 30 | @(0.87f), @(1.45f), @(1.06f)]; 31 | 32 | for (int i = 0; i < MIN(timeOffsets.count, durations.count); i++) { 33 | CALayer *circle = [CALayer layer]; 34 | circle.frame = CGRectMake(oX + (circleSize + circlePadding) * (i % 3), oY + (circleSize + circlePadding) * (int)(i / 3), circleSize, circleSize); 35 | circle.backgroundColor = tintColor.CGColor; 36 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 37 | circle.opacity = 1.0f; 38 | circle.cornerRadius = circle.bounds.size.height / 2.0f; 39 | 40 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 41 | transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)], 42 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)], 43 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)]]; 44 | 45 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 46 | opacityAnimation.values = @[@(0.5f), @(1.0f), @(0.5f)]; 47 | 48 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 49 | animationGroup.removedOnCompletion = NO; 50 | animationGroup.beginTime = beginTime; 51 | animationGroup.repeatCount = HUGE_VALF; 52 | animationGroup.duration = [durations[i] doubleValue]; 53 | animationGroup.animations = @[transformAnimation, opacityAnimation]; 54 | animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 55 | animationGroup.timeOffset = [timeOffsets[i] doubleValue]; 56 | 57 | [layer addSublayer:circle]; 58 | [circle addAnimation:animationGroup forKey:@"animation"]; 59 | } 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorRotatingSandglassAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorRotatingTrigonsAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorRotatingSandglassAnimation : NSObject 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorRotatingSandglassAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorRotatingTrigonsAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorRotatingSandglassAnimation.h" 10 | 11 | @implementation DGActivityIndicatorRotatingSandglassAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | 18 | NSTimeInterval beginTime = CACurrentMediaTime(); 19 | 20 | CGFloat circleSize = size.width / 4.0f;; 21 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 22 | CGFloat oY = (layer.bounds.size.height - size.width) / 2.0f; 23 | 24 | for (int i = 0; i < 2; i++) { 25 | CALayer *circle = [CALayer layer]; 26 | circle.frame = CGRectMake(oX + i * (size.width - 2.0f * circleSize), (size.height - circleSize) * i + oY, circleSize, circleSize); 27 | circle.cornerRadius = circle.bounds.size.height / 2.0f; 28 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 29 | circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f); 30 | circle.backgroundColor = tintColor.CGColor; 31 | circle.shouldRasterize = YES; 32 | circle.rasterizationScale = [[UIScreen mainScreen] scale]; 33 | 34 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 35 | transformAnimation.removedOnCompletion = NO; 36 | transformAnimation.repeatCount = HUGE_VALF; 37 | transformAnimation.duration = 0.8f; 38 | transformAnimation.beginTime = beginTime; 39 | transformAnimation.keyTimes = @[@(0.0f), @(1.0f / 3.0f), @(2.0f / 3.0f), @(1.0)]; 40 | 41 | transformAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], 42 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], 43 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], 44 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]]; 45 | 46 | CATransform3D t1 = CATransform3DMakeTranslation((1.0f - 2.0f * i) * (size.width - 2.0f * circleSize), 0.0f, 0.0f); 47 | 48 | CATransform3D t2 = CATransform3DMakeTranslation((1.0f - 2.0f * i) * (size.width - 2.0f * circleSize) / 2.0f, (1.0f - 2.0f * i) * (size.height - circleSize) / 2.0f, 0.0f); 49 | 50 | CATransform3D t3 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 51 | 52 | 53 | transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DIdentity], 54 | [NSValue valueWithCATransform3D:t1], 55 | [NSValue valueWithCATransform3D:t2], 56 | [NSValue valueWithCATransform3D:t3]]; 57 | 58 | [layer addSublayer:circle]; 59 | [circle addAnimation:transformAnimation forKey:@"animation"]; 60 | } 61 | } 62 | @end 63 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorRotatingSquaresAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorRotatingSquaresAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorRotatingSquaresAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorRotatingSquaresAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorRotatingSquaresAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorRotatingSquaresAnimation.h" 10 | 11 | static CGFloat degreesToRadians(CGFloat degrees) { return (degrees) / 180.0 * M_PI; }; 12 | 13 | @implementation DGActivityIndicatorRotatingSquaresAnimation 14 | 15 | #pragma mark - 16 | #pragma mark DGActivityIndicatorAnimation Protocol 17 | 18 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 19 | NSTimeInterval beginTime = CACurrentMediaTime(); 20 | 21 | CGFloat squareSize = floor(size.width / 4.0f); 22 | 23 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 24 | CGFloat oY = (layer.bounds.size.height - size.height) / 2.0f; 25 | for (int i = 0; i < 2; i++) { 26 | CALayer *square = [CALayer layer]; 27 | square.frame = CGRectMake(oX, oY, squareSize, squareSize); 28 | square.anchorPoint = CGPointMake(0.5f, 0.5f); 29 | square.backgroundColor = tintColor.CGColor; 30 | square.shouldRasterize = YES; 31 | square.rasterizationScale = [[UIScreen mainScreen] scale]; 32 | 33 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 34 | transformAnimation.removedOnCompletion = NO; 35 | transformAnimation.duration = 1.6f; 36 | transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 2.0f); 37 | transformAnimation.repeatCount = HUGE_VALF; 38 | 39 | transformAnimation.keyTimes = @[@(0.0f), @(0.25f), @(0.50f), @(0.75f), @(1.0f)]; 40 | transformAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 41 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 42 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 43 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 44 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 45 | 46 | CATransform3D t1 = CATransform3DMakeTranslation(size.width - squareSize, 0.0f, 0.0f); 47 | t1 = CATransform3DRotate(t1, degreesToRadians(-90.0f), 0.0f, 0.0f, 1.0f); 48 | t1 = CATransform3DScale(t1, 0.5f, 0.5f, 1.0f); 49 | 50 | CATransform3D t2 = CATransform3DMakeTranslation(size.width - squareSize, size.height - squareSize, 0.0f); 51 | t2 = CATransform3DRotate(t2, degreesToRadians(-180.0f), 0.0f, 0.0f, 1.0f); 52 | t2 = CATransform3DScale(t2, 1.0, 1.0, 1.0f); 53 | 54 | CATransform3D t3 = CATransform3DMakeTranslation(0.0f, size.height - squareSize, 0.0f); 55 | t3 = CATransform3DRotate(t3, degreesToRadians(-270.0f), 0.0f, 0.0f, 1.0f); 56 | t3 = CATransform3DScale(t3, 0.5f, 0.5f, 1.0f); 57 | 58 | CATransform3D t4 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 59 | t4 = CATransform3DRotate(t4, degreesToRadians(-360.0f), 0.0f, 0.0f, 1.0f); 60 | t4 = CATransform3DScale(t4, 1.0, 1.0, 1.0f); 61 | 62 | transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DIdentity], 63 | [NSValue valueWithCATransform3D:t1], 64 | [NSValue valueWithCATransform3D:t2], 65 | [NSValue valueWithCATransform3D:t3], 66 | [NSValue valueWithCATransform3D:t4]]; 67 | 68 | [layer addSublayer:square]; 69 | [square addAnimation:transformAnimation forKey:@"animation"]; 70 | } 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorRotatingTrigonAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorRotatingTrigonsAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorRotatingTrigonAnimation : NSObject 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorRotatingTrigonAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorRotatingTrigonsAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorRotatingTrigonAnimation.h" 10 | 11 | @implementation DGActivityIndicatorRotatingTrigonAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | 18 | NSTimeInterval beginTime = CACurrentMediaTime(); 19 | 20 | CGFloat circleSize = size.width / 4.0f;; 21 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 22 | CGFloat oY = (layer.bounds.size.height - size.width) / 2.0f; 23 | 24 | UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, circleSize, circleSize)]; 25 | CGPoint pointA = CGPointMake(oX + size.width / 2.0f, oY + circleSize / 2.0f); 26 | CGPoint pointB = CGPointMake(oX + circleSize / 2.0f, oY + circleSize / 2.0f + sqrtf(powf((size.width - circleSize), 2) - powf((size.width / 2.0f - circleSize / 2.0f), 2))); 27 | CGPoint pointC = CGPointMake(oX + size.width - circleSize / 2.0f, pointB.y); 28 | 29 | for (int i = 0; i < 3; i++) { 30 | CAShapeLayer *circle = [CAShapeLayer layer]; 31 | circle.path = path.CGPath; 32 | circle.fillColor = [UIColor clearColor].CGColor; 33 | circle.strokeColor = tintColor.CGColor; 34 | circle.bounds = CGRectMake(0, 0, circleSize, circleSize); 35 | circle.position = pointA; 36 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 37 | circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f); 38 | circle.shouldRasterize = YES; 39 | circle.rasterizationScale = [[UIScreen mainScreen] scale]; 40 | 41 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 42 | transformAnimation.removedOnCompletion = NO; 43 | transformAnimation.repeatCount = HUGE_VALF; 44 | transformAnimation.duration = 2.0f; 45 | transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 3.0f);; 46 | transformAnimation.keyTimes = @[@(0.0f), @(1.0f / 3.0f), @(2.0f / 3.0f), @(1.0)]; 47 | 48 | transformAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 49 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 50 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 51 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 52 | 53 | CATransform3D t1 = CATransform3DMakeTranslation(pointB.x - pointA.x, pointB.y - pointA.y, 0.0f); 54 | 55 | CATransform3D t2 = CATransform3DMakeTranslation(pointC.x - pointA.x, pointC.y - pointA.y, 0.0f); 56 | 57 | CATransform3D t3 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f); 58 | 59 | transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DIdentity], 60 | [NSValue valueWithCATransform3D:t1], 61 | [NSValue valueWithCATransform3D:t2], 62 | [NSValue valueWithCATransform3D:t3]]; 63 | 64 | [layer addSublayer:circle]; 65 | [circle addAnimation:transformAnimation forKey:@"animation"]; 66 | } 67 | } 68 | @end 69 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorThreeDotsAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorThreeDotsAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorThreeDotsAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorThreeDotsAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorThreeDotsAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorThreeDotsAnimation.h" 10 | 11 | @implementation DGActivityIndicatorThreeDotsAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | NSTimeInterval beginTime = CACurrentMediaTime(); 18 | NSTimeInterval duration = 0.5f; 19 | 20 | CGFloat circleSize = size.width / 4.0f; 21 | CGFloat circlePadding = circleSize / 2.0f; 22 | 23 | CGFloat oX = (layer.bounds.size.width - circleSize * 3 - circlePadding * 2) / 2.0f; 24 | CGFloat oY = (layer.bounds.size.height - circleSize * 1) / 2.0f; 25 | 26 | for (int i = 0; i < 3; i++) { 27 | CALayer *circle = [CALayer layer]; 28 | 29 | circle.frame = CGRectMake(oX + (circleSize + circlePadding) * (i % 3), oY, circleSize, circleSize); 30 | circle.backgroundColor = tintColor.CGColor; 31 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 32 | circle.opacity = 1.0f; 33 | circle.cornerRadius = circle.bounds.size.width / 2.0f; 34 | 35 | CAKeyframeAnimation *tranformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 36 | 37 | tranformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)], 38 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)]]; 39 | 40 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 41 | 42 | opacityAnimation.values = @[@(0.25f), @(1.0f)]; 43 | 44 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 45 | 46 | animationGroup.removedOnCompletion = NO; 47 | animationGroup.autoreverses = YES; 48 | animationGroup.beginTime = beginTime; 49 | animationGroup.repeatCount = HUGE_VALF; 50 | animationGroup.duration = duration; 51 | animationGroup.animations = @[tranformAnimation, opacityAnimation]; 52 | animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 53 | 54 | [layer addSublayer:circle]; 55 | [circle addAnimation:animationGroup forKey:@"animation"]; 56 | } 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTriangleSkewSpinAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTriangleSkewSpinAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorTriangleSkewSpinAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTriangleSkewSpinAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTriangleSkewSpinAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorTriangleSkewSpinAnimation.h" 10 | 11 | @implementation DGActivityIndicatorTriangleSkewSpinAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | CGFloat duration = 3.0f; 15 | CGFloat x = (layer.bounds.size.width - size.width) / 2; 16 | CGFloat y = (layer.bounds.size.height - size.height) / 2; 17 | CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.09f :0.57f :0.49f :0.9f]; 18 | 19 | // Rotation x animation 20 | CAKeyframeAnimation *rotationXAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.x"]; 21 | 22 | rotationXAnimation.duration = duration; 23 | rotationXAnimation.keyTimes = @[@0.0f, @0.25f, @0.5f, @0.75f, @1.0f]; 24 | rotationXAnimation.values = @[@0.0f, @M_PI, @M_PI, @0.0f, @0.0f]; 25 | rotationXAnimation.timingFunctions = @[timingFunction, timingFunction, timingFunction, timingFunction]; 26 | 27 | // Rotation x animation 28 | CAKeyframeAnimation *rotationYAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.y"]; 29 | 30 | rotationYAnimation.duration = duration; 31 | rotationYAnimation.keyTimes = @[@0.0f, @0.25f, @0.5f, @0.75f, @1.0f]; 32 | rotationYAnimation.values = @[@0.0f, @0.0f, @M_PI, @M_PI, @0.0f]; 33 | rotationYAnimation.timingFunctions = @[timingFunction, timingFunction, timingFunction, timingFunction]; 34 | 35 | // Animation 36 | CAAnimationGroup *animation = [CAAnimationGroup animation]; 37 | 38 | animation.animations = @[rotationXAnimation, rotationYAnimation]; 39 | animation.duration = duration; 40 | animation.repeatCount = HUGE_VALF; 41 | 42 | // Draw triangle 43 | CAShapeLayer *triangle = [CAShapeLayer layer]; 44 | UIBezierPath *trianglePath = [UIBezierPath bezierPath]; 45 | CGFloat offsetY = size.height / 4; 46 | 47 | [trianglePath moveToPoint:CGPointMake(0, size.height - offsetY)]; 48 | [trianglePath addLineToPoint:CGPointMake(size.width / 2, size.height / 2 - offsetY)]; 49 | [trianglePath addLineToPoint:CGPointMake(size.width, size.height - offsetY)]; 50 | [trianglePath closePath]; 51 | triangle.fillColor = tintColor.CGColor; 52 | triangle.path = trianglePath.CGPath; 53 | [triangle addAnimation:animation forKey:@"animation"]; 54 | triangle.frame = CGRectMake(x, y, size.width, size.height); 55 | [layer addSublayer:triangle]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTriplePulseAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTriplePulseAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorTriplePulseAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTriplePulseAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTriplePulseAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorTriplePulseAnimation.h" 10 | 11 | @implementation DGActivityIndicatorTriplePulseAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | NSTimeInterval beginTime = CACurrentMediaTime(); 18 | 19 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 20 | CGFloat oY = (layer.bounds.size.height - size.height) / 2.0f; 21 | for (int i = 0; i < 4; i++) { 22 | CALayer *circle = [CALayer layer]; 23 | circle.frame = CGRectMake(oX, oY, size.width, size.height); 24 | circle.backgroundColor = tintColor.CGColor; 25 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 26 | circle.opacity = 0.8f; 27 | circle.cornerRadius = circle.bounds.size.height / 2.0f; 28 | circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f); 29 | 30 | CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; 31 | transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.0f, 0.0f)]; 32 | transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)]; 33 | 34 | CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; 35 | opacityAnimation.fromValue = @(0.8f); 36 | opacityAnimation.toValue = @(0.0f); 37 | 38 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 39 | animationGroup.removedOnCompletion = NO; 40 | animationGroup.beginTime = beginTime + i * 0.2f; 41 | animationGroup.repeatCount = HUGE_VALF; 42 | animationGroup.duration = 1.2f; 43 | animationGroup.animations = @[transformAnimation, opacityAnimation]; 44 | 45 | [layer addSublayer:circle]; 46 | [circle addAnimation:animationGroup forKey:@"animation"]; 47 | } 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTripleRingsAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTripleRingsPulseAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | #import "DGActivityIndicatorAnimationProtocol.h" 9 | 10 | @interface DGActivityIndicatorTripleRingsAnimation : NSObject 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTripleRingsAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTripleRingsPulseAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorTripleRingsAnimation.h" 10 | 11 | @implementation DGActivityIndicatorTripleRingsAnimation 12 | 13 | #pragma mark - 14 | #pragma mark DGActivityIndicatorAnimation Protocol 15 | 16 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 17 | NSTimeInterval beginTime = CACurrentMediaTime(); 18 | 19 | UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0.0f, 0.0f, size.width, size.width)]; 20 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 21 | CGFloat oY = (layer.bounds.size.height - size.height) / 2.0f; 22 | for (int i = 0; i < 3; i++) { 23 | CAShapeLayer *circle = [CAShapeLayer layer]; 24 | circle.path = path.CGPath; 25 | circle.fillColor = [UIColor clearColor].CGColor; 26 | circle.strokeColor = tintColor.CGColor; 27 | circle.frame = CGRectMake(oX, oY, size.width, size.height); 28 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 29 | circle.opacity = 1.0f; 30 | circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f); 31 | 32 | CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; 33 | transformAnimation.duration = 2.0f - i * 0.4f; 34 | transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1f, 0.1f, 0.0f)]; 35 | transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)]; 36 | transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut]; 37 | 38 | CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; 39 | opacityAnimation.duration = transformAnimation.duration; 40 | opacityAnimation.fromValue = @(1.0f); 41 | opacityAnimation.toValue = @(0.8f); 42 | opacityAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut]; 43 | 44 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 45 | animationGroup.removedOnCompletion = NO; 46 | animationGroup.beginTime = beginTime + i * 0.4f; 47 | animationGroup.repeatCount = HUGE_VALF; 48 | animationGroup.duration = 2.0f; 49 | animationGroup.animations = @[transformAnimation, opacityAnimation]; 50 | 51 | [layer addSublayer:circle]; 52 | [circle addAnimation:animationGroup forKey:@"animation"]; 53 | } 54 | } 55 | @end 56 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTwoDotsAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTwoDotsAnimation.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorAnimationProtocol.h" 10 | 11 | @interface DGActivityIndicatorTwoDotsAnimation : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/Animations/DGActivityIndicatorTwoDotsAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorTwoDotsAnimation.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorTwoDotsAnimation.h" 10 | 11 | @implementation DGActivityIndicatorTwoDotsAnimation 12 | 13 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor { 14 | NSTimeInterval beginTime = CACurrentMediaTime(); 15 | 16 | CGFloat circleSize = size.width * 0.92f; 17 | CGFloat oX = (layer.bounds.size.width - size.width) / 2.0f; 18 | CGFloat oY = (layer.bounds.size.height - circleSize) / 2.0f; 19 | for (int i = 0; i < 2; i++) { 20 | CALayer *circle = [CALayer layer]; 21 | CGFloat offset = circleSize / 2.0f * i; 22 | circle.frame = CGRectMake((offset + size.width - circleSize) * i + oX, oY, circleSize, circleSize); 23 | circle.cornerRadius = circle.bounds.size.height / 2.0f; 24 | circle.anchorPoint = CGPointMake(0.5f, 0.5f); 25 | circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f); 26 | circle.backgroundColor = tintColor.CGColor; 27 | 28 | CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 29 | transformAnimation.removedOnCompletion = NO; 30 | transformAnimation.repeatCount = HUGE_VALF; 31 | transformAnimation.duration = 1.8f; 32 | transformAnimation.beginTime = beginTime - (transformAnimation.duration / 2.0f * i); 33 | transformAnimation.keyTimes = @[@(0.0), @(0.5), @(1.0)]; 34 | 35 | transformAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 36 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 37 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 38 | 39 | transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.0f, 0.0f)], 40 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)], 41 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.0f, 0.0f)]]; 42 | 43 | [layer addSublayer:circle]; 44 | [circle addAnimation:transformAnimation forKey:@"animation"]; 45 | } 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/DGActivityIndicatorAnimationProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorAnimationProtocol.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @protocol DGActivityIndicatorAnimationProtocol 13 | 14 | - (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor; 15 | 16 | @end -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/DGActivityIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorView.h 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, DGActivityIndicatorAnimationType) { 12 | DGActivityIndicatorAnimationTypeNineDots, 13 | DGActivityIndicatorAnimationTypeTriplePulse, 14 | DGActivityIndicatorAnimationTypeFiveDots, 15 | DGActivityIndicatorAnimationTypeRotatingSquares, 16 | DGActivityIndicatorAnimationTypeDoubleBounce, 17 | DGActivityIndicatorAnimationTypeTwoDots, 18 | DGActivityIndicatorAnimationTypeThreeDots, 19 | DGActivityIndicatorAnimationTypeBallPulse, 20 | DGActivityIndicatorAnimationTypeBallClipRotate, 21 | DGActivityIndicatorAnimationTypeBallClipRotatePulse, 22 | DGActivityIndicatorAnimationTypeBallClipRotateMultiple, 23 | DGActivityIndicatorAnimationTypeBallRotate, 24 | DGActivityIndicatorAnimationTypeBallZigZag, 25 | DGActivityIndicatorAnimationTypeBallZigZagDeflect, 26 | DGActivityIndicatorAnimationTypeBallTrianglePath, 27 | DGActivityIndicatorAnimationTypeBallScale, 28 | DGActivityIndicatorAnimationTypeLineScale, 29 | DGActivityIndicatorAnimationTypeLineScaleParty, 30 | DGActivityIndicatorAnimationTypeBallScaleMultiple, 31 | DGActivityIndicatorAnimationTypeBallPulseSync, 32 | DGActivityIndicatorAnimationTypeBallBeat, 33 | DGActivityIndicatorAnimationTypeLineScalePulseOut, 34 | DGActivityIndicatorAnimationTypeLineScalePulseOutRapid, 35 | DGActivityIndicatorAnimationTypeBallScaleRipple, 36 | DGActivityIndicatorAnimationTypeBallScaleRippleMultiple, 37 | DGActivityIndicatorAnimationTypeTriangleSkewSpin, 38 | DGActivityIndicatorAnimationTypeBallGridBeat, 39 | DGActivityIndicatorAnimationTypeBallGridPulse, 40 | DGActivityIndicatorAnimationTypeRotatingSandglass, 41 | DGActivityIndicatorAnimationTypeRotatingTrigons, 42 | DGActivityIndicatorAnimationTypeTripleRings, 43 | DGActivityIndicatorAnimationTypeCookieTerminator, 44 | DGActivityIndicatorAnimationTypeBallSpinFadeLoader 45 | }; 46 | 47 | @interface DGActivityIndicatorView : UIView 48 | 49 | - (id)initWithType:(DGActivityIndicatorAnimationType)type; 50 | - (id)initWithType:(DGActivityIndicatorAnimationType)type tintColor:(UIColor *)tintColor; 51 | - (id)initWithType:(DGActivityIndicatorAnimationType)type tintColor:(UIColor *)tintColor size:(CGFloat)size; 52 | 53 | @property (nonatomic) DGActivityIndicatorAnimationType type; 54 | @property (nonatomic, strong) UIColor *tintColor; 55 | @property (nonatomic) CGFloat size; 56 | 57 | @property (nonatomic, readonly) BOOL animating; 58 | 59 | - (void)startAnimating; 60 | - (void)stopAnimating; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/DGActivityIndicatorView/DGActivityIndicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DGActivityIndicatorView.m 3 | // DGActivityIndicatorExample 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "DGActivityIndicatorView.h" 10 | 11 | #import "DGActivityIndicatorNineDotsAnimation.h" 12 | #import "DGActivityIndicatorTriplePulseAnimation.h" 13 | #import "DGActivityIndicatorFiveDotsAnimation.h" 14 | #import "DGActivityIndicatorRotatingSquaresAnimation.h" 15 | #import "DGActivityIndicatorDoubleBounceAnimation.h" 16 | #import "DGActivityIndicatorTwoDotsAnimation.h" 17 | #import "DGActivityIndicatorThreeDotsAnimation.h" 18 | #import "DGActivityIndicatorBallPulseAnimation.h" 19 | #import "DGActivityIndicatorBallClipRotateAnimation.h" 20 | #import "DGActivityIndicatorBallClipRotatePulseAnimation.h" 21 | #import "DGActivityIndicatorBallClipRotateMultipleAnimation.h" 22 | #import "DGActivityIndicatorBallRotateAnimation.h" 23 | #import "DGActivityIndicatorBallZigZagAnimation.h" 24 | #import "DGActivityIndicatorBallZigZagDeflectAnimation.h" 25 | #import "DGActivityIndicatorBallTrianglePathAnimation.h" 26 | #import "DGActivityIndicatorBallScaleAnimation.h" 27 | #import "DGActivityIndicatorLineScaleAnimation.h" 28 | #import "DGActivityIndicatorLineScalePartyAnimation.h" 29 | #import "DGActivityIndicatorBallScaleMultipleAnimation.h" 30 | #import "DGActivityIndicatorBallPulseSyncAnimation.h" 31 | #import "DGActivityIndicatorBallBeatAnimation.h" 32 | #import "DGActivityIndicatorLineScalePulseOutAnimation.h" 33 | #import "DGActivityIndicatorLineScalePulseOutRapidAnimation.h" 34 | #import "DGActivityIndicatorBallScaleRippleAnimation.h" 35 | #import "DGActivityIndicatorBallScaleRippleMultipleAnimation.h" 36 | #import "DGActivityIndicatorTriangleSkewSpinAnimation.h" 37 | #import "DGActivityIndicatorBallGridBeatAnimation.h" 38 | #import "DGActivityIndicatorBallGridPulseAnimation.h" 39 | #import "DGActivityIndicatorRotatingSandglassAnimation.h" 40 | #import "DGActivityIndicatorRotatingTrigonAnimation.h" 41 | #import "DGActivityIndicatorTripleRingsAnimation.h" 42 | #import "DGActivityIndicatorCookieTerminatorAnimation.h" 43 | #import "DGActivityIndicatorBallSpinFadeLoader.h" 44 | 45 | static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f; 46 | 47 | @implementation DGActivityIndicatorView 48 | 49 | #pragma mark - 50 | #pragma mark Constructors 51 | 52 | - (id)initWithType:(DGActivityIndicatorAnimationType)type { 53 | return [self initWithType:type tintColor:[UIColor whiteColor] size:kDGActivityIndicatorDefaultSize]; 54 | } 55 | 56 | - (id)initWithType:(DGActivityIndicatorAnimationType)type tintColor:(UIColor *)tintColor { 57 | return [self initWithType:type tintColor:tintColor size:kDGActivityIndicatorDefaultSize]; 58 | } 59 | 60 | - (id)initWithType:(DGActivityIndicatorAnimationType)type tintColor:(UIColor *)tintColor size:(CGFloat)size { 61 | self = [super init]; 62 | if (self) { 63 | _type = type; 64 | _size = size; 65 | _tintColor = tintColor; 66 | self.userInteractionEnabled = NO; 67 | self.hidden = YES; 68 | } 69 | return self; 70 | } 71 | 72 | #pragma mark - 73 | #pragma mark Methods 74 | 75 | - (void)setupAnimation { 76 | self.layer.sublayers = nil; 77 | 78 | id animation = [DGActivityIndicatorView activityIndicatorAnimationForAnimationType:_type]; 79 | 80 | if ([animation respondsToSelector:@selector(setupAnimationInLayer:withSize:tintColor:)]) { 81 | [animation setupAnimationInLayer:self.layer withSize:CGSizeMake(_size, _size) tintColor:_tintColor]; 82 | self.layer.speed = 0.0f; 83 | } 84 | } 85 | 86 | - (void)startAnimating { 87 | if (!self.layer.sublayers) { 88 | [self setupAnimation]; 89 | } 90 | self.hidden = NO; 91 | self.layer.speed = 1.0f; 92 | _animating = YES; 93 | } 94 | 95 | - (void)stopAnimating { 96 | self.layer.speed = 0.0f; 97 | _animating = NO; 98 | self.hidden = YES; 99 | } 100 | 101 | #pragma mark - 102 | #pragma mark Setters 103 | 104 | - (void)setType:(DGActivityIndicatorAnimationType)type { 105 | if (_type != type) { 106 | _type = type; 107 | 108 | [self setupAnimation]; 109 | } 110 | } 111 | 112 | - (void)setSize:(CGFloat)size { 113 | if (_size != size) { 114 | _size = size; 115 | 116 | [self setupAnimation]; 117 | } 118 | } 119 | 120 | - (void)setTintColor:(UIColor *)tintColor { 121 | if (![_tintColor isEqual:tintColor]) { 122 | _tintColor = tintColor; 123 | 124 | for (CALayer *sublayer in self.layer.sublayers) { 125 | sublayer.backgroundColor = tintColor.CGColor; 126 | } 127 | } 128 | } 129 | 130 | #pragma mark - 131 | #pragma mark Getters 132 | 133 | + (id)activityIndicatorAnimationForAnimationType:(DGActivityIndicatorAnimationType)type { 134 | switch (type) { 135 | case DGActivityIndicatorAnimationTypeNineDots: 136 | return [[DGActivityIndicatorNineDotsAnimation alloc] init]; 137 | case DGActivityIndicatorAnimationTypeTriplePulse: 138 | return [[DGActivityIndicatorTriplePulseAnimation alloc] init]; 139 | case DGActivityIndicatorAnimationTypeFiveDots: 140 | return [[DGActivityIndicatorFiveDotsAnimation alloc] init]; 141 | case DGActivityIndicatorAnimationTypeRotatingSquares: 142 | return [[DGActivityIndicatorRotatingSquaresAnimation alloc] init]; 143 | case DGActivityIndicatorAnimationTypeDoubleBounce: 144 | return [[DGActivityIndicatorDoubleBounceAnimation alloc] init]; 145 | case DGActivityIndicatorAnimationTypeTwoDots: 146 | return [[DGActivityIndicatorTwoDotsAnimation alloc] init]; 147 | case DGActivityIndicatorAnimationTypeThreeDots: 148 | return [[DGActivityIndicatorThreeDotsAnimation alloc] init]; 149 | case DGActivityIndicatorAnimationTypeBallPulse: 150 | return [[DGActivityIndicatorBallPulseAnimation alloc] init]; 151 | case DGActivityIndicatorAnimationTypeBallClipRotate: 152 | return [[DGActivityIndicatorBallClipRotateAnimation alloc] init]; 153 | case DGActivityIndicatorAnimationTypeBallClipRotatePulse: 154 | return [[DGActivityIndicatorBallClipRotatePulseAnimation alloc] init]; 155 | case DGActivityIndicatorAnimationTypeBallClipRotateMultiple: 156 | return [[DGActivityIndicatorBallClipRotateMultipleAnimation alloc] init]; 157 | case DGActivityIndicatorAnimationTypeBallRotate: 158 | return [[DGActivityIndicatorBallRotateAnimation alloc] init]; 159 | case DGActivityIndicatorAnimationTypeBallZigZag: 160 | return [[DGActivityIndicatorBallZigZagAnimation alloc] init]; 161 | case DGActivityIndicatorAnimationTypeBallZigZagDeflect: 162 | return [[DGActivityIndicatorBallZigZagDeflectAnimation alloc] init]; 163 | case DGActivityIndicatorAnimationTypeBallTrianglePath: 164 | return [[DGActivityIndicatorBallTrianglePathAnimation alloc] init]; 165 | case DGActivityIndicatorAnimationTypeBallScale: 166 | return [[DGActivityIndicatorBallScaleAnimation alloc] init]; 167 | case DGActivityIndicatorAnimationTypeLineScale: 168 | return [[DGActivityIndicatorLineScaleAnimation alloc] init]; 169 | case DGActivityIndicatorAnimationTypeLineScaleParty: 170 | return [[DGActivityIndicatorLineScalePartyAnimation alloc] init]; 171 | case DGActivityIndicatorAnimationTypeBallScaleMultiple: 172 | return [[DGActivityIndicatorBallScaleMultipleAnimation alloc] init]; 173 | case DGActivityIndicatorAnimationTypeBallPulseSync: 174 | return [[DGActivityIndicatorBallPulseSyncAnimation alloc] init]; 175 | case DGActivityIndicatorAnimationTypeBallBeat: 176 | return [[DGActivityIndicatorBallBeatAnimation alloc] init]; 177 | case DGActivityIndicatorAnimationTypeLineScalePulseOut: 178 | return [[DGActivityIndicatorLineScalePulseOutAnimation alloc] init]; 179 | case DGActivityIndicatorAnimationTypeLineScalePulseOutRapid: 180 | return [[DGActivityIndicatorLineScalePulseOutRapidAnimation alloc] init]; 181 | case DGActivityIndicatorAnimationTypeBallScaleRipple: 182 | return [[DGActivityIndicatorBallScaleRippleAnimation alloc] init]; 183 | case DGActivityIndicatorAnimationTypeBallScaleRippleMultiple: 184 | return [[DGActivityIndicatorBallScaleRippleMultipleAnimation alloc] init]; 185 | case DGActivityIndicatorAnimationTypeTriangleSkewSpin: 186 | return [[DGActivityIndicatorTriangleSkewSpinAnimation alloc] init]; 187 | case DGActivityIndicatorAnimationTypeBallGridBeat: 188 | return [[DGActivityIndicatorBallGridBeatAnimation alloc] init]; 189 | case DGActivityIndicatorAnimationTypeBallGridPulse: 190 | return [[DGActivityIndicatorBallGridPulseAnimation alloc] init]; 191 | case DGActivityIndicatorAnimationTypeRotatingSandglass: 192 | return [[DGActivityIndicatorRotatingSandglassAnimation alloc]init]; 193 | case DGActivityIndicatorAnimationTypeRotatingTrigons: 194 | return [[DGActivityIndicatorRotatingTrigonAnimation alloc]init]; 195 | case DGActivityIndicatorAnimationTypeTripleRings: 196 | return [[DGActivityIndicatorTripleRingsAnimation alloc]init]; 197 | case DGActivityIndicatorAnimationTypeCookieTerminator: 198 | return [[DGActivityIndicatorCookieTerminatorAnimation alloc]init]; 199 | case DGActivityIndicatorAnimationTypeBallSpinFadeLoader: 200 | return [[DGActivityIndicatorBallSpinFadeLoader alloc] init]; 201 | } 202 | return nil; 203 | } 204 | 205 | @end 206 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/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 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // YTLoadingAnimationDemo 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // YTLoadingAnimationDemo 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DGActivityIndicatorView.h" 11 | 12 | @interface ViewController () 13 | 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 | self.title = @"YTLoadingAnimation"; 22 | self.view.backgroundColor = [UIColor colorWithRed:27/255.0 green:176/255.0 blue:233/255.0 alpha:1]; 23 | NSArray *activityTypes = @[@(DGActivityIndicatorAnimationTypeNineDots), 24 | @(DGActivityIndicatorAnimationTypeTriplePulse), 25 | @(DGActivityIndicatorAnimationTypeFiveDots), 26 | @(DGActivityIndicatorAnimationTypeRotatingSquares), 27 | @(DGActivityIndicatorAnimationTypeDoubleBounce), 28 | @(DGActivityIndicatorAnimationTypeTwoDots), 29 | @(DGActivityIndicatorAnimationTypeThreeDots), 30 | @(DGActivityIndicatorAnimationTypeBallPulse), 31 | @(DGActivityIndicatorAnimationTypeBallClipRotate), 32 | @(DGActivityIndicatorAnimationTypeBallClipRotatePulse), 33 | @(DGActivityIndicatorAnimationTypeBallClipRotateMultiple), 34 | @(DGActivityIndicatorAnimationTypeBallRotate), 35 | @(DGActivityIndicatorAnimationTypeBallZigZag), 36 | @(DGActivityIndicatorAnimationTypeBallZigZagDeflect), 37 | @(DGActivityIndicatorAnimationTypeBallTrianglePath), 38 | @(DGActivityIndicatorAnimationTypeBallScale), 39 | @(DGActivityIndicatorAnimationTypeLineScale), 40 | @(DGActivityIndicatorAnimationTypeLineScaleParty), 41 | @(DGActivityIndicatorAnimationTypeBallScaleMultiple), 42 | @(DGActivityIndicatorAnimationTypeBallPulseSync), 43 | @(DGActivityIndicatorAnimationTypeBallBeat), 44 | @(DGActivityIndicatorAnimationTypeLineScalePulseOut), 45 | @(DGActivityIndicatorAnimationTypeLineScalePulseOutRapid), 46 | @(DGActivityIndicatorAnimationTypeBallScaleRipple), 47 | @(DGActivityIndicatorAnimationTypeBallScaleRippleMultiple), 48 | @(DGActivityIndicatorAnimationTypeTriangleSkewSpin), 49 | @(DGActivityIndicatorAnimationTypeBallGridBeat), 50 | @(DGActivityIndicatorAnimationTypeBallGridPulse), 51 | @(DGActivityIndicatorAnimationTypeRotatingSandglass), 52 | @(DGActivityIndicatorAnimationTypeRotatingTrigons), 53 | @(DGActivityIndicatorAnimationTypeTripleRings), 54 | @(DGActivityIndicatorAnimationTypeCookieTerminator), 55 | @(DGActivityIndicatorAnimationTypeBallSpinFadeLoader)]; 56 | 57 | for (int i = 0; i < activityTypes.count; i++) { 58 | DGActivityIndicatorView *activityIndicatorView = [[DGActivityIndicatorView alloc] initWithType:(DGActivityIndicatorAnimationType)[activityTypes[i] integerValue] tintColor:[UIColor whiteColor]]; 59 | CGFloat width = self.view.bounds.size.width / 5.0f; 60 | CGFloat height = self.view.bounds.size.height / 7.0f; 61 | 62 | activityIndicatorView.frame = CGRectMake(width * (i % 7), height * (int)(i / 7) + 64, width, height); 63 | [self.view addSubview:activityIndicatorView]; 64 | /** 65 | * 开始动画 66 | */ 67 | [activityIndicatorView startAnimating]; 68 | /** 69 | * 结束动画 70 | */ 71 | // [activityIndicatorView stopAnimating]; 72 | } 73 | 74 | 75 | } 76 | 77 | - (void)didReceiveMemoryWarning { 78 | [super didReceiveMemoryWarning]; 79 | // Dispose of any resources that can be recreated. 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // YTLoadingAnimationDemo 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. 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 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemoTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemoTests/YTLoadingAnimationDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // YTLoadingAnimationDemoTests.m 3 | // YTLoadingAnimationDemoTests 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YTLoadingAnimationDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation YTLoadingAnimationDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemoUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /YTLoadingAnimationDemoUITests/YTLoadingAnimationDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // YTLoadingAnimationDemoUITests.m 3 | // YTLoadingAnimationDemoUITests 4 | // 5 | // Created by TonyAng on 16/4/1. 6 | // Copyright © 2016年 TonyAng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YTLoadingAnimationDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation YTLoadingAnimationDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------