├── .gitignore ├── AnimatedCircleDemo ├── AnimatedCircleDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── AnimatedCircleDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── CircleView │ │ ├── CircleLayer.h │ │ ├── CircleLayer.m │ │ ├── CircleView.h │ │ └── CircleView.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── AnimatedCircleDemoTests │ ├── AnimatedCircleDemoTests.m │ └── Info.plist ├── AnimatedCurveDemo ├── AnimatedCurveDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── AnimatedCurveDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── CurveLayer │ │ ├── CurveLayer.h │ │ └── CurveLayer.m │ ├── CurveView │ │ ├── CurveView.h │ │ └── CurveView.m │ ├── Helpers │ │ ├── UIView+Convenient.h │ │ └── UIView+Convenient.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── KYPullToCurveVeiw │ │ ├── KYPullToCurveVeiw.h │ │ ├── KYPullToCurveVeiw.m │ │ ├── KYPullToCurveVeiw_footer.h │ │ └── KYPullToCurveVeiw_footer.m │ ├── LabelView │ │ ├── LabelView.h │ │ └── LabelView.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── AnimatedCurveDemoTests │ ├── AnimatedCurveDemoTests.m │ └── Info.plist ├── GooeyBubble.gif ├── GooeySlideMenu.gif ├── GooeySlideMenuDemo ├── GooeySlideMenuDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── GooeySlideMenuDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Classes │ │ ├── GooeySlideMenu.h │ │ ├── GooeySlideMenu.m │ │ ├── SlideMenuButton.h │ │ └── SlideMenuButton.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── GooeySlideMenuDemoTests │ ├── GooeySlideMenuDemoTests.m │ └── Info.plist ├── LICENSE ├── NavbarTitleWithFadeAnimation.gif ├── README.md ├── Scanner Gooey Effect.gif ├── SplashAnimiationDemo ├── SplashAnimiationDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── SplashAnimiationDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── home_demo.imageset │ │ │ ├── 1.png │ │ │ └── Contents.json │ │ └── logo.imageset │ │ │ ├── Contents.json │ │ │ └── logo.png │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── SplashAnimiationDemoTests │ ├── Info.plist │ └── SplashAnimiationDemoTests.m ├── circleAnim.gif ├── curverAnim_2.gif └── splash animatino.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5FAAC1831B6127D9006583DF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FAAC1821B6127D9006583DF /* main.m */; }; 11 | 5FAAC1861B6127D9006583DF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FAAC1851B6127D9006583DF /* AppDelegate.m */; }; 12 | 5FAAC1891B6127D9006583DF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FAAC1881B6127D9006583DF /* ViewController.m */; }; 13 | 5FAAC18C1B6127D9006583DF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5FAAC18A1B6127D9006583DF /* Main.storyboard */; }; 14 | 5FAAC18E1B6127D9006583DF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5FAAC18D1B6127D9006583DF /* Images.xcassets */; }; 15 | 5FAAC1911B6127D9006583DF /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5FAAC18F1B6127D9006583DF /* LaunchScreen.xib */; }; 16 | 5FAAC19D1B6127DA006583DF /* AnimatedCircleDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FAAC19C1B6127DA006583DF /* AnimatedCircleDemoTests.m */; }; 17 | 5FAAC1A81B61286F006583DF /* CircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FAAC1A71B61286F006583DF /* CircleView.m */; }; 18 | 5FAAC1AC1B6128A3006583DF /* CircleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FAAC1AB1B6128A3006583DF /* CircleLayer.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 5FAAC1971B6127D9006583DF /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 5FAAC1751B6127D9006583DF /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 5FAAC17C1B6127D9006583DF; 27 | remoteInfo = AnimatedCircleDemo; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 5FAAC17D1B6127D9006583DF /* AnimatedCircleDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimatedCircleDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 5FAAC1811B6127D9006583DF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 5FAAC1821B6127D9006583DF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | 5FAAC1841B6127D9006583DF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | 5FAAC1851B6127D9006583DF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | 5FAAC1871B6127D9006583DF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 38 | 5FAAC1881B6127D9006583DF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 39 | 5FAAC18B1B6127D9006583DF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | 5FAAC18D1B6127D9006583DF /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | 5FAAC1901B6127D9006583DF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 42 | 5FAAC1961B6127D9006583DF /* AnimatedCircleDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AnimatedCircleDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 5FAAC19B1B6127D9006583DF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 5FAAC19C1B6127DA006583DF /* AnimatedCircleDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnimatedCircleDemoTests.m; sourceTree = ""; }; 45 | 5FAAC1A61B61286F006583DF /* CircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CircleView.h; path = CircleView/CircleView.h; sourceTree = ""; }; 46 | 5FAAC1A71B61286F006583DF /* CircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CircleView.m; path = CircleView/CircleView.m; sourceTree = ""; }; 47 | 5FAAC1AA1B6128A3006583DF /* CircleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CircleLayer.h; path = CircleView/CircleLayer.h; sourceTree = ""; }; 48 | 5FAAC1AB1B6128A3006583DF /* CircleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CircleLayer.m; path = CircleView/CircleLayer.m; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 5FAAC17A1B6127D9006583DF /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | 5FAAC1931B6127D9006583DF /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 5FAAC1741B6127D8006583DF = { 70 | isa = PBXGroup; 71 | children = ( 72 | 5FAAC17F1B6127D9006583DF /* AnimatedCircleDemo */, 73 | 5FAAC1991B6127D9006583DF /* AnimatedCircleDemoTests */, 74 | 5FAAC17E1B6127D9006583DF /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 5FAAC17E1B6127D9006583DF /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 5FAAC17D1B6127D9006583DF /* AnimatedCircleDemo.app */, 82 | 5FAAC1961B6127D9006583DF /* AnimatedCircleDemoTests.xctest */, 83 | ); 84 | name = Products; 85 | sourceTree = ""; 86 | }; 87 | 5FAAC17F1B6127D9006583DF /* AnimatedCircleDemo */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 5FAAC1841B6127D9006583DF /* AppDelegate.h */, 91 | 5FAAC1851B6127D9006583DF /* AppDelegate.m */, 92 | 5FAAC1871B6127D9006583DF /* ViewController.h */, 93 | 5FAAC1881B6127D9006583DF /* ViewController.m */, 94 | 5FAAC1A91B612874006583DF /* CircleView */, 95 | 5FAAC18A1B6127D9006583DF /* Main.storyboard */, 96 | 5FAAC18D1B6127D9006583DF /* Images.xcassets */, 97 | 5FAAC18F1B6127D9006583DF /* LaunchScreen.xib */, 98 | 5FAAC1801B6127D9006583DF /* Supporting Files */, 99 | ); 100 | path = AnimatedCircleDemo; 101 | sourceTree = ""; 102 | }; 103 | 5FAAC1801B6127D9006583DF /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 5FAAC1811B6127D9006583DF /* Info.plist */, 107 | 5FAAC1821B6127D9006583DF /* main.m */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | 5FAAC1991B6127D9006583DF /* AnimatedCircleDemoTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 5FAAC19C1B6127DA006583DF /* AnimatedCircleDemoTests.m */, 116 | 5FAAC19A1B6127D9006583DF /* Supporting Files */, 117 | ); 118 | path = AnimatedCircleDemoTests; 119 | sourceTree = ""; 120 | }; 121 | 5FAAC19A1B6127D9006583DF /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 5FAAC19B1B6127D9006583DF /* Info.plist */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 5FAAC1A91B612874006583DF /* CircleView */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 5FAAC1A61B61286F006583DF /* CircleView.h */, 133 | 5FAAC1A71B61286F006583DF /* CircleView.m */, 134 | 5FAAC1AA1B6128A3006583DF /* CircleLayer.h */, 135 | 5FAAC1AB1B6128A3006583DF /* CircleLayer.m */, 136 | ); 137 | name = CircleView; 138 | sourceTree = ""; 139 | }; 140 | /* End PBXGroup section */ 141 | 142 | /* Begin PBXNativeTarget section */ 143 | 5FAAC17C1B6127D9006583DF /* AnimatedCircleDemo */ = { 144 | isa = PBXNativeTarget; 145 | buildConfigurationList = 5FAAC1A01B6127DA006583DF /* Build configuration list for PBXNativeTarget "AnimatedCircleDemo" */; 146 | buildPhases = ( 147 | 5FAAC1791B6127D9006583DF /* Sources */, 148 | 5FAAC17A1B6127D9006583DF /* Frameworks */, 149 | 5FAAC17B1B6127D9006583DF /* Resources */, 150 | ); 151 | buildRules = ( 152 | ); 153 | dependencies = ( 154 | ); 155 | name = AnimatedCircleDemo; 156 | productName = AnimatedCircleDemo; 157 | productReference = 5FAAC17D1B6127D9006583DF /* AnimatedCircleDemo.app */; 158 | productType = "com.apple.product-type.application"; 159 | }; 160 | 5FAAC1951B6127D9006583DF /* AnimatedCircleDemoTests */ = { 161 | isa = PBXNativeTarget; 162 | buildConfigurationList = 5FAAC1A31B6127DA006583DF /* Build configuration list for PBXNativeTarget "AnimatedCircleDemoTests" */; 163 | buildPhases = ( 164 | 5FAAC1921B6127D9006583DF /* Sources */, 165 | 5FAAC1931B6127D9006583DF /* Frameworks */, 166 | 5FAAC1941B6127D9006583DF /* Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | 5FAAC1981B6127D9006583DF /* PBXTargetDependency */, 172 | ); 173 | name = AnimatedCircleDemoTests; 174 | productName = AnimatedCircleDemoTests; 175 | productReference = 5FAAC1961B6127D9006583DF /* AnimatedCircleDemoTests.xctest */; 176 | productType = "com.apple.product-type.bundle.unit-test"; 177 | }; 178 | /* End PBXNativeTarget section */ 179 | 180 | /* Begin PBXProject section */ 181 | 5FAAC1751B6127D9006583DF /* Project object */ = { 182 | isa = PBXProject; 183 | attributes = { 184 | LastUpgradeCheck = 0630; 185 | ORGANIZATIONNAME = "Kitten Yang"; 186 | TargetAttributes = { 187 | 5FAAC17C1B6127D9006583DF = { 188 | CreatedOnToolsVersion = 6.3; 189 | }; 190 | 5FAAC1951B6127D9006583DF = { 191 | CreatedOnToolsVersion = 6.3; 192 | TestTargetID = 5FAAC17C1B6127D9006583DF; 193 | }; 194 | }; 195 | }; 196 | buildConfigurationList = 5FAAC1781B6127D9006583DF /* Build configuration list for PBXProject "AnimatedCircleDemo" */; 197 | compatibilityVersion = "Xcode 3.2"; 198 | developmentRegion = English; 199 | hasScannedForEncodings = 0; 200 | knownRegions = ( 201 | en, 202 | Base, 203 | ); 204 | mainGroup = 5FAAC1741B6127D8006583DF; 205 | productRefGroup = 5FAAC17E1B6127D9006583DF /* Products */; 206 | projectDirPath = ""; 207 | projectRoot = ""; 208 | targets = ( 209 | 5FAAC17C1B6127D9006583DF /* AnimatedCircleDemo */, 210 | 5FAAC1951B6127D9006583DF /* AnimatedCircleDemoTests */, 211 | ); 212 | }; 213 | /* End PBXProject section */ 214 | 215 | /* Begin PBXResourcesBuildPhase section */ 216 | 5FAAC17B1B6127D9006583DF /* Resources */ = { 217 | isa = PBXResourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | 5FAAC18C1B6127D9006583DF /* Main.storyboard in Resources */, 221 | 5FAAC1911B6127D9006583DF /* LaunchScreen.xib in Resources */, 222 | 5FAAC18E1B6127D9006583DF /* Images.xcassets in Resources */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | 5FAAC1941B6127D9006583DF /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | /* End PBXResourcesBuildPhase section */ 234 | 235 | /* Begin PBXSourcesBuildPhase section */ 236 | 5FAAC1791B6127D9006583DF /* Sources */ = { 237 | isa = PBXSourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | 5FAAC1A81B61286F006583DF /* CircleView.m in Sources */, 241 | 5FAAC1AC1B6128A3006583DF /* CircleLayer.m in Sources */, 242 | 5FAAC1891B6127D9006583DF /* ViewController.m in Sources */, 243 | 5FAAC1861B6127D9006583DF /* AppDelegate.m in Sources */, 244 | 5FAAC1831B6127D9006583DF /* main.m in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | 5FAAC1921B6127D9006583DF /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 5FAAC19D1B6127DA006583DF /* AnimatedCircleDemoTests.m in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXSourcesBuildPhase section */ 257 | 258 | /* Begin PBXTargetDependency section */ 259 | 5FAAC1981B6127D9006583DF /* PBXTargetDependency */ = { 260 | isa = PBXTargetDependency; 261 | target = 5FAAC17C1B6127D9006583DF /* AnimatedCircleDemo */; 262 | targetProxy = 5FAAC1971B6127D9006583DF /* PBXContainerItemProxy */; 263 | }; 264 | /* End PBXTargetDependency section */ 265 | 266 | /* Begin PBXVariantGroup section */ 267 | 5FAAC18A1B6127D9006583DF /* Main.storyboard */ = { 268 | isa = PBXVariantGroup; 269 | children = ( 270 | 5FAAC18B1B6127D9006583DF /* Base */, 271 | ); 272 | name = Main.storyboard; 273 | sourceTree = ""; 274 | }; 275 | 5FAAC18F1B6127D9006583DF /* LaunchScreen.xib */ = { 276 | isa = PBXVariantGroup; 277 | children = ( 278 | 5FAAC1901B6127D9006583DF /* Base */, 279 | ); 280 | name = LaunchScreen.xib; 281 | sourceTree = ""; 282 | }; 283 | /* End PBXVariantGroup section */ 284 | 285 | /* Begin XCBuildConfiguration section */ 286 | 5FAAC19E1B6127DA006583DF /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ALWAYS_SEARCH_USER_PATHS = NO; 290 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 291 | CLANG_CXX_LIBRARY = "libc++"; 292 | CLANG_ENABLE_MODULES = YES; 293 | CLANG_ENABLE_OBJC_ARC = YES; 294 | CLANG_WARN_BOOL_CONVERSION = YES; 295 | CLANG_WARN_CONSTANT_CONVERSION = YES; 296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 297 | CLANG_WARN_EMPTY_BODY = YES; 298 | CLANG_WARN_ENUM_CONVERSION = YES; 299 | CLANG_WARN_INT_CONVERSION = YES; 300 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 301 | CLANG_WARN_UNREACHABLE_CODE = YES; 302 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 303 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 304 | COPY_PHASE_STRIP = NO; 305 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 306 | ENABLE_STRICT_OBJC_MSGSEND = YES; 307 | GCC_C_LANGUAGE_STANDARD = gnu99; 308 | GCC_DYNAMIC_NO_PIC = NO; 309 | GCC_NO_COMMON_BLOCKS = YES; 310 | GCC_OPTIMIZATION_LEVEL = 0; 311 | GCC_PREPROCESSOR_DEFINITIONS = ( 312 | "DEBUG=1", 313 | "$(inherited)", 314 | ); 315 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 323 | MTL_ENABLE_DEBUG_INFO = YES; 324 | ONLY_ACTIVE_ARCH = YES; 325 | SDKROOT = iphoneos; 326 | TARGETED_DEVICE_FAMILY = "1,2"; 327 | }; 328 | name = Debug; 329 | }; 330 | 5FAAC19F1B6127DA006583DF /* Release */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | SDKROOT = iphoneos; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | 5FAAC1A11B6127DA006583DF /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | INFOPLIST_FILE = AnimatedCircleDemo/Info.plist; 373 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 374 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 375 | PRODUCT_NAME = "$(TARGET_NAME)"; 376 | }; 377 | name = Debug; 378 | }; 379 | 5FAAC1A21B6127DA006583DF /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 383 | INFOPLIST_FILE = AnimatedCircleDemo/Info.plist; 384 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | }; 388 | name = Release; 389 | }; 390 | 5FAAC1A41B6127DA006583DF /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | BUNDLE_LOADER = "$(TEST_HOST)"; 394 | FRAMEWORK_SEARCH_PATHS = ( 395 | "$(SDKROOT)/Developer/Library/Frameworks", 396 | "$(inherited)", 397 | ); 398 | GCC_PREPROCESSOR_DEFINITIONS = ( 399 | "DEBUG=1", 400 | "$(inherited)", 401 | ); 402 | INFOPLIST_FILE = AnimatedCircleDemoTests/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AnimatedCircleDemo.app/AnimatedCircleDemo"; 406 | }; 407 | name = Debug; 408 | }; 409 | 5FAAC1A51B6127DA006583DF /* Release */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | BUNDLE_LOADER = "$(TEST_HOST)"; 413 | FRAMEWORK_SEARCH_PATHS = ( 414 | "$(SDKROOT)/Developer/Library/Frameworks", 415 | "$(inherited)", 416 | ); 417 | INFOPLIST_FILE = AnimatedCircleDemoTests/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AnimatedCircleDemo.app/AnimatedCircleDemo"; 421 | }; 422 | name = Release; 423 | }; 424 | /* End XCBuildConfiguration section */ 425 | 426 | /* Begin XCConfigurationList section */ 427 | 5FAAC1781B6127D9006583DF /* Build configuration list for PBXProject "AnimatedCircleDemo" */ = { 428 | isa = XCConfigurationList; 429 | buildConfigurations = ( 430 | 5FAAC19E1B6127DA006583DF /* Debug */, 431 | 5FAAC19F1B6127DA006583DF /* Release */, 432 | ); 433 | defaultConfigurationIsVisible = 0; 434 | defaultConfigurationName = Release; 435 | }; 436 | 5FAAC1A01B6127DA006583DF /* Build configuration list for PBXNativeTarget "AnimatedCircleDemo" */ = { 437 | isa = XCConfigurationList; 438 | buildConfigurations = ( 439 | 5FAAC1A11B6127DA006583DF /* Debug */, 440 | 5FAAC1A21B6127DA006583DF /* Release */, 441 | ); 442 | defaultConfigurationIsVisible = 0; 443 | defaultConfigurationName = Release; 444 | }; 445 | 5FAAC1A31B6127DA006583DF /* Build configuration list for PBXNativeTarget "AnimatedCircleDemoTests" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 5FAAC1A41B6127DA006583DF /* Debug */, 449 | 5FAAC1A51B6127DA006583DF /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | /* End XCConfigurationList section */ 455 | }; 456 | rootObject = 5FAAC1751B6127D9006583DF /* Project object */; 457 | } 458 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. 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 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/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 | 31 | 37 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/CircleView/CircleLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CircleLayer.h 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CircleLayer : CALayer 12 | 13 | @property(nonatomic,assign)CGFloat progress; 14 | 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/CircleView/CircleLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // CircleLayer.m 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "CircleLayer.h" 10 | #import 11 | 12 | typedef enum MovingPoint { 13 | POINT_D, 14 | POINT_B, 15 | } MovingPoint; 16 | 17 | #define outsideRectSize 90 18 | 19 | @interface CircleLayer() 20 | 21 | /** 22 | * 外接矩形 23 | */ 24 | @property (nonatomic,assign)CGRect outsideRect; 25 | 26 | /** 27 | * 记录上次的progress,方便做差得出滑动方向 28 | */ 29 | @property(nonatomic,assign)CGFloat lastProgress; 30 | 31 | 32 | /** 33 | * 实时记录滑动方向 34 | */ 35 | @property(nonatomic,assign)MovingPoint movePoint; 36 | 37 | @end 38 | 39 | @implementation CircleLayer{ 40 | 41 | } 42 | 43 | -(id)init{ 44 | 45 | self = [super init]; 46 | if (self) { 47 | self.lastProgress = 0.5; 48 | } 49 | return self; 50 | } 51 | 52 | -(id)initWithLayer:(CircleLayer *)layer{ 53 | self = [super initWithLayer:layer]; 54 | if (self) { 55 | 56 | self.progress = layer.progress; 57 | self.outsideRect = layer.outsideRect; 58 | self.lastProgress = layer.lastProgress; 59 | 60 | } 61 | return self; 62 | } 63 | 64 | 65 | -(void)drawInContext:(CGContextRef)ctx{ 66 | 67 | //A-C1、B-C2... 的距离,当设置为正方形边长的1/3.6倍时,画出来的圆弧完美贴合圆形 68 | CGFloat offset = self.outsideRect.size.width / 3.6; 69 | 70 | //A.B.C.D实际需要移动的距离.系数为滑块偏离中点0.5的绝对值再乘以2.当滑到两端的时候,movedDistance为最大值:「外接矩形宽度的1/5」. 71 | CGFloat movedDistance = (self.outsideRect.size.width * 1 / 6) * fabs(self.progress-0.5)*2; 72 | 73 | //方便下方计算各点坐标,先算出外接矩形的中心点坐标 74 | CGPoint rectCenter = CGPointMake(self.outsideRect.origin.x + self.outsideRect.size.width/2 , self.outsideRect.origin.y + self.outsideRect.size.height/2); 75 | 76 | 77 | CGPoint pointA = CGPointMake(rectCenter.x ,self.outsideRect.origin.y + movedDistance); 78 | CGPoint pointB = CGPointMake(self.movePoint == POINT_D ? rectCenter.x + self.outsideRect.size.width/2 : rectCenter.x + self.outsideRect.size.width/2 + movedDistance*2 ,rectCenter.y); 79 | CGPoint pointC = CGPointMake(rectCenter.x ,rectCenter.y + self.outsideRect.size.height/2 - movedDistance); 80 | CGPoint pointD = CGPointMake(self.movePoint == POINT_D ? self.outsideRect.origin.x - movedDistance*2 : self.outsideRect.origin.x, rectCenter.y); 81 | 82 | 83 | CGPoint c1 = CGPointMake(pointA.x + offset, pointA.y); 84 | CGPoint c2 = CGPointMake(pointB.x, self.movePoint == POINT_D ? pointB.y - offset : pointB.y - offset + movedDistance); 85 | 86 | CGPoint c3 = CGPointMake(pointB.x, self.movePoint == POINT_D ? pointB.y + offset : pointB.y + offset - movedDistance); 87 | CGPoint c4 = CGPointMake(pointC.x + offset, pointC.y); 88 | 89 | CGPoint c5 = CGPointMake(pointC.x - offset, pointC.y); 90 | CGPoint c6 = CGPointMake(pointD.x, self.movePoint == POINT_D ? pointD.y + offset - movedDistance : pointD.y + offset); 91 | 92 | CGPoint c7 = CGPointMake(pointD.x, self.movePoint == POINT_D ? pointD.y - offset + movedDistance : pointD.y - offset); 93 | CGPoint c8 = CGPointMake(pointA.x - offset, pointA.y); 94 | 95 | 96 | //外接虚线矩形 97 | UIBezierPath *rectPath = [UIBezierPath bezierPathWithRect:self.outsideRect]; 98 | CGContextAddPath(ctx, rectPath.CGPath); 99 | CGContextSetStrokeColorWithColor(ctx, [UIColor blackColor].CGColor); 100 | CGContextSetLineWidth(ctx, 1.0); 101 | CGFloat dash[] = {5.0, 5.0}; 102 | CGContextSetLineDash(ctx, 0.0, dash, 2); //1 103 | CGContextStrokePath(ctx); //给线条填充颜色 104 | 105 | 106 | //圆的边界 107 | UIBezierPath* ovalPath = [UIBezierPath bezierPath]; 108 | [ovalPath moveToPoint: pointA]; 109 | [ovalPath addCurveToPoint:pointB controlPoint1:c1 controlPoint2:c2]; 110 | [ovalPath addCurveToPoint:pointC controlPoint1:c3 controlPoint2:c4]; 111 | [ovalPath addCurveToPoint:pointD controlPoint1:c5 controlPoint2:c6]; 112 | [ovalPath addCurveToPoint:pointA controlPoint1:c7 controlPoint2:c8]; 113 | [ovalPath closePath]; 114 | 115 | CGContextAddPath(ctx, ovalPath.CGPath); 116 | CGContextSetStrokeColorWithColor(ctx, [UIColor blackColor].CGColor); 117 | CGContextSetFillColorWithColor(ctx, [UIColor redColor].CGColor); 118 | CGContextSetLineDash(ctx, 0, NULL, 0); //2 119 | CGContextDrawPath(ctx, kCGPathFillStroke); //同时给线条和线条包围的内部区域填充颜色 120 | 121 | 122 | //标记出每个点并连线,方便观察,给所有关键点染色 -- 白色,辅助线颜色 -- 白色 123 | //语法糖:字典@{},数组@[],基本数据类型封装成对象@234,@12.0,@YES,@(234+12.0) 124 | CGContextSetFillColorWithColor(ctx, [UIColor yellowColor].CGColor); 125 | CGContextSetStrokeColorWithColor(ctx, [UIColor blackColor].CGColor); 126 | NSArray *points = @[[NSValue valueWithCGPoint:pointA],[NSValue valueWithCGPoint:pointB],[NSValue valueWithCGPoint:pointC],[NSValue valueWithCGPoint:pointD],[NSValue valueWithCGPoint:c1],[NSValue valueWithCGPoint:c2],[NSValue valueWithCGPoint:c3],[NSValue valueWithCGPoint:c4],[NSValue valueWithCGPoint:c5],[NSValue valueWithCGPoint:c6],[NSValue valueWithCGPoint:c7],[NSValue valueWithCGPoint:c8]]; 127 | [self drawPoint:points withContext:ctx]; 128 | 129 | //连接辅助线 130 | UIBezierPath *helperline = [UIBezierPath bezierPath]; 131 | [helperline moveToPoint:pointA]; 132 | [helperline addLineToPoint:c1]; 133 | [helperline addLineToPoint:c2]; 134 | [helperline addLineToPoint:pointB]; 135 | [helperline addLineToPoint:c3]; 136 | [helperline addLineToPoint:c4]; 137 | [helperline addLineToPoint:pointC]; 138 | [helperline addLineToPoint:c5]; 139 | [helperline addLineToPoint:c6]; 140 | [helperline addLineToPoint:pointD]; 141 | [helperline addLineToPoint:c7]; 142 | [helperline addLineToPoint:c8]; 143 | [helperline closePath]; 144 | 145 | CGContextAddPath(ctx, helperline.CGPath); 146 | 147 | CGFloat dash2[] = {2.0, 2.0}; 148 | CGContextSetLineDash(ctx, 0.0, dash2, 2); 149 | CGContextStrokePath(ctx); //给辅助线条填充颜色 150 | 151 | } 152 | 153 | //ctx字面意思是上下文,你可以理解为一块全局的画布。也就是说,一旦在某个地方改了画布的一些属性,其他任何使用画布的属性的时候都是改了之后的。比如上面在 //1 中把线条样式改成了虚线,那么在下文 //2 中如果不恢复成连续的直线,那么画出来的依然是//1中的虚线样式。 154 | 155 | //在某个point位置画一个点,方便观察运动情况 156 | -(void)drawPoint:(NSArray *)points withContext:(CGContextRef)ctx{ 157 | 158 | for (NSValue *pointValue in points) { 159 | CGPoint point = [pointValue CGPointValue]; 160 | CGContextFillRect(ctx, CGRectMake(point.x - 2,point.y - 2,4,4)); 161 | } 162 | } 163 | 164 | -(void)setProgress:(CGFloat)progress{ 165 | _progress = progress; 166 | 167 | //只要外接矩形在左侧,则改变B点;在右边,改变D点 168 | if (progress <= 0.5) { 169 | 170 | self.movePoint = POINT_B; 171 | NSLog(@"B点动"); 172 | 173 | }else{ 174 | 175 | self.movePoint = POINT_D; 176 | NSLog(@"D点动"); 177 | } 178 | 179 | self.lastProgress = progress; 180 | 181 | 182 | CGFloat origin_x = self.position.x - outsideRectSize/2 + (progress - 0.5)*(self.frame.size.width - outsideRectSize); 183 | CGFloat origin_y = self.position.y - outsideRectSize/2; 184 | 185 | self.outsideRect = CGRectMake(origin_x, origin_y, outsideRectSize, outsideRectSize); 186 | 187 | [self setNeedsDisplay]; 188 | } 189 | 190 | @end 191 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/CircleView/CircleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CircleView.h 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CircleLayer.h" 11 | 12 | @interface CircleView : UIView 13 | 14 | @property(nonatomic,strong)CircleLayer *circleLayer; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/CircleView/CircleView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CircleView.m 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "CircleView.h" 10 | 11 | @implementation CircleView 12 | 13 | + (Class)layerClass{ 14 | 15 | return [CircleLayer class]; 16 | 17 | } 18 | 19 | 20 | -(id)initWithFrame:(CGRect)frame{ 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | 24 | self.circleLayer = [CircleLayer layer]; 25 | self.circleLayer.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); 26 | self.circleLayer.contentsScale = [UIScreen mainScreen].scale; 27 | [self.layer addSublayer:self.circleLayer]; 28 | } 29 | return self; 30 | } 31 | 32 | 33 | 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "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 | } -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "CircleView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet UISlider *mySlider; 14 | @property (weak, nonatomic) IBOutlet UILabel *currentValueLabel; 15 | @property (strong,nonatomic) CircleView *cv; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | [self.mySlider addTarget:self action:@selector(valuechanged:) forControlEvents:UIControlEventValueChanged]; 25 | 26 | self.cv = [[CircleView alloc]initWithFrame:CGRectMake(self.view.frame.size.width/2 - 320/2, self.view.frame.size.height/2 - 320/2, 320, 320)]; 27 | // self.cv.backgroundColor = [UIColor lightGrayColor]; 28 | [self.view addSubview:self.cv]; 29 | 30 | //首次进入 31 | self.cv.circleLayer.progress = _mySlider.value; 32 | } 33 | 34 | 35 | -(void)valuechanged:(UISlider *)sender{ 36 | 37 | self.currentValueLabel.text = [NSString stringWithFormat:@"Current: %f",sender.value]; 38 | self.cv.circleLayer.progress = sender.value; 39 | 40 | 41 | } 42 | 43 | - (void)didReceiveMemoryWarning { 44 | [super didReceiveMemoryWarning]; 45 | // Dispose of any resources that can be recreated. 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AnimatedCircleDemo 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. 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 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemoTests/AnimatedCircleDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // AnimatedCircleDemoTests.m 3 | // AnimatedCircleDemoTests 4 | // 5 | // Created by Kitten Yang on 7/23/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AnimatedCircleDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation AnimatedCircleDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /AnimatedCircleDemo/AnimatedCircleDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. 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 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/CurveLayer/CurveLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CurveLayer.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CurveLayer : CALayer 13 | 14 | /** 15 | * CurveLayer的进度 0~1 16 | */ 17 | @property(nonatomic,assign)CGFloat progress; 18 | 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/CurveLayer/CurveLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // CurveLayer.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #define Radius 10 10 | #define Space 1 11 | #define LineLength 30 12 | #define CenterY self.frame.size.height/2 13 | 14 | #define Degree M_PI/3 15 | 16 | #import "CurveLayer.h" 17 | 18 | @implementation CurveLayer 19 | 20 | -(void)drawInContext:(CGContextRef)ctx{ 21 | 22 | [super drawInContext:ctx]; 23 | 24 | UIGraphicsPushContext(ctx); 25 | CGContextRef context = UIGraphicsGetCurrentContext(); 26 | 27 | //Path 1 28 | UIBezierPath *curvePath1 = [UIBezierPath bezierPath]; 29 | curvePath1.lineCapStyle = kCGLineCapRound; 30 | curvePath1.lineJoinStyle = kCGLineJoinRound; 31 | curvePath1.lineWidth = 2.0f; 32 | 33 | //arrowPath 34 | UIBezierPath *arrowPath = [UIBezierPath bezierPath]; 35 | 36 | if (self.progress <= 0.5) { 37 | 38 | CGPoint pointA = CGPointMake(self.frame.size.width/2-Radius, CenterY - Space + LineLength + (1-2*self.progress)*(CenterY-LineLength)); 39 | CGPoint pointB = CGPointMake(self.frame.size.width/2-Radius, CenterY - Space + (1-2*self.progress)*(CenterY-LineLength)); 40 | [curvePath1 moveToPoint:pointA]; 41 | [curvePath1 addLineToPoint:pointB]; 42 | 43 | //arrow 44 | [arrowPath moveToPoint:pointB]; 45 | [arrowPath addLineToPoint:CGPointMake(pointB.x - 3*(cosf(Degree)), pointB.y + 3*(sinf(Degree)))]; 46 | [curvePath1 appendPath:arrowPath]; 47 | 48 | }else if (self.progress > 0.5) { 49 | 50 | CGPoint pointA = CGPointMake(self.frame.size.width/2-Radius, CenterY - Space + LineLength - LineLength*(self.progress-0.5)*2); 51 | CGPoint pointB = CGPointMake(self.frame.size.width/2-Radius, CenterY - Space); 52 | 53 | [curvePath1 moveToPoint:pointA]; 54 | [curvePath1 addLineToPoint:pointB]; 55 | [curvePath1 addArcWithCenter:CGPointMake(self.frame.size.width/2, CenterY-Space) radius:Radius startAngle:M_PI endAngle:M_PI + ((M_PI*9/10) * (self.progress-0.5)*2) clockwise:YES]; 56 | 57 | //arrow 58 | [arrowPath moveToPoint:curvePath1.currentPoint]; 59 | [arrowPath addLineToPoint:CGPointMake(curvePath1.currentPoint.x - 3*(cosf(Degree - ((M_PI*9/10) * (self.progress-0.5)*2))), curvePath1.currentPoint.y + 3*(sinf(Degree - ((M_PI*9/10) * (self.progress-0.5)*2))))]; 60 | [curvePath1 appendPath:arrowPath]; 61 | } 62 | 63 | //Path 2 64 | UIBezierPath *curvePath2 = [UIBezierPath bezierPath]; 65 | curvePath2.lineCapStyle = kCGLineCapRound; 66 | curvePath2.lineJoinStyle = kCGLineJoinRound; 67 | curvePath2.lineWidth = 2.0f; 68 | 69 | if (self.progress <= 0.5) { 70 | 71 | CGPoint pointA = CGPointMake(self.frame.size.width/2+Radius, 2*self.progress * (CenterY + Space - LineLength)); 72 | CGPoint pointB = CGPointMake(self.frame.size.width/2+Radius,LineLength + 2*self.progress*(CenterY + Space - LineLength)); 73 | [curvePath2 moveToPoint:pointA]; 74 | [curvePath2 addLineToPoint:pointB]; 75 | 76 | //arrow 77 | [arrowPath moveToPoint:pointB]; 78 | [arrowPath addLineToPoint:CGPointMake(pointB.x + 3*(cosf(Degree)), pointB.y - 3*(sinf(Degree)))]; 79 | [curvePath2 appendPath:arrowPath]; 80 | 81 | } 82 | 83 | if (self.progress > 0.5) { 84 | [curvePath2 moveToPoint:CGPointMake(self.frame.size.width/2+Radius, CenterY + Space - LineLength + LineLength*(self.progress-0.5)*2)]; 85 | [curvePath2 addLineToPoint:CGPointMake(self.frame.size.width/2+Radius, CenterY + Space)]; 86 | [curvePath2 addArcWithCenter:CGPointMake(self.frame.size.width/2, (CenterY+Space)) radius:Radius startAngle:0 endAngle:(M_PI*9/10)*(self.progress-0.5)*2 clockwise:YES]; 87 | 88 | //arrow 89 | [arrowPath moveToPoint:curvePath2.currentPoint]; 90 | [arrowPath addLineToPoint:CGPointMake(curvePath2.currentPoint.x + 3*(cosf(Degree - ((M_PI*9/10) * (self.progress-0.5)*2))), curvePath2.currentPoint.y - 3*(sinf(Degree - ((M_PI*9/10) * (self.progress-0.5)*2))))]; 91 | [curvePath2 appendPath:arrowPath]; 92 | 93 | } 94 | 95 | CGContextSaveGState(context); 96 | CGContextRestoreGState(context); 97 | 98 | [[UIColor blackColor] setStroke]; 99 | [arrowPath stroke]; 100 | [curvePath1 stroke]; 101 | [curvePath2 stroke]; 102 | 103 | UIGraphicsPopContext(); 104 | 105 | } 106 | 107 | 108 | #pragma mark -- Help Method 109 | 110 | -(CGPoint)getMiddlePointWithPoint1:(CGPoint)point1 point2:(CGPoint)point2{ 111 | CGFloat middle_x = (point1.x + point2.x)/2; 112 | CGFloat middle_y = (point1.y + point2.y)/2; 113 | return CGPointMake(middle_x, middle_y); 114 | } 115 | 116 | -(CGFloat)getDistanceWithPoint1:(CGPoint)point1 point2:(CGPoint)point2{ 117 | 118 | return sqrtf(pow(fabs(point1.x - point2.x), 2) + pow(fabs(point1.y - point2.y), 2)); 119 | 120 | } 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/CurveView/CurveView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CurveView.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CurveView : UIView 12 | 13 | 14 | /** 15 | * CurveView的进度 0~1 16 | */ 17 | @property(nonatomic,assign)CGFloat progress; 18 | 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/CurveView/CurveView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CurveView.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "CurveView.h" 10 | #import "CurveLayer.h" 11 | 12 | 13 | @interface CurveView() 14 | 15 | @property (nonatomic,strong)CurveLayer *curveLayer; 16 | 17 | @end 18 | 19 | @implementation CurveView 20 | 21 | 22 | + (Class)layerClass{ 23 | return [CurveLayer class]; 24 | } 25 | 26 | -(id)initWithFrame:(CGRect)frame{ 27 | self = [super initWithFrame:frame]; 28 | if (self) { 29 | } 30 | return self; 31 | } 32 | 33 | 34 | -(void)setProgress:(CGFloat)progress{ 35 | self.curveLayer.progress = progress; 36 | [self.curveLayer setNeedsDisplay]; 37 | } 38 | 39 | -(void)willMoveToSuperview:(UIView *)newSuperview{ 40 | self.curveLayer = [CurveLayer layer]; 41 | self.curveLayer.frame = self.bounds; 42 | self.curveLayer.contentsScale = [UIScreen mainScreen].scale; 43 | self.curveLayer.progress = 0.0f; 44 | [self.curveLayer setNeedsDisplay]; 45 | [self.layer addSublayer:self.curveLayer]; 46 | 47 | } 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/Helpers/UIView+Convenient.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Convenient.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | CGPoint CGRectGetCenter(CGRect rect); 12 | CGRect CGRectMoveToCenter(CGRect rect, CGPoint center); 13 | 14 | @interface UIView (Convenient) 15 | 16 | 17 | @property CGPoint origin; 18 | @property CGSize size; 19 | @property (readonly) CGPoint bottomLeft; 20 | @property (readonly) CGPoint bottomRight; 21 | @property (readonly) CGPoint topRight; 22 | @property CGFloat height; 23 | @property CGFloat width; 24 | @property CGFloat top; 25 | @property CGFloat left; 26 | @property CGFloat bottom; 27 | @property CGFloat right; 28 | @property CGFloat x; 29 | @property CGFloat y; 30 | 31 | 32 | 33 | - (void) moveBy: (CGPoint) delta; 34 | - (void) scaleBy: (CGFloat) scaleFactor; 35 | - (void) fitInSize: (CGSize) aSize; 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/Helpers/UIView+Convenient.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Convenient.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "UIView+Convenient.h" 10 | 11 | CGPoint CGRectGetCenter(CGRect rect) 12 | { 13 | CGPoint pt; 14 | pt.x = CGRectGetMidX(rect); 15 | pt.y = CGRectGetMidY(rect); 16 | return pt; 17 | } 18 | 19 | CGRect CGRectMoveToCenter(CGRect rect, CGPoint center) 20 | { 21 | CGRect newrect = CGRectZero; 22 | newrect.origin.x = center.x-CGRectGetMidX(rect); 23 | newrect.origin.y = center.y-CGRectGetMidY(rect); 24 | newrect.size = rect.size; 25 | return newrect; 26 | } 27 | 28 | 29 | 30 | @implementation UIView (Convenient) 31 | 32 | 33 | - (CGPoint) origin 34 | { 35 | return self.frame.origin; 36 | } 37 | - (void) setOrigin: (CGPoint) aPoint 38 | { 39 | CGRect newframe = self.frame; 40 | newframe.origin = aPoint; 41 | self.frame = newframe; 42 | } 43 | 44 | 45 | - (CGSize) size 46 | { 47 | return self.frame.size; 48 | } 49 | - (void) setSize: (CGSize) aSize 50 | { 51 | CGRect newframe = self.frame; 52 | newframe.size = aSize; 53 | self.frame = newframe; 54 | } 55 | 56 | 57 | - (CGPoint) bottomRight 58 | { 59 | CGFloat x = self.frame.origin.x + self.frame.size.width; 60 | CGFloat y = self.frame.origin.y + self.frame.size.height; 61 | return CGPointMake(x, y); 62 | } 63 | 64 | - (CGPoint) bottomLeft 65 | { 66 | CGFloat x = self.frame.origin.x; 67 | CGFloat y = self.frame.origin.y + self.frame.size.height; 68 | return CGPointMake(x, y); 69 | } 70 | 71 | - (CGPoint) topRight 72 | { 73 | CGFloat x = self.frame.origin.x + self.frame.size.width; 74 | CGFloat y = self.frame.origin.y; 75 | return CGPointMake(x, y); 76 | } 77 | 78 | 79 | 80 | 81 | - (CGFloat) height 82 | { 83 | return self.frame.size.height; 84 | } 85 | - (void) setHeight: (CGFloat) newheight 86 | { 87 | CGRect newframe = self.frame; 88 | newframe.size.height = newheight; 89 | self.frame = newframe; 90 | } 91 | 92 | 93 | 94 | 95 | - (CGFloat) width 96 | { 97 | return self.frame.size.width; 98 | } 99 | - (void) setWidth: (CGFloat) newwidth 100 | { 101 | CGRect newframe = self.frame; 102 | newframe.size.width = newwidth; 103 | self.frame = newframe; 104 | } 105 | 106 | 107 | 108 | - (CGFloat) top 109 | { 110 | return self.frame.origin.y; 111 | } 112 | - (void) setTop: (CGFloat) newtop 113 | { 114 | CGRect newframe = self.frame; 115 | newframe.origin.y = newtop; 116 | self.frame = newframe; 117 | } 118 | 119 | 120 | 121 | 122 | - (CGFloat) left 123 | { 124 | return self.frame.origin.x; 125 | } 126 | - (void) setLeft: (CGFloat) newleft 127 | { 128 | CGRect newframe = self.frame; 129 | newframe.origin.x = newleft; 130 | self.frame = newframe; 131 | } 132 | 133 | 134 | 135 | - (CGFloat) bottom 136 | { 137 | return self.frame.origin.y + self.frame.size.height; 138 | } 139 | - (void) setBottom: (CGFloat) newbottom 140 | { 141 | CGRect newframe = self.frame; 142 | newframe.origin.y = newbottom - self.frame.size.height; 143 | self.frame = newframe; 144 | } 145 | 146 | 147 | 148 | - (CGFloat) right 149 | { 150 | return self.frame.origin.x + self.frame.size.width; 151 | } 152 | - (void) setRight: (CGFloat) newright 153 | { 154 | CGFloat delta = newright - (self.frame.origin.x + self.frame.size.width); 155 | CGRect newframe = self.frame; 156 | newframe.origin.x += delta ; 157 | self.frame = newframe; 158 | } 159 | 160 | - (CGFloat)x{ 161 | return self.frame.origin.x; 162 | } 163 | - (void)setX:(CGFloat)x{ 164 | CGRect frame = self.frame; 165 | frame.origin.x = x; 166 | self.frame = frame; 167 | } 168 | 169 | 170 | - (CGFloat)y{ 171 | return self.frame.origin.y; 172 | } 173 | - (void)setY:(CGFloat)y{ 174 | CGRect frame = self.frame; 175 | frame.origin.y = y; 176 | self.frame = frame; 177 | } 178 | 179 | 180 | 181 | - (void) moveBy: (CGPoint) delta 182 | { 183 | CGPoint newcenter = self.center; 184 | newcenter.x += delta.x; 185 | newcenter.y += delta.y; 186 | self.center = newcenter; 187 | } 188 | 189 | 190 | - (void) scaleBy: (CGFloat) scaleFactor 191 | { 192 | CGRect newframe = self.frame; 193 | newframe.size.width *= scaleFactor; 194 | newframe.size.height *= scaleFactor; 195 | self.frame = newframe; 196 | } 197 | 198 | 199 | - (void) fitInSize: (CGSize) aSize 200 | { 201 | CGFloat scale; 202 | CGRect newframe = self.frame; 203 | 204 | if (newframe.size.height && (newframe.size.height > aSize.height)) 205 | { 206 | scale = aSize.height / newframe.size.height; 207 | newframe.size.width *= scale; 208 | newframe.size.height *= scale; 209 | } 210 | 211 | if (newframe.size.width && (newframe.size.width >= aSize.width)) 212 | { 213 | scale = aSize.width / newframe.size.width; 214 | newframe.size.width *= scale; 215 | newframe.size.height *= scale; 216 | } 217 | 218 | self.frame = newframe; 219 | } 220 | 221 | 222 | 223 | @end 224 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "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 | } -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/KYPullToCurveVeiw/KYPullToCurveVeiw.h: -------------------------------------------------------------------------------- 1 | // 2 | // KYPullToCurveVeiw.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | @interface KYPullToCurveVeiw : UIView 14 | 15 | /** 16 | * 需要滑动多大距离才能松开 17 | */ 18 | @property(nonatomic,assign)CGFloat pullDistance; 19 | 20 | 21 | /** 22 | * 初始化方法 23 | * 24 | * @param scrollView 关联的滚动视图 25 | * 26 | * @return self 27 | */ 28 | -(id)initWithAssociatedScrollView:(UIScrollView *)scrollView withNavigationBar:(BOOL)navBar; 29 | 30 | /** 31 | * 立即触发下拉刷新 32 | */ 33 | -(void)triggerPulling; 34 | 35 | /** 36 | * 停止旋转,并且滚动视图回弹到顶部 37 | */ 38 | -(void)stopRefreshing; 39 | 40 | 41 | /** 42 | * 刷新执行的具体操作 43 | * 44 | * @param block 操作 45 | */ 46 | 47 | -(void)addRefreshingBlock:(void (^)(void))block; 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/KYPullToCurveVeiw/KYPullToCurveVeiw.m: -------------------------------------------------------------------------------- 1 | // 2 | // KYPullToCurveVeiw.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "KYPullToCurveVeiw.h" 10 | #import "LabelView.h" 11 | #import "CurveView.h" 12 | #import "UIView+Convenient.h" 13 | 14 | 15 | 16 | @interface KYPullToCurveVeiw() 17 | 18 | @property(nonatomic,assign)CGFloat progress; 19 | @property (nonatomic,weak)UIScrollView *associatedScrollView; 20 | @property (nonatomic,copy)void(^refreshingBlock)(void); 21 | 22 | @end 23 | 24 | 25 | @implementation KYPullToCurveVeiw{ 26 | 27 | LabelView *labelView; 28 | CurveView *curveView; 29 | 30 | CGFloat originOffset; 31 | BOOL willEnd; 32 | BOOL notTracking; 33 | BOOL loading; 34 | } 35 | 36 | 37 | #pragma mark -- Public Method 38 | 39 | -(id)initWithAssociatedScrollView:(UIScrollView *)scrollView withNavigationBar:(BOOL)navBar{ 40 | 41 | self = [super initWithFrame:CGRectMake(scrollView.width/2-200/2, -100, 200, 100)]; 42 | if (self) { 43 | if (navBar) { 44 | originOffset = 64.0f; 45 | }else{ 46 | originOffset = 0.0f; 47 | } 48 | self.associatedScrollView = scrollView; 49 | [self setUp]; 50 | [self.associatedScrollView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld context:nil]; 51 | [self.associatedScrollView insertSubview:self atIndex:0]; 52 | 53 | } 54 | 55 | return self; 56 | 57 | } 58 | 59 | 60 | -(void)setProgress:(CGFloat)progress{ 61 | 62 | if (!self.associatedScrollView.tracking) { 63 | labelView.loading = YES; 64 | } 65 | 66 | if (!willEnd && !loading ) { 67 | // NSLog(@"progress:%f",progress); 68 | curveView.progress = labelView.progress = progress; 69 | } 70 | 71 | 72 | self.center = CGPointMake(self.center.x, -fabs(self.associatedScrollView.contentOffset.y+originOffset)/2); 73 | 74 | 75 | CGFloat diff = fabs(self.associatedScrollView.contentOffset.y+originOffset) - self.pullDistance + 10; 76 | // NSLog(@"diff:%f",diff); 77 | 78 | if (diff > 0) { 79 | 80 | if (!self.associatedScrollView.tracking) { 81 | if (!notTracking) { 82 | notTracking = YES; 83 | loading = YES; 84 | // labelView.loading = YES; 85 | 86 | NSLog(@"旋转"); 87 | 88 | //旋转... 89 | [self startLoading:curveView]; 90 | 91 | [UIView animateWithDuration:0.3 animations:^{ 92 | 93 | self.associatedScrollView.contentInset = UIEdgeInsetsMake(self.pullDistance + originOffset, 0, 0, 0); 94 | 95 | } completion:^(BOOL finished) { 96 | 97 | self.refreshingBlock(); 98 | 99 | }]; 100 | } 101 | } 102 | 103 | if (!loading) { 104 | 105 | curveView.transform = CGAffineTransformMakeRotation(M_PI * (diff*2/180)); 106 | } 107 | 108 | }else{ 109 | 110 | labelView.loading = NO; 111 | curveView.transform = CGAffineTransformIdentity; 112 | 113 | } 114 | 115 | } 116 | 117 | 118 | -(void)addRefreshingBlock:(void (^)(void))block{ 119 | 120 | self.refreshingBlock = block; 121 | 122 | } 123 | 124 | 125 | 126 | -(void)triggerPulling{ 127 | 128 | [self.associatedScrollView setContentOffset:CGPointMake(0, -self.pullDistance-originOffset) animated:YES]; 129 | 130 | } 131 | 132 | 133 | 134 | -(void)stopRefreshing{ 135 | 136 | willEnd = YES; 137 | 138 | self.progress = 1.0; 139 | [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 140 | self.alpha = 0.0f; 141 | self.associatedScrollView.contentInset = UIEdgeInsetsMake(originOffset+0.1, 0, 0, 0); 142 | } completion:^(BOOL finished) { 143 | self.alpha = 1.0f; 144 | willEnd = NO; 145 | notTracking = NO; 146 | loading = NO; 147 | labelView.loading = NO; 148 | [self stopLoading:curveView]; 149 | }]; 150 | 151 | 152 | } 153 | 154 | #pragma mark -- Helper Method 155 | 156 | -(void)setUp{ 157 | 158 | //一些默认参数 159 | self.pullDistance = 99; 160 | 161 | 162 | curveView = [[CurveView alloc]initWithFrame:CGRectMake(20, 0, 30, self.height)]; 163 | [self insertSubview:curveView atIndex:0]; 164 | 165 | 166 | labelView = [[LabelView alloc]initWithFrame:CGRectMake(curveView.right+ 10, curveView.y, 150, curveView.height)]; 167 | [self insertSubview:labelView aboveSubview:curveView]; 168 | 169 | } 170 | 171 | 172 | 173 | 174 | - (void)startLoading:(UIView *)rotateView 175 | { 176 | 177 | rotateView.transform = CGAffineTransformIdentity; 178 | 179 | CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 180 | rotationAnimation.toValue = @(M_PI * 2.0); 181 | rotationAnimation.duration = 0.5f; 182 | rotationAnimation.autoreverses = NO; 183 | rotationAnimation.repeatCount = HUGE_VALF; 184 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 185 | [rotateView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"]; 186 | 187 | } 188 | 189 | 190 | - (void)stopLoading:(UIView *)rotateView{ 191 | 192 | [rotateView.layer removeAllAnimations]; 193 | 194 | } 195 | 196 | #pragma mark -- KVO 197 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ 198 | 199 | if ([keyPath isEqualToString:@"contentOffset"]) { 200 | 201 | CGPoint contentOffset = [[change valueForKey:NSKeyValueChangeNewKey] CGPointValue]; 202 | 203 | if (contentOffset.y + originOffset <= 0) { 204 | 205 | self.progress = MAX(0.0, MIN(fabs(contentOffset.y+originOffset)/self.pullDistance, 1.0)); 206 | 207 | } 208 | } 209 | } 210 | 211 | 212 | #pragma dealloc 213 | -(void)dealloc{ 214 | 215 | [self.associatedScrollView removeObserver:self forKeyPath:@"contentOffset"]; 216 | 217 | } 218 | 219 | @end 220 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/KYPullToCurveVeiw/KYPullToCurveVeiw_footer.h: -------------------------------------------------------------------------------- 1 | // 2 | // KYPullToCurveVeiw_footer.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | @interface KYPullToCurveVeiw_footer : UIView 14 | 15 | /** 16 | * 需要滑动多大距离才能松开 17 | */ 18 | @property(nonatomic,assign)CGFloat pullDistance; 19 | 20 | 21 | /** 22 | * 初始化方法 23 | * 24 | * @param scrollView 关联的滚动视图 25 | * 26 | * @return self 27 | */ 28 | -(id)initWithAssociatedScrollView:(UIScrollView *)scrollView withNavigationBar:(BOOL)navBar; 29 | 30 | 31 | 32 | /** 33 | * 停止旋转,并且滚动视图回弹到底部 34 | */ 35 | -(void)stopRefreshing; 36 | 37 | 38 | /** 39 | * 刷新执行的具体操作 40 | * 41 | * @param block 操作 42 | */ 43 | 44 | -(void)addRefreshingBlock:(void (^)(void))block; 45 | 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/KYPullToCurveVeiw/KYPullToCurveVeiw_footer.m: -------------------------------------------------------------------------------- 1 | // 2 | // KYPullToCurveVeiw.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "KYPullToCurveVeiw_footer.h" 10 | #import "LabelView.h" 11 | #import "CurveView.h" 12 | #import "UIView+Convenient.h" 13 | 14 | 15 | @interface KYPullToCurveVeiw_footer() 16 | 17 | @property(nonatomic,assign)CGFloat progress; 18 | @property (nonatomic,weak)UIScrollView *associatedScrollView; 19 | @property (nonatomic,copy)void(^refreshingBlock)(void); 20 | 21 | @end 22 | 23 | @implementation KYPullToCurveVeiw_footer{ 24 | 25 | LabelView *labelView; 26 | CurveView *curveView; 27 | 28 | CGSize contentSize; 29 | CGFloat originOffset; 30 | BOOL willEnd; 31 | BOOL notTracking; 32 | BOOL loading; 33 | } 34 | 35 | 36 | #pragma mark -- Public Method 37 | 38 | -(id)initWithAssociatedScrollView:(UIScrollView *)scrollView withNavigationBar:(BOOL)navBar{ 39 | 40 | self = [super initWithFrame:CGRectMake(scrollView.width/2-200/2, scrollView.height, 200, 100)]; 41 | if (self) { 42 | if (navBar) { 43 | originOffset = 64.0f; 44 | }else{ 45 | originOffset = 0.0f; 46 | } 47 | self.associatedScrollView = scrollView; 48 | [self setUp]; 49 | [self.associatedScrollView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil]; 50 | [self.associatedScrollView addObserver:self forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil]; 51 | self.hidden = YES; 52 | [self.associatedScrollView insertSubview:self atIndex:0]; 53 | 54 | } 55 | 56 | return self; 57 | 58 | } 59 | 60 | -(void)setProgress:(CGFloat)progress{ 61 | 62 | if (!self.associatedScrollView.tracking) { 63 | labelView.loading = YES; 64 | } 65 | 66 | if (!willEnd && !loading ) { 67 | 68 | curveView.progress = labelView.progress = progress; 69 | } 70 | 71 | CGFloat diff = self.associatedScrollView.contentOffset.y - (self.associatedScrollView.contentSize.height - self.associatedScrollView.height) - self.pullDistance + 10; 72 | 73 | if (diff > 0) { 74 | 75 | if (!self.associatedScrollView.tracking && !self.hidden) { 76 | if (!notTracking) { 77 | notTracking = YES; 78 | loading = YES; 79 | 80 | NSLog(@"旋转"); 81 | 82 | //旋转... 83 | [self startLoading:curveView]; 84 | 85 | [UIView animateWithDuration:0.3 animations:^{ 86 | self.associatedScrollView.contentInset = UIEdgeInsetsMake(originOffset, 0, self.pullDistance, 0); 87 | } completion:^(BOOL finished) { 88 | self.refreshingBlock(); 89 | }]; 90 | } 91 | } 92 | if (!loading) { 93 | curveView.transform = CGAffineTransformMakeRotation(M_PI * (diff*2/180)); 94 | } 95 | }else{ 96 | labelView.loading = NO; 97 | curveView.transform = CGAffineTransformIdentity; 98 | 99 | } 100 | 101 | } 102 | 103 | 104 | -(void)addRefreshingBlock:(void (^)(void))block { 105 | 106 | self.refreshingBlock = block; 107 | 108 | } 109 | 110 | -(void)stopRefreshing { 111 | 112 | willEnd = YES; 113 | 114 | self.progress = 1.0; 115 | [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 116 | self.alpha = 0.0f; 117 | self.associatedScrollView.contentInset = UIEdgeInsetsMake(originOffset, 0, 0, 0); 118 | } completion:^(BOOL finished) { 119 | self.alpha = 1.0f; 120 | willEnd = NO; 121 | notTracking = NO; 122 | loading = NO; 123 | labelView.loading = NO; 124 | [self stopLoading:curveView]; 125 | }]; 126 | 127 | 128 | } 129 | 130 | #pragma mark -- Helper Method 131 | 132 | -(void)setUp { 133 | 134 | //一些默认参数 135 | self.pullDistance = 99; 136 | 137 | curveView = [[CurveView alloc]initWithFrame:CGRectMake(20, 0, 30, self.height)]; 138 | [self insertSubview:curveView atIndex:0]; 139 | 140 | labelView = [[LabelView alloc]initWithFrame:CGRectMake(curveView.right+ 10, curveView.y, 150, curveView.height)]; 141 | labelView.state = UP; 142 | [self insertSubview:labelView aboveSubview:curveView]; 143 | 144 | } 145 | 146 | - (void)startLoading:(UIView *)rotateView { 147 | 148 | rotateView.transform = CGAffineTransformIdentity; 149 | 150 | CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 151 | rotationAnimation.toValue = @(M_PI * 2.0); 152 | rotationAnimation.duration = 0.5f; 153 | rotationAnimation.autoreverses = NO; 154 | rotationAnimation.repeatCount = HUGE_VALF; 155 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 156 | [rotateView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"]; 157 | 158 | } 159 | 160 | 161 | - (void)stopLoading:(UIView *)rotateView{ 162 | [rotateView.layer removeAllAnimations]; 163 | } 164 | 165 | #pragma mark -- KVO 166 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ 167 | 168 | if ([keyPath isEqualToString:@"contentSize"]) { 169 | contentSize = [[change valueForKey:NSKeyValueChangeNewKey]CGSizeValue]; 170 | if (contentSize.height > 0.0) { 171 | self.hidden = NO; 172 | } 173 | self.frame = CGRectMake(self.associatedScrollView.width/2-200/2, contentSize.height, 200, 100); 174 | } 175 | 176 | if ([keyPath isEqualToString:@"contentOffset"]) { 177 | CGPoint contentOffset = [[change valueForKey:NSKeyValueChangeNewKey] CGPointValue]; 178 | if (contentOffset.y >= (contentSize.height - self.associatedScrollView.height)) { 179 | 180 | self.center = CGPointMake(self.center.x, contentSize.height + (contentOffset.y - (contentSize.height - self.associatedScrollView.height))/2); 181 | 182 | self.progress = MAX(0.0, MIN((contentOffset.y - (contentSize.height - self.associatedScrollView.height)) / self.pullDistance, 1.0)); 183 | } 184 | } 185 | 186 | } 187 | 188 | 189 | #pragma dealloc 190 | 191 | -(void)dealloc{ 192 | [self.associatedScrollView removeObserver:self forKeyPath:@"contentOffset"]; 193 | [self.associatedScrollView removeObserver:self forKeyPath:@"contentSize"]; 194 | 195 | } 196 | 197 | @end 198 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/LabelView/LabelView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LabelView.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef enum : NSUInteger { 13 | UP, 14 | DOWN, 15 | } PULLINGSTATE; 16 | 17 | @interface LabelView : UIView 18 | 19 | 20 | /** 21 | * LabelView的进度 0~1 22 | */ 23 | @property(nonatomic,assign)CGFloat progress; 24 | 25 | 26 | /** 27 | * 是否正在刷新 28 | */ 29 | @property(nonatomic,assign)BOOL loading; 30 | 31 | 32 | /** 33 | * 上拉还是下拉 34 | */ 35 | @property(nonatomic,assign)PULLINGSTATE state; 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/LabelView/LabelView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LabelView.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by yangqitao on 15/7/8. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "LabelView.h" 10 | #import "UIView+Convenient.h" 11 | 12 | #define kPullingDownString @"下拉即可刷新..." 13 | #define kPullingUpString @"上拉即可刷新" 14 | #define kReleaseString @"松开即可刷新..." 15 | 16 | #define kPullingString self.state == UP ? kPullingUpString : kPullingDownString 17 | 18 | 19 | //#define self.state 20 | 21 | #define LabelHeight 50 22 | 23 | @interface LabelView() 24 | 25 | 26 | @end 27 | 28 | @implementation LabelView{ 29 | UILabel *titleLabel; 30 | } 31 | 32 | -(id)initWithFrame:(CGRect)frame{ 33 | 34 | self = [super initWithFrame:frame]; 35 | if (self) { 36 | [self setUp]; 37 | } 38 | return self; 39 | } 40 | 41 | 42 | -(void)setUp{ 43 | self.state = DOWN; 44 | titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.height/2-LabelHeight/2, self.width, LabelHeight)]; 45 | titleLabel.text = kPullingString; 46 | titleLabel.textColor = [UIColor blackColor]; 47 | titleLabel.adjustsFontSizeToFitWidth = YES; 48 | [self addSubview:titleLabel]; 49 | } 50 | 51 | 52 | -(void)setProgress:(CGFloat)progress{ 53 | 54 | titleLabel.alpha = progress; 55 | 56 | if (!self.loading) { 57 | if (progress >= 1.0) { 58 | titleLabel.text = kReleaseString; 59 | }else{ 60 | titleLabel.text = kPullingString; 61 | } 62 | }else{ 63 | 64 | if (progress >= 0.91) { 65 | titleLabel.text = kReleaseString; 66 | }else{ 67 | titleLabel.text = kPullingString; 68 | } 69 | } 70 | 71 | } 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UIView+Convenient.h" 11 | 12 | #import "KYPullToCurveVeiw.h" 13 | #import "KYPullToCurveVeiw_footer.h" 14 | 15 | 16 | #define initialOffset 50.0 17 | 18 | #define targetHeight 500.0 19 | 20 | @interface ViewController () 21 | 22 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 23 | 24 | @end 25 | 26 | @implementation ViewController{ 27 | 28 | UILabel *navTitle; 29 | UIView *bkView; 30 | } 31 | 32 | - (void)viewDidLoad { 33 | [super viewDidLoad]; 34 | 35 | self.tableView.delegate = self; 36 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"testCell"]; 37 | [self.tableView layoutIfNeeded]; 38 | 39 | bkView = [[UIView alloc]init]; 40 | bkView.center = CGPointMake(self.view.center.x, 22); 41 | bkView.bounds = CGRectMake(0, 0, 250, 44); 42 | bkView.clipsToBounds = YES; 43 | [self.navigationController.navigationBar addSubview:bkView]; 44 | 45 | navTitle = [[UILabel alloc]initWithFrame:CGRectMake(0, 44+initialOffset,bkView.frame.size.width, 44)]; 46 | navTitle.alpha = 0; 47 | navTitle.textAlignment = NSTextAlignmentCenter; 48 | navTitle.textColor = [UIColor blackColor]; 49 | navTitle.text = @"Fade in/out navbar title"; 50 | [bkView addSubview:navTitle]; 51 | 52 | } 53 | 54 | -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ 55 | 56 | 57 | CGFloat transitionY = MIN(MAX(0, scrollView.contentOffset.y+64), 44+initialOffset+targetHeight); 58 | NSLog(@"%f",transitionY); 59 | if (transitionY <= initialOffset) { 60 | navTitle.frame = CGRectMake(0, 44+initialOffset-transitionY,bkView.frame.size.width , 44); 61 | }else{ 62 | 63 | CGFloat factor = MAX(0, MIN(1, (transitionY-initialOffset)/targetHeight)); 64 | navTitle.frame = CGRectMake(0, 44-factor*44,bkView.frame.size.width , 44); 65 | navTitle.alpha = factor*factor*1; 66 | } 67 | 68 | } 69 | 70 | -(void)viewWillAppear:(BOOL)animated{ 71 | [super viewWillAppear:animated]; 72 | 73 | KYPullToCurveVeiw *headerView = [[KYPullToCurveVeiw alloc]initWithAssociatedScrollView:self.tableView withNavigationBar:YES]; 74 | 75 | 76 | __weak KYPullToCurveVeiw *weakHeaderView = headerView; 77 | 78 | [headerView triggerPulling]; 79 | [headerView addRefreshingBlock:^{ 80 | 81 | //具体的操作 82 | //... 83 | 84 | double delayInSeconds = 2.0; 85 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); 86 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 87 | [weakHeaderView stopRefreshing]; 88 | }); 89 | 90 | }]; 91 | 92 | 93 | KYPullToCurveVeiw_footer *footerView = [[KYPullToCurveVeiw_footer alloc]initWithAssociatedScrollView:self.tableView withNavigationBar:YES]; 94 | 95 | __weak KYPullToCurveVeiw_footer *weakFooterView= footerView; 96 | 97 | [footerView addRefreshingBlock:^{ 98 | 99 | //具体的操作,模拟 2s 倒计时 100 | double delayInSeconds = 2.0; 101 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); 102 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 103 | [weakFooterView stopRefreshing]; 104 | }); 105 | 106 | }]; 107 | 108 | 109 | } 110 | 111 | 112 | #pragma mark -- UITableViewDataSource 113 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 114 | return 50; 115 | } 116 | 117 | 118 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 119 | 120 | UITableViewCell *testCell = [tableView dequeueReusableCellWithIdentifier:@"testCell" forIndexPath:indexPath]; 121 | testCell.textLabel.text = [NSString stringWithFormat:@"第%ld条",(long)indexPath.row]; 122 | return testCell; 123 | 124 | } 125 | 126 | 127 | 128 | - (void)didReceiveMemoryWarning { 129 | [super didReceiveMemoryWarning]; 130 | } 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AnimatedCurveDemo 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. 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 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemoTests/AnimatedCurveDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // AnimatedCurveDemoTests.m 3 | // AnimatedCurveDemoTests 4 | // 5 | // Created by Kitten Yang on 7/6/15. 6 | // Copyright (c) 2015 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AnimatedCurveDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation AnimatedCurveDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /AnimatedCurveDemo/AnimatedCurveDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /GooeyBubble.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/GooeyBubble.gif -------------------------------------------------------------------------------- /GooeySlideMenu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/GooeySlideMenu.gif -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5F2B33FB1B77928F0024D2D4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B33FA1B77928F0024D2D4 /* main.m */; }; 11 | 5F2B33FE1B77928F0024D2D4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B33FD1B77928F0024D2D4 /* AppDelegate.m */; }; 12 | 5F2B34011B77928F0024D2D4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B34001B77928F0024D2D4 /* ViewController.m */; }; 13 | 5F2B34041B77928F0024D2D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5F2B34021B77928F0024D2D4 /* Main.storyboard */; }; 14 | 5F2B34061B77928F0024D2D4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5F2B34051B77928F0024D2D4 /* Images.xcassets */; }; 15 | 5F2B34091B77928F0024D2D4 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F2B34071B77928F0024D2D4 /* LaunchScreen.xib */; }; 16 | 5F2B34151B77928F0024D2D4 /* GooeySlideMenuDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B34141B77928F0024D2D4 /* GooeySlideMenuDemoTests.m */; }; 17 | 5F2B34201B7916AB0024D2D4 /* GooeySlideMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B341F1B7916AB0024D2D4 /* GooeySlideMenu.m */; }; 18 | 5F2B34241B7BD85C0024D2D4 /* SlideMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B34231B7BD85C0024D2D4 /* SlideMenuButton.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 5F2B340F1B77928F0024D2D4 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 5F2B33ED1B77928F0024D2D4 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 5F2B33F41B77928F0024D2D4; 27 | remoteInfo = GooeySlideMenuDemo; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 5F2B33F51B77928F0024D2D4 /* GooeySlideMenuDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GooeySlideMenuDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 5F2B33F91B77928F0024D2D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 5F2B33FA1B77928F0024D2D4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | 5F2B33FC1B77928F0024D2D4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | 5F2B33FD1B77928F0024D2D4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | 5F2B33FF1B77928F0024D2D4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 38 | 5F2B34001B77928F0024D2D4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 39 | 5F2B34031B77928F0024D2D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | 5F2B34051B77928F0024D2D4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | 5F2B34081B77928F0024D2D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 42 | 5F2B340E1B77928F0024D2D4 /* GooeySlideMenuDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GooeySlideMenuDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 5F2B34131B77928F0024D2D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 5F2B34141B77928F0024D2D4 /* GooeySlideMenuDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GooeySlideMenuDemoTests.m; sourceTree = ""; }; 45 | 5F2B341E1B7916AB0024D2D4 /* GooeySlideMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GooeySlideMenu.h; path = Classes/GooeySlideMenu.h; sourceTree = ""; }; 46 | 5F2B341F1B7916AB0024D2D4 /* GooeySlideMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GooeySlideMenu.m; path = Classes/GooeySlideMenu.m; sourceTree = ""; }; 47 | 5F2B34221B7BD85C0024D2D4 /* SlideMenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SlideMenuButton.h; path = Classes/SlideMenuButton.h; sourceTree = ""; }; 48 | 5F2B34231B7BD85C0024D2D4 /* SlideMenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SlideMenuButton.m; path = Classes/SlideMenuButton.m; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 5F2B33F21B77928F0024D2D4 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | 5F2B340B1B77928F0024D2D4 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 5F2B33EC1B77928F0024D2D4 = { 70 | isa = PBXGroup; 71 | children = ( 72 | 5F2B33F71B77928F0024D2D4 /* GooeySlideMenuDemo */, 73 | 5F2B34111B77928F0024D2D4 /* GooeySlideMenuDemoTests */, 74 | 5F2B33F61B77928F0024D2D4 /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 5F2B33F61B77928F0024D2D4 /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 5F2B33F51B77928F0024D2D4 /* GooeySlideMenuDemo.app */, 82 | 5F2B340E1B77928F0024D2D4 /* GooeySlideMenuDemoTests.xctest */, 83 | ); 84 | name = Products; 85 | sourceTree = ""; 86 | }; 87 | 5F2B33F71B77928F0024D2D4 /* GooeySlideMenuDemo */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 5F2B34211B7916AF0024D2D4 /* Classes */, 91 | 5F2B33FC1B77928F0024D2D4 /* AppDelegate.h */, 92 | 5F2B33FD1B77928F0024D2D4 /* AppDelegate.m */, 93 | 5F2B33FF1B77928F0024D2D4 /* ViewController.h */, 94 | 5F2B34001B77928F0024D2D4 /* ViewController.m */, 95 | 5F2B34021B77928F0024D2D4 /* Main.storyboard */, 96 | 5F2B34051B77928F0024D2D4 /* Images.xcassets */, 97 | 5F2B34071B77928F0024D2D4 /* LaunchScreen.xib */, 98 | 5F2B33F81B77928F0024D2D4 /* Supporting Files */, 99 | ); 100 | path = GooeySlideMenuDemo; 101 | sourceTree = ""; 102 | }; 103 | 5F2B33F81B77928F0024D2D4 /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 5F2B33F91B77928F0024D2D4 /* Info.plist */, 107 | 5F2B33FA1B77928F0024D2D4 /* main.m */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | 5F2B34111B77928F0024D2D4 /* GooeySlideMenuDemoTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 5F2B34141B77928F0024D2D4 /* GooeySlideMenuDemoTests.m */, 116 | 5F2B34121B77928F0024D2D4 /* Supporting Files */, 117 | ); 118 | path = GooeySlideMenuDemoTests; 119 | sourceTree = ""; 120 | }; 121 | 5F2B34121B77928F0024D2D4 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 5F2B34131B77928F0024D2D4 /* Info.plist */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 5F2B34211B7916AF0024D2D4 /* Classes */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 5F2B341E1B7916AB0024D2D4 /* GooeySlideMenu.h */, 133 | 5F2B341F1B7916AB0024D2D4 /* GooeySlideMenu.m */, 134 | 5F2B34221B7BD85C0024D2D4 /* SlideMenuButton.h */, 135 | 5F2B34231B7BD85C0024D2D4 /* SlideMenuButton.m */, 136 | ); 137 | name = Classes; 138 | sourceTree = ""; 139 | }; 140 | /* End PBXGroup section */ 141 | 142 | /* Begin PBXNativeTarget section */ 143 | 5F2B33F41B77928F0024D2D4 /* GooeySlideMenuDemo */ = { 144 | isa = PBXNativeTarget; 145 | buildConfigurationList = 5F2B34181B77928F0024D2D4 /* Build configuration list for PBXNativeTarget "GooeySlideMenuDemo" */; 146 | buildPhases = ( 147 | 5F2B33F11B77928F0024D2D4 /* Sources */, 148 | 5F2B33F21B77928F0024D2D4 /* Frameworks */, 149 | 5F2B33F31B77928F0024D2D4 /* Resources */, 150 | ); 151 | buildRules = ( 152 | ); 153 | dependencies = ( 154 | ); 155 | name = GooeySlideMenuDemo; 156 | productName = GooeySlideMenuDemo; 157 | productReference = 5F2B33F51B77928F0024D2D4 /* GooeySlideMenuDemo.app */; 158 | productType = "com.apple.product-type.application"; 159 | }; 160 | 5F2B340D1B77928F0024D2D4 /* GooeySlideMenuDemoTests */ = { 161 | isa = PBXNativeTarget; 162 | buildConfigurationList = 5F2B341B1B77928F0024D2D4 /* Build configuration list for PBXNativeTarget "GooeySlideMenuDemoTests" */; 163 | buildPhases = ( 164 | 5F2B340A1B77928F0024D2D4 /* Sources */, 165 | 5F2B340B1B77928F0024D2D4 /* Frameworks */, 166 | 5F2B340C1B77928F0024D2D4 /* Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | 5F2B34101B77928F0024D2D4 /* PBXTargetDependency */, 172 | ); 173 | name = GooeySlideMenuDemoTests; 174 | productName = GooeySlideMenuDemoTests; 175 | productReference = 5F2B340E1B77928F0024D2D4 /* GooeySlideMenuDemoTests.xctest */; 176 | productType = "com.apple.product-type.bundle.unit-test"; 177 | }; 178 | /* End PBXNativeTarget section */ 179 | 180 | /* Begin PBXProject section */ 181 | 5F2B33ED1B77928F0024D2D4 /* Project object */ = { 182 | isa = PBXProject; 183 | attributes = { 184 | LastUpgradeCheck = 0630; 185 | ORGANIZATIONNAME = "Kitten Yang"; 186 | TargetAttributes = { 187 | 5F2B33F41B77928F0024D2D4 = { 188 | CreatedOnToolsVersion = 6.3; 189 | }; 190 | 5F2B340D1B77928F0024D2D4 = { 191 | CreatedOnToolsVersion = 6.3; 192 | TestTargetID = 5F2B33F41B77928F0024D2D4; 193 | }; 194 | }; 195 | }; 196 | buildConfigurationList = 5F2B33F01B77928F0024D2D4 /* Build configuration list for PBXProject "GooeySlideMenuDemo" */; 197 | compatibilityVersion = "Xcode 3.2"; 198 | developmentRegion = English; 199 | hasScannedForEncodings = 0; 200 | knownRegions = ( 201 | en, 202 | Base, 203 | ); 204 | mainGroup = 5F2B33EC1B77928F0024D2D4; 205 | productRefGroup = 5F2B33F61B77928F0024D2D4 /* Products */; 206 | projectDirPath = ""; 207 | projectRoot = ""; 208 | targets = ( 209 | 5F2B33F41B77928F0024D2D4 /* GooeySlideMenuDemo */, 210 | 5F2B340D1B77928F0024D2D4 /* GooeySlideMenuDemoTests */, 211 | ); 212 | }; 213 | /* End PBXProject section */ 214 | 215 | /* Begin PBXResourcesBuildPhase section */ 216 | 5F2B33F31B77928F0024D2D4 /* Resources */ = { 217 | isa = PBXResourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | 5F2B34041B77928F0024D2D4 /* Main.storyboard in Resources */, 221 | 5F2B34091B77928F0024D2D4 /* LaunchScreen.xib in Resources */, 222 | 5F2B34061B77928F0024D2D4 /* Images.xcassets in Resources */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | 5F2B340C1B77928F0024D2D4 /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | /* End PBXResourcesBuildPhase section */ 234 | 235 | /* Begin PBXSourcesBuildPhase section */ 236 | 5F2B33F11B77928F0024D2D4 /* Sources */ = { 237 | isa = PBXSourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | 5F2B34241B7BD85C0024D2D4 /* SlideMenuButton.m in Sources */, 241 | 5F2B34201B7916AB0024D2D4 /* GooeySlideMenu.m in Sources */, 242 | 5F2B34011B77928F0024D2D4 /* ViewController.m in Sources */, 243 | 5F2B33FE1B77928F0024D2D4 /* AppDelegate.m in Sources */, 244 | 5F2B33FB1B77928F0024D2D4 /* main.m in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | 5F2B340A1B77928F0024D2D4 /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 5F2B34151B77928F0024D2D4 /* GooeySlideMenuDemoTests.m in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXSourcesBuildPhase section */ 257 | 258 | /* Begin PBXTargetDependency section */ 259 | 5F2B34101B77928F0024D2D4 /* PBXTargetDependency */ = { 260 | isa = PBXTargetDependency; 261 | target = 5F2B33F41B77928F0024D2D4 /* GooeySlideMenuDemo */; 262 | targetProxy = 5F2B340F1B77928F0024D2D4 /* PBXContainerItemProxy */; 263 | }; 264 | /* End PBXTargetDependency section */ 265 | 266 | /* Begin PBXVariantGroup section */ 267 | 5F2B34021B77928F0024D2D4 /* Main.storyboard */ = { 268 | isa = PBXVariantGroup; 269 | children = ( 270 | 5F2B34031B77928F0024D2D4 /* Base */, 271 | ); 272 | name = Main.storyboard; 273 | sourceTree = ""; 274 | }; 275 | 5F2B34071B77928F0024D2D4 /* LaunchScreen.xib */ = { 276 | isa = PBXVariantGroup; 277 | children = ( 278 | 5F2B34081B77928F0024D2D4 /* Base */, 279 | ); 280 | name = LaunchScreen.xib; 281 | sourceTree = ""; 282 | }; 283 | /* End PBXVariantGroup section */ 284 | 285 | /* Begin XCBuildConfiguration section */ 286 | 5F2B34161B77928F0024D2D4 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ALWAYS_SEARCH_USER_PATHS = NO; 290 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 291 | CLANG_CXX_LIBRARY = "libc++"; 292 | CLANG_ENABLE_MODULES = YES; 293 | CLANG_ENABLE_OBJC_ARC = YES; 294 | CLANG_WARN_BOOL_CONVERSION = YES; 295 | CLANG_WARN_CONSTANT_CONVERSION = YES; 296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 297 | CLANG_WARN_EMPTY_BODY = YES; 298 | CLANG_WARN_ENUM_CONVERSION = YES; 299 | CLANG_WARN_INT_CONVERSION = YES; 300 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 301 | CLANG_WARN_UNREACHABLE_CODE = YES; 302 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 303 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 304 | COPY_PHASE_STRIP = NO; 305 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 306 | ENABLE_STRICT_OBJC_MSGSEND = YES; 307 | GCC_C_LANGUAGE_STANDARD = gnu99; 308 | GCC_DYNAMIC_NO_PIC = NO; 309 | GCC_NO_COMMON_BLOCKS = YES; 310 | GCC_OPTIMIZATION_LEVEL = 0; 311 | GCC_PREPROCESSOR_DEFINITIONS = ( 312 | "DEBUG=1", 313 | "$(inherited)", 314 | ); 315 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 323 | MTL_ENABLE_DEBUG_INFO = YES; 324 | ONLY_ACTIVE_ARCH = YES; 325 | SDKROOT = iphoneos; 326 | TARGETED_DEVICE_FAMILY = "1,2"; 327 | }; 328 | name = Debug; 329 | }; 330 | 5F2B34171B77928F0024D2D4 /* Release */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | SDKROOT = iphoneos; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | 5F2B34191B77928F0024D2D4 /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | INFOPLIST_FILE = GooeySlideMenuDemo/Info.plist; 373 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 374 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 375 | PRODUCT_NAME = "$(TARGET_NAME)"; 376 | }; 377 | name = Debug; 378 | }; 379 | 5F2B341A1B77928F0024D2D4 /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 383 | INFOPLIST_FILE = GooeySlideMenuDemo/Info.plist; 384 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | }; 388 | name = Release; 389 | }; 390 | 5F2B341C1B77928F0024D2D4 /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | BUNDLE_LOADER = "$(TEST_HOST)"; 394 | FRAMEWORK_SEARCH_PATHS = ( 395 | "$(SDKROOT)/Developer/Library/Frameworks", 396 | "$(inherited)", 397 | ); 398 | GCC_PREPROCESSOR_DEFINITIONS = ( 399 | "DEBUG=1", 400 | "$(inherited)", 401 | ); 402 | INFOPLIST_FILE = GooeySlideMenuDemoTests/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GooeySlideMenuDemo.app/GooeySlideMenuDemo"; 406 | }; 407 | name = Debug; 408 | }; 409 | 5F2B341D1B77928F0024D2D4 /* Release */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | BUNDLE_LOADER = "$(TEST_HOST)"; 413 | FRAMEWORK_SEARCH_PATHS = ( 414 | "$(SDKROOT)/Developer/Library/Frameworks", 415 | "$(inherited)", 416 | ); 417 | INFOPLIST_FILE = GooeySlideMenuDemoTests/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GooeySlideMenuDemo.app/GooeySlideMenuDemo"; 421 | }; 422 | name = Release; 423 | }; 424 | /* End XCBuildConfiguration section */ 425 | 426 | /* Begin XCConfigurationList section */ 427 | 5F2B33F01B77928F0024D2D4 /* Build configuration list for PBXProject "GooeySlideMenuDemo" */ = { 428 | isa = XCConfigurationList; 429 | buildConfigurations = ( 430 | 5F2B34161B77928F0024D2D4 /* Debug */, 431 | 5F2B34171B77928F0024D2D4 /* Release */, 432 | ); 433 | defaultConfigurationIsVisible = 0; 434 | defaultConfigurationName = Release; 435 | }; 436 | 5F2B34181B77928F0024D2D4 /* Build configuration list for PBXNativeTarget "GooeySlideMenuDemo" */ = { 437 | isa = XCConfigurationList; 438 | buildConfigurations = ( 439 | 5F2B34191B77928F0024D2D4 /* Debug */, 440 | 5F2B341A1B77928F0024D2D4 /* Release */, 441 | ); 442 | defaultConfigurationIsVisible = 0; 443 | defaultConfigurationName = Release; 444 | }; 445 | 5F2B341B1B77928F0024D2D4 /* Build configuration list for PBXNativeTarget "GooeySlideMenuDemoTests" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 5F2B341C1B77928F0024D2D4 /* Debug */, 449 | 5F2B341D1B77928F0024D2D4 /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | /* End XCConfigurationList section */ 455 | }; 456 | rootObject = 5F2B33ED1B77928F0024D2D4 /* Project object */; 457 | } 458 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. 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 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/Classes/GooeySlideMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // GooeySlideMenu.h 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/11. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^MenuButtonClickedBlock)(NSInteger index,NSString *title,NSInteger titleCounts); 12 | 13 | @interface GooeySlideMenu : UIView 14 | 15 | /** 16 | * Convenient init method 17 | * 18 | * @param titles Your menu options 19 | * 20 | * @return object 21 | */ 22 | 23 | -(id)initWithTitles:(NSArray *)titles; 24 | 25 | 26 | /** 27 | * Custom init method 28 | * 29 | * @param titles Your menu options 30 | * 31 | * @return object 32 | */ 33 | -(id)initWithTitles:(NSArray *)titles withButtonHeight:(CGFloat)height withMenuColor:(UIColor *)menuColor withBackBlurStyle:(UIBlurEffectStyle)style; 34 | 35 | 36 | /** 37 | * Method to trigger the animation 38 | */ 39 | -(void)trigger; 40 | 41 | 42 | 43 | 44 | /** 45 | * The height of the menu height 46 | */ 47 | @property(nonatomic,assign)CGFloat menuButtonHeight; 48 | 49 | 50 | /** 51 | * The block of menu buttons cliced 52 | */ 53 | @property(nonatomic,copy)MenuButtonClickedBlock menuClickBlock; 54 | 55 | 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/Classes/GooeySlideMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // GooeySlideMenu.m 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/11. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "GooeySlideMenu.h" 10 | #import "SlideMenuButton.h" 11 | 12 | 13 | #define SPACE 30 14 | #define EXTRAAREA 50 15 | #define BUTTONHEIGHT 40 16 | 17 | @interface GooeySlideMenu() 18 | 19 | @property (nonatomic,strong) CADisplayLink *displayLink; 20 | @property NSInteger animationCount; // 动画的数量 21 | 22 | @end 23 | 24 | @implementation GooeySlideMenu{ 25 | 26 | UIView *helperCenterView; 27 | UIView *helperSideView; 28 | UIVisualEffectView *blurView; 29 | UIWindow *keyWindow; 30 | BOOL triggered; 31 | CGFloat diff; 32 | UIColor *_menuColor; 33 | } 34 | 35 | 36 | -(id)initWithTitles:(NSArray *)titles{ 37 | 38 | return [self initWithTitles:titles withButtonHeight:40.0f withMenuColor:[UIColor colorWithRed:0 green:0.722 blue:1 alpha:1] withBackBlurStyle:UIBlurEffectStyleDark]; 39 | } 40 | 41 | 42 | -(id)initWithTitles:(NSArray *)titles withButtonHeight:(CGFloat)height withMenuColor:(UIColor *)menuColor withBackBlurStyle:(UIBlurEffectStyle)style{ 43 | 44 | self = [super init]; 45 | if (self) { 46 | 47 | keyWindow = [[UIApplication sharedApplication]keyWindow]; 48 | 49 | blurView = [[UIVisualEffectView alloc]initWithEffect:[UIBlurEffect effectWithStyle:style]]; 50 | blurView.frame = keyWindow.frame; 51 | blurView.alpha = 0.0f; 52 | 53 | helperSideView = [[UIView alloc]initWithFrame:CGRectMake(-40, 0, 40, 40)]; 54 | helperSideView.backgroundColor = [UIColor redColor]; 55 | helperSideView.hidden = YES; 56 | [keyWindow addSubview:helperSideView]; 57 | 58 | helperCenterView = [[UIView alloc]initWithFrame:CGRectMake(-40, CGRectGetHeight(keyWindow.frame)/2 - 20, 40, 40)]; 59 | helperCenterView.backgroundColor = [UIColor yellowColor]; 60 | helperCenterView.hidden = YES; 61 | [keyWindow addSubview:helperCenterView]; 62 | 63 | 64 | self.frame = CGRectMake(- keyWindow.frame.size.width/2 - EXTRAAREA, 0, keyWindow.frame.size.width/2+EXTRAAREA, keyWindow.frame.size.height); 65 | self.backgroundColor = [UIColor clearColor]; 66 | [keyWindow insertSubview:self belowSubview:helperSideView]; 67 | 68 | _menuColor = menuColor; 69 | self.menuButtonHeight = height; 70 | [self addButtons:titles]; 71 | 72 | } 73 | 74 | return self; 75 | } 76 | 77 | 78 | 79 | -(void)addButtons:(NSArray *)titles{ 80 | 81 | 82 | 83 | if (titles.count % 2 == 0) { 84 | 85 | NSInteger index_down = titles.count/2; 86 | NSInteger index_up = -1; 87 | for (NSInteger i = 0; i < titles.count; i++) { 88 | 89 | 90 | NSString *title = titles[i]; 91 | SlideMenuButton *home_button = [[SlideMenuButton alloc]initWithTitle:title]; 92 | if (i >= titles.count / 2) { 93 | 94 | index_up ++; 95 | home_button.center = CGPointMake(keyWindow.frame.size.width/4, keyWindow.frame.size.height/2 + self.menuButtonHeight*index_up + SPACE*index_up + SPACE/2 + self.menuButtonHeight/2); 96 | }else{ 97 | 98 | index_down --; 99 | home_button.center = CGPointMake(keyWindow.frame.size.width/4, keyWindow.frame.size.height/2 - self.menuButtonHeight*index_down - SPACE*index_down - SPACE/2 - self.menuButtonHeight/2); 100 | } 101 | 102 | home_button.bounds = CGRectMake(0, 0, keyWindow.frame.size.width/2 - 20*2, self.menuButtonHeight); 103 | home_button.buttonColor = _menuColor; 104 | [self addSubview:home_button]; 105 | 106 | __weak typeof(self) WeakSelf = self; 107 | 108 | home_button.buttonClickBlock = ^(){ 109 | 110 | [WeakSelf tapToUntrigger:nil]; 111 | WeakSelf.menuClickBlock(i,title,titles.count); 112 | }; 113 | 114 | } 115 | 116 | 117 | 118 | 119 | 120 | }else{ 121 | 122 | NSInteger index = (titles.count - 1) /2 +1; 123 | for (NSInteger i = 0; i < titles.count; i++) { 124 | 125 | index --; 126 | NSString *title = titles[i]; 127 | SlideMenuButton *home_button = [[SlideMenuButton alloc]initWithTitle:title]; 128 | home_button.center = CGPointMake(keyWindow.frame.size.width/4, keyWindow.frame.size.height/2 - self.menuButtonHeight*index - 20*index); 129 | home_button.bounds = CGRectMake(0, 0, keyWindow.frame.size.width/2 - 20*2, self.menuButtonHeight); 130 | home_button.buttonColor = _menuColor; 131 | [self addSubview:home_button]; 132 | 133 | __weak typeof(self) WeakSelf = self; 134 | home_button.buttonClickBlock = ^(){ 135 | 136 | [WeakSelf tapToUntrigger:nil]; 137 | WeakSelf.menuClickBlock(i,title,titles.count); 138 | }; 139 | 140 | } 141 | } 142 | 143 | 144 | 145 | 146 | } 147 | 148 | // Only override drawRect: if you perform custom drawing. 149 | // An empty implementation adversely affects performance during animation. 150 | - (void)drawRect:(CGRect)rect { 151 | 152 | UIBezierPath *path = [UIBezierPath bezierPath]; 153 | [path moveToPoint:CGPointMake(0, 0)]; 154 | [path addLineToPoint:CGPointMake(self.frame.size.width-EXTRAAREA, 0)]; 155 | 156 | [path addQuadCurveToPoint:CGPointMake(self.frame.size.width-EXTRAAREA, self.frame.size.height) controlPoint:CGPointMake(keyWindow.frame.size.width/2+diff, keyWindow.frame.size.height/2)]; 157 | 158 | [path addLineToPoint:CGPointMake(0, self.frame.size.height)]; 159 | [path closePath]; 160 | 161 | CGContextRef context = UIGraphicsGetCurrentContext(); 162 | CGContextAddPath(context, path.CGPath); 163 | [_menuColor set]; 164 | CGContextFillPath(context); 165 | 166 | } 167 | 168 | 169 | 170 | -(void)trigger{ 171 | 172 | 173 | if (!triggered) { 174 | 175 | [keyWindow insertSubview:blurView belowSubview:self]; 176 | 177 | 178 | [UIView animateWithDuration:0.3 animations:^{ 179 | 180 | self.frame = self.bounds; 181 | 182 | }]; 183 | 184 | [self beforeAnimation]; 185 | [UIView animateWithDuration:0.7 delay:0.0f usingSpringWithDamping:0.5f initialSpringVelocity:0.9f options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction animations:^{ 186 | 187 | helperSideView.center = CGPointMake(keyWindow.center.x, helperSideView.frame.size.height/2); 188 | 189 | } completion:^(BOOL finished) { 190 | [self finishAnimation]; 191 | }]; 192 | 193 | [UIView animateWithDuration:0.3 animations:^{ 194 | blurView.alpha = 1.0f; 195 | 196 | }]; 197 | 198 | 199 | [self beforeAnimation]; 200 | [UIView animateWithDuration:0.7 delay:0.0f usingSpringWithDamping:0.8f initialSpringVelocity:2.0f options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction animations:^{ 201 | 202 | helperCenterView.center = keyWindow.center; 203 | 204 | } completion:^(BOOL finished) { 205 | if (finished) { 206 | UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapToUntrigger:)]; 207 | [blurView addGestureRecognizer:tapGes]; 208 | 209 | [self finishAnimation]; 210 | } 211 | }]; 212 | 213 | 214 | [self animateButtons]; 215 | 216 | triggered = YES; 217 | 218 | }else{ 219 | 220 | [self tapToUntrigger:nil]; 221 | } 222 | 223 | } 224 | 225 | 226 | -(void)animateButtons{ 227 | 228 | 229 | for (NSInteger i = 0; i < self.subviews.count; i++) { 230 | 231 | UIView *menuButton = self.subviews[i]; 232 | menuButton.transform = CGAffineTransformMakeTranslation(-90, 0); 233 | 234 | [UIView animateWithDuration:0.7 delay:i*(0.3/self.subviews.count) usingSpringWithDamping:0.6f initialSpringVelocity:0.0f options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction animations:^{ 235 | 236 | menuButton.transform = CGAffineTransformIdentity; 237 | 238 | } completion:NULL]; 239 | 240 | } 241 | 242 | 243 | } 244 | 245 | 246 | -(void)tapToUntrigger:(UIButton *)sender{ 247 | 248 | [UIView animateWithDuration:0.3 animations:^{ 249 | 250 | self.frame = CGRectMake(-keyWindow.frame.size.width/2-EXTRAAREA, 0, keyWindow.frame.size.width/2+EXTRAAREA, keyWindow.frame.size.height); 251 | }]; 252 | 253 | 254 | [self beforeAnimation]; 255 | [UIView animateWithDuration:0.7 delay:0.0f usingSpringWithDamping:0.6f initialSpringVelocity:0.9f options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction animations:^{ 256 | 257 | helperSideView.center = CGPointMake(-helperSideView.frame.size.height/2, helperSideView.frame.size.height/2); 258 | 259 | } completion:^(BOOL finished) { 260 | [self finishAnimation]; 261 | }]; 262 | 263 | [UIView animateWithDuration:0.3 animations:^{ 264 | 265 | blurView.alpha = 0.0f; 266 | 267 | }]; 268 | 269 | [self beforeAnimation]; 270 | [UIView animateWithDuration:0.7 delay:0.0f usingSpringWithDamping:0.7f initialSpringVelocity:2.0f options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction animations:^{ 271 | 272 | helperCenterView.center = CGPointMake(-helperSideView.frame.size.height/2, CGRectGetHeight(keyWindow.frame)/2); 273 | 274 | } completion:^(BOOL finished) { 275 | [self finishAnimation]; 276 | }]; 277 | 278 | triggered = NO; 279 | 280 | } 281 | 282 | 283 | 284 | //动画之前调用 285 | -(void)beforeAnimation{ 286 | if (self.displayLink == nil) { 287 | self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkAction:)]; 288 | [self.displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; 289 | } 290 | self.animationCount ++; 291 | } 292 | 293 | //动画完成之后调用 294 | -(void)finishAnimation{ 295 | self.animationCount --; 296 | if (self.animationCount == 0) { 297 | [self.displayLink invalidate]; 298 | self.displayLink = nil; 299 | } 300 | } 301 | 302 | 303 | 304 | -(void)displayLinkAction:(CADisplayLink *)dis{ 305 | 306 | CALayer *sideHelperPresentationLayer = (CALayer *)[helperSideView.layer presentationLayer]; 307 | CALayer *centerHelperPresentationLayer = (CALayer *)[helperCenterView.layer presentationLayer]; 308 | 309 | CGRect centerRect = [[centerHelperPresentationLayer valueForKeyPath:@"frame"]CGRectValue]; 310 | CGRect sideRect = [[sideHelperPresentationLayer valueForKeyPath:@"frame"]CGRectValue]; 311 | 312 | 313 | diff = sideRect.origin.x - centerRect.origin.x; 314 | // NSLog(@"diff:%f",diff); 315 | 316 | [self setNeedsDisplay]; 317 | 318 | } 319 | 320 | 321 | @end 322 | 323 | 324 | 325 | 326 | 327 | 328 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/Classes/SlideMenuButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // SlideMenuButton.h 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/13. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SlideMenuButton : UIView 12 | 13 | 14 | /** 15 | * onvenient init method 16 | * 17 | * @param title title 18 | * 19 | * @return object 20 | */ 21 | -(id)initWithTitle:(NSString *)title; 22 | 23 | 24 | /** 25 | * The button color 26 | */ 27 | @property(nonatomic,strong)UIColor *buttonColor; 28 | 29 | 30 | 31 | /** 32 | * button clicked block 33 | */ 34 | @property(nonatomic,copy)void(^buttonClickBlock)(void); 35 | 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/Classes/SlideMenuButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // SlideMenuButton.m 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/13. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "SlideMenuButton.h" 10 | 11 | @interface SlideMenuButton() 12 | 13 | @property(nonatomic,strong)NSString *buttonTitle; 14 | 15 | @end 16 | 17 | @implementation SlideMenuButton 18 | 19 | 20 | -(id)initWithTitle:(NSString *)title{ 21 | 22 | self = [super init]; 23 | if (self) { 24 | 25 | self.buttonTitle = title; 26 | 27 | } 28 | return self; 29 | 30 | } 31 | 32 | // Only override drawRect: if you perform custom drawing. 33 | // An empty implementation adversely affects performance during animation. 34 | - (void)drawRect:(CGRect)rect { 35 | 36 | CGContextRef context = UIGraphicsGetCurrentContext(); 37 | CGContextAddRect(context, rect); 38 | [self.buttonColor set]; 39 | CGContextFillPath(context); 40 | 41 | 42 | UIBezierPath* roundedRectanglePath = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(rect, 1, 1) cornerRadius: rect.size.height/2]; 43 | [self.buttonColor setFill]; 44 | [roundedRectanglePath fill]; 45 | [[UIColor whiteColor] setStroke]; 46 | roundedRectanglePath.lineWidth = 1; 47 | [roundedRectanglePath stroke]; 48 | 49 | NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; 50 | paragraphStyle.alignment = NSTextAlignmentCenter; 51 | 52 | 53 | 54 | NSDictionary *attr = @{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:24.0f],NSForegroundColorAttributeName:[UIColor whiteColor]}; 55 | CGSize size = [self.buttonTitle sizeWithAttributes:attr]; 56 | 57 | CGRect r = CGRectMake(rect.origin.x, 58 | rect.origin.y + (rect.size.height - size.height)/2.0, 59 | rect.size.width, 60 | size.height); 61 | 62 | [self.buttonTitle drawInRect:r withAttributes:attr]; 63 | 64 | } 65 | 66 | 67 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 68 | UITouch *touch = [touches anyObject]; 69 | NSUInteger tapCount = touch.tapCount; 70 | 71 | 72 | switch (tapCount) { 73 | case 1: 74 | self.buttonClickBlock(); 75 | break; 76 | 77 | default: 78 | break; 79 | } 80 | 81 | } 82 | 83 | 84 | 85 | 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "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 | } -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "GooeySlideMenu.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController{ 17 | GooeySlideMenu *menu; 18 | } 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.title = @"首页"; 23 | // Do any additional setup after loading the view, typically from a nib. 24 | 25 | menu = [[GooeySlideMenu alloc]initWithTitles:@[@"首页",@"消息",@"发布",@"发现",@"个人",@"设置"]]; 26 | menu.menuClickBlock = ^(NSInteger index,NSString *title,NSInteger titleCounts){ 27 | 28 | NSLog(@"index:%ld title:%@ titleCounts:%ld",index,title,titleCounts); 29 | }; 30 | } 31 | 32 | - (void)didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | - (IBAction)buttonTrigger:(id)sender { 37 | [menu trigger]; 38 | } 39 | 40 | 41 | 42 | #pragma mark -- UITabel View Datasource 43 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 44 | 45 | return 20; 46 | } 47 | 48 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 49 | 50 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"demoCell"]; 51 | cell.textLabel.text = [NSString stringWithFormat:@"NO.%ld",(long)indexPath.row]; 52 | 53 | return cell; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GooeySlideMenuDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. 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 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemoTests/GooeySlideMenuDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GooeySlideMenuDemoTests.m 3 | // GooeySlideMenuDemoTests 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface GooeySlideMenuDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation GooeySlideMenuDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /GooeySlideMenuDemo/GooeySlideMenuDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Qitao Yang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /NavbarTitleWithFadeAnimation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/NavbarTitleWithFadeAnimation.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Animations 2 | 3 | A few of test animations. 4 | 5 | 一些动画的飞机稿。 6 | 7 | # 1. AnimatedCurveDemo 8 | 9 | 10 | ![](curverAnim_2.gif) 11 | 12 | ###Usage: 13 | 14 | ```objc 15 | 16 | -(void)viewWillAppear:(BOOL)animated{ 17 | [super viewWillAppear:animated]; 18 | 19 | //下拉刷新 Pull down to refresh 20 | KYPullToCurveVeiw *headerView = [[KYPullToCurveVeiw alloc]initWithAssociatedScrollView:self.tableView withNavigationBar:YES]; 21 | __weak KYPullToCurveVeiw *weakHeaderView = headerView; 22 | [headerView triggerPulling]; 23 | [headerView addRefreshingBlock:^{ 24 | 25 | //Your detail action... 26 | //... 27 | double delayInSeconds = 2.0; 28 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); 29 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 30 | 31 | [weakHeaderView stopRefreshing]; 32 | 33 | }); 34 | 35 | }]; 36 | 37 | 38 | // Pull up to refresh 39 | KYPullToCurveVeiw_footer *footerView = [[KYPullToCurveVeiw_footer alloc]initWithAssociatedScrollView:self.tableView withNavigationBar:YES]; 40 | __weak KYPullToCurveVeiw_footer *weakFooterView= footerView; 41 | [footerView addRefreshingBlock:^{ 42 | //Your detail action... 43 | //... 44 | double delayInSeconds = 2.0; 45 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); 46 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 47 | 48 | [weakFooterView stopRefreshing]; 49 | 50 | }); 51 | 52 | }]; 53 | 54 | 55 | } 56 | 57 | 58 | 59 | ``` 60 | 61 | --- 62 | 63 | 64 | 65 | # 2. AnimatedCircleDemo 66 | 67 | ![](circleAnim.gif) 68 | 69 | A transformable layer with progress control. 70 | 71 | --- 72 | 73 | 74 | 75 | # 3. NavbarTitleWithFadeAnimation 76 | 77 | Just set two values: `initialOffset` which is the distance of title between navbar & `targetHeight` which means the scroll distance to target cell. 78 | 79 | And then,the code will automaticly compute the translation value and alpha value. 80 | 81 | ![](NavbarTitleWithFadeAnimation.gif) 82 | 83 | --- 84 | 85 | 86 | 87 | 88 | # 4.Zoom-out splash view 89 | 90 | ![](splash animatino.gif) 91 | 92 | --- 93 | 94 | Just look at the simple code. 95 | 96 | 97 | 98 | # 5.GooeySlideMenu 99 | ![](GooeySlideMenu.gif) 100 | 101 | *Easily to use* 102 | 103 | ```objc 104 | menu = [[GooeySlideMenu alloc]initWithTitles:@[@"首页",@"消息",@"发布",@"发现",@"个人",@"设置"]]; 105 | menu.menuClickBlock = ^(NSInteger index,NSString *title,NSInteger titleCounts){ 106 | 107 | NSLog(@"index:%ld title:%@ titleCounts:%ld",index,title,titleCounts); 108 | }; 109 | 110 | [menu trigger]; 111 | ``` 112 | Then the buttons will automatically layout depend on your buttons counts.It's really smart. 113 | 114 | --- 115 | 116 | 117 | -------------------------------------------------------------------------------- /Scanner Gooey Effect.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/Scanner Gooey Effect.gif -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5F2B33C91B7777370024D2D4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B33C81B7777370024D2D4 /* main.m */; }; 11 | 5F2B33CC1B7777370024D2D4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B33CB1B7777370024D2D4 /* AppDelegate.m */; }; 12 | 5F2B33CF1B7777370024D2D4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B33CE1B7777370024D2D4 /* ViewController.m */; }; 13 | 5F2B33D21B7777370024D2D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5F2B33D01B7777370024D2D4 /* Main.storyboard */; }; 14 | 5F2B33D41B7777370024D2D4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5F2B33D31B7777370024D2D4 /* Images.xcassets */; }; 15 | 5F2B33D71B7777370024D2D4 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F2B33D51B7777370024D2D4 /* LaunchScreen.xib */; }; 16 | 5F2B33E31B7777380024D2D4 /* SplashAnimiationDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F2B33E21B7777380024D2D4 /* SplashAnimiationDemoTests.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 5F2B33DD1B7777380024D2D4 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 5F2B33BB1B7777360024D2D4 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 5F2B33C21B7777360024D2D4; 25 | remoteInfo = SplashAnimiationDemo; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 5F2B33C31B7777360024D2D4 /* SplashAnimiationDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SplashAnimiationDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 5F2B33C71B7777370024D2D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 5F2B33C81B7777370024D2D4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 33 | 5F2B33CA1B7777370024D2D4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 34 | 5F2B33CB1B7777370024D2D4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 35 | 5F2B33CD1B7777370024D2D4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 36 | 5F2B33CE1B7777370024D2D4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 37 | 5F2B33D11B7777370024D2D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 38 | 5F2B33D31B7777370024D2D4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 39 | 5F2B33D61B7777370024D2D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 40 | 5F2B33DC1B7777380024D2D4 /* SplashAnimiationDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SplashAnimiationDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 5F2B33E11B7777380024D2D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 5F2B33E21B7777380024D2D4 /* SplashAnimiationDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SplashAnimiationDemoTests.m; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 5F2B33C01B7777360024D2D4 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | 5F2B33D91B7777380024D2D4 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | 5F2B33BA1B7777360024D2D4 = { 64 | isa = PBXGroup; 65 | children = ( 66 | 5F2B33C51B7777360024D2D4 /* SplashAnimiationDemo */, 67 | 5F2B33DF1B7777380024D2D4 /* SplashAnimiationDemoTests */, 68 | 5F2B33C41B7777360024D2D4 /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | 5F2B33C41B7777360024D2D4 /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 5F2B33C31B7777360024D2D4 /* SplashAnimiationDemo.app */, 76 | 5F2B33DC1B7777380024D2D4 /* SplashAnimiationDemoTests.xctest */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | 5F2B33C51B7777360024D2D4 /* SplashAnimiationDemo */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 5F2B33CA1B7777370024D2D4 /* AppDelegate.h */, 85 | 5F2B33CB1B7777370024D2D4 /* AppDelegate.m */, 86 | 5F2B33CD1B7777370024D2D4 /* ViewController.h */, 87 | 5F2B33CE1B7777370024D2D4 /* ViewController.m */, 88 | 5F2B33D01B7777370024D2D4 /* Main.storyboard */, 89 | 5F2B33D31B7777370024D2D4 /* Images.xcassets */, 90 | 5F2B33D51B7777370024D2D4 /* LaunchScreen.xib */, 91 | 5F2B33C61B7777360024D2D4 /* Supporting Files */, 92 | ); 93 | path = SplashAnimiationDemo; 94 | sourceTree = ""; 95 | }; 96 | 5F2B33C61B7777360024D2D4 /* Supporting Files */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 5F2B33C71B7777370024D2D4 /* Info.plist */, 100 | 5F2B33C81B7777370024D2D4 /* main.m */, 101 | ); 102 | name = "Supporting Files"; 103 | sourceTree = ""; 104 | }; 105 | 5F2B33DF1B7777380024D2D4 /* SplashAnimiationDemoTests */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 5F2B33E21B7777380024D2D4 /* SplashAnimiationDemoTests.m */, 109 | 5F2B33E01B7777380024D2D4 /* Supporting Files */, 110 | ); 111 | path = SplashAnimiationDemoTests; 112 | sourceTree = ""; 113 | }; 114 | 5F2B33E01B7777380024D2D4 /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 5F2B33E11B7777380024D2D4 /* Info.plist */, 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 5F2B33C21B7777360024D2D4 /* SplashAnimiationDemo */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 5F2B33E61B7777380024D2D4 /* Build configuration list for PBXNativeTarget "SplashAnimiationDemo" */; 128 | buildPhases = ( 129 | 5F2B33BF1B7777360024D2D4 /* Sources */, 130 | 5F2B33C01B7777360024D2D4 /* Frameworks */, 131 | 5F2B33C11B7777360024D2D4 /* Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | ); 137 | name = SplashAnimiationDemo; 138 | productName = SplashAnimiationDemo; 139 | productReference = 5F2B33C31B7777360024D2D4 /* SplashAnimiationDemo.app */; 140 | productType = "com.apple.product-type.application"; 141 | }; 142 | 5F2B33DB1B7777380024D2D4 /* SplashAnimiationDemoTests */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 5F2B33E91B7777380024D2D4 /* Build configuration list for PBXNativeTarget "SplashAnimiationDemoTests" */; 145 | buildPhases = ( 146 | 5F2B33D81B7777380024D2D4 /* Sources */, 147 | 5F2B33D91B7777380024D2D4 /* Frameworks */, 148 | 5F2B33DA1B7777380024D2D4 /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | 5F2B33DE1B7777380024D2D4 /* PBXTargetDependency */, 154 | ); 155 | name = SplashAnimiationDemoTests; 156 | productName = SplashAnimiationDemoTests; 157 | productReference = 5F2B33DC1B7777380024D2D4 /* SplashAnimiationDemoTests.xctest */; 158 | productType = "com.apple.product-type.bundle.unit-test"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | 5F2B33BB1B7777360024D2D4 /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 0630; 167 | ORGANIZATIONNAME = "Kitten Yang"; 168 | TargetAttributes = { 169 | 5F2B33C21B7777360024D2D4 = { 170 | CreatedOnToolsVersion = 6.3; 171 | }; 172 | 5F2B33DB1B7777380024D2D4 = { 173 | CreatedOnToolsVersion = 6.3; 174 | TestTargetID = 5F2B33C21B7777360024D2D4; 175 | }; 176 | }; 177 | }; 178 | buildConfigurationList = 5F2B33BE1B7777360024D2D4 /* Build configuration list for PBXProject "SplashAnimiationDemo" */; 179 | compatibilityVersion = "Xcode 3.2"; 180 | developmentRegion = English; 181 | hasScannedForEncodings = 0; 182 | knownRegions = ( 183 | en, 184 | Base, 185 | ); 186 | mainGroup = 5F2B33BA1B7777360024D2D4; 187 | productRefGroup = 5F2B33C41B7777360024D2D4 /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | 5F2B33C21B7777360024D2D4 /* SplashAnimiationDemo */, 192 | 5F2B33DB1B7777380024D2D4 /* SplashAnimiationDemoTests */, 193 | ); 194 | }; 195 | /* End PBXProject section */ 196 | 197 | /* Begin PBXResourcesBuildPhase section */ 198 | 5F2B33C11B7777360024D2D4 /* Resources */ = { 199 | isa = PBXResourcesBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | 5F2B33D21B7777370024D2D4 /* Main.storyboard in Resources */, 203 | 5F2B33D71B7777370024D2D4 /* LaunchScreen.xib in Resources */, 204 | 5F2B33D41B7777370024D2D4 /* Images.xcassets in Resources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | 5F2B33DA1B7777380024D2D4 /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXResourcesBuildPhase section */ 216 | 217 | /* Begin PBXSourcesBuildPhase section */ 218 | 5F2B33BF1B7777360024D2D4 /* Sources */ = { 219 | isa = PBXSourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 5F2B33CF1B7777370024D2D4 /* ViewController.m in Sources */, 223 | 5F2B33CC1B7777370024D2D4 /* AppDelegate.m in Sources */, 224 | 5F2B33C91B7777370024D2D4 /* main.m in Sources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | 5F2B33D81B7777380024D2D4 /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 5F2B33E31B7777380024D2D4 /* SplashAnimiationDemoTests.m in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXSourcesBuildPhase section */ 237 | 238 | /* Begin PBXTargetDependency section */ 239 | 5F2B33DE1B7777380024D2D4 /* PBXTargetDependency */ = { 240 | isa = PBXTargetDependency; 241 | target = 5F2B33C21B7777360024D2D4 /* SplashAnimiationDemo */; 242 | targetProxy = 5F2B33DD1B7777380024D2D4 /* PBXContainerItemProxy */; 243 | }; 244 | /* End PBXTargetDependency section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | 5F2B33D01B7777370024D2D4 /* Main.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 5F2B33D11B7777370024D2D4 /* Base */, 251 | ); 252 | name = Main.storyboard; 253 | sourceTree = ""; 254 | }; 255 | 5F2B33D51B7777370024D2D4 /* LaunchScreen.xib */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 5F2B33D61B7777370024D2D4 /* Base */, 259 | ); 260 | name = LaunchScreen.xib; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | 5F2B33E41B7777380024D2D4 /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ALWAYS_SEARCH_USER_PATHS = NO; 270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 271 | CLANG_CXX_LIBRARY = "libc++"; 272 | CLANG_ENABLE_MODULES = YES; 273 | CLANG_ENABLE_OBJC_ARC = YES; 274 | CLANG_WARN_BOOL_CONVERSION = YES; 275 | CLANG_WARN_CONSTANT_CONVERSION = YES; 276 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_STRICT_OBJC_MSGSEND = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_DYNAMIC_NO_PIC = NO; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_OPTIMIZATION_LEVEL = 0; 291 | GCC_PREPROCESSOR_DEFINITIONS = ( 292 | "DEBUG=1", 293 | "$(inherited)", 294 | ); 295 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 298 | GCC_WARN_UNDECLARED_SELECTOR = YES; 299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 300 | GCC_WARN_UNUSED_FUNCTION = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 303 | MTL_ENABLE_DEBUG_INFO = YES; 304 | ONLY_ACTIVE_ARCH = YES; 305 | SDKROOT = iphoneos; 306 | TARGETED_DEVICE_FAMILY = "1,2"; 307 | }; 308 | name = Debug; 309 | }; 310 | 5F2B33E51B7777380024D2D4 /* Release */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 328 | COPY_PHASE_STRIP = NO; 329 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 330 | ENABLE_NS_ASSERTIONS = NO; 331 | ENABLE_STRICT_OBJC_MSGSEND = YES; 332 | GCC_C_LANGUAGE_STANDARD = gnu99; 333 | GCC_NO_COMMON_BLOCKS = YES; 334 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 335 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 336 | GCC_WARN_UNDECLARED_SELECTOR = YES; 337 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 338 | GCC_WARN_UNUSED_FUNCTION = YES; 339 | GCC_WARN_UNUSED_VARIABLE = YES; 340 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 341 | MTL_ENABLE_DEBUG_INFO = NO; 342 | SDKROOT = iphoneos; 343 | TARGETED_DEVICE_FAMILY = "1,2"; 344 | VALIDATE_PRODUCT = YES; 345 | }; 346 | name = Release; 347 | }; 348 | 5F2B33E71B7777380024D2D4 /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 352 | INFOPLIST_FILE = SplashAnimiationDemo/Info.plist; 353 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 354 | PRODUCT_NAME = "$(TARGET_NAME)"; 355 | }; 356 | name = Debug; 357 | }; 358 | 5F2B33E81B7777380024D2D4 /* Release */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 362 | INFOPLIST_FILE = SplashAnimiationDemo/Info.plist; 363 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | }; 366 | name = Release; 367 | }; 368 | 5F2B33EA1B7777380024D2D4 /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | BUNDLE_LOADER = "$(TEST_HOST)"; 372 | FRAMEWORK_SEARCH_PATHS = ( 373 | "$(SDKROOT)/Developer/Library/Frameworks", 374 | "$(inherited)", 375 | ); 376 | GCC_PREPROCESSOR_DEFINITIONS = ( 377 | "DEBUG=1", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = SplashAnimiationDemoTests/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SplashAnimiationDemo.app/SplashAnimiationDemo"; 384 | }; 385 | name = Debug; 386 | }; 387 | 5F2B33EB1B7777380024D2D4 /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | BUNDLE_LOADER = "$(TEST_HOST)"; 391 | FRAMEWORK_SEARCH_PATHS = ( 392 | "$(SDKROOT)/Developer/Library/Frameworks", 393 | "$(inherited)", 394 | ); 395 | INFOPLIST_FILE = SplashAnimiationDemoTests/Info.plist; 396 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SplashAnimiationDemo.app/SplashAnimiationDemo"; 399 | }; 400 | name = Release; 401 | }; 402 | /* End XCBuildConfiguration section */ 403 | 404 | /* Begin XCConfigurationList section */ 405 | 5F2B33BE1B7777360024D2D4 /* Build configuration list for PBXProject "SplashAnimiationDemo" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | 5F2B33E41B7777380024D2D4 /* Debug */, 409 | 5F2B33E51B7777380024D2D4 /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | 5F2B33E61B7777380024D2D4 /* Build configuration list for PBXNativeTarget "SplashAnimiationDemo" */ = { 415 | isa = XCConfigurationList; 416 | buildConfigurations = ( 417 | 5F2B33E71B7777380024D2D4 /* Debug */, 418 | 5F2B33E81B7777380024D2D4 /* Release */, 419 | ); 420 | defaultConfigurationIsVisible = 0; 421 | }; 422 | 5F2B33E91B7777380024D2D4 /* Build configuration list for PBXNativeTarget "SplashAnimiationDemoTests" */ = { 423 | isa = XCConfigurationList; 424 | buildConfigurations = ( 425 | 5F2B33EA1B7777380024D2D4 /* Debug */, 426 | 5F2B33EB1B7777380024D2D4 /* Release */, 427 | ); 428 | defaultConfigurationIsVisible = 0; 429 | }; 430 | /* End XCConfigurationList section */ 431 | }; 432 | rootObject = 5F2B33BB1B7777360024D2D4 /* Project object */; 433 | } 434 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SplashAnimiationDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. 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 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SplashAnimiationDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | 21 | 22 | [self.window makeKeyAndVisible]; 23 | self.window.backgroundColor = [UIColor colorWithRed:128.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:1.0]; 24 | 25 | UINavigationController *navc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateInitialViewController]; 26 | self.window.rootViewController = navc; 27 | 28 | 29 | //logo mask 30 | CALayer *maskLayer = [CALayer layer]; 31 | maskLayer.contents = (id)[UIImage imageNamed:@"logo"].CGImage; 32 | maskLayer.position = navc.view.center; 33 | maskLayer.bounds = CGRectMake(0, 0, 60, 60); 34 | navc.view.layer.mask = maskLayer; 35 | 36 | //logo mask background view 37 | UIView *maskBackgroundView = [[UIView alloc]initWithFrame:navc.view.bounds]; 38 | maskBackgroundView.backgroundColor = [UIColor whiteColor]; 39 | [navc.view addSubview:maskBackgroundView]; 40 | [navc.view bringSubviewToFront:maskBackgroundView]; 41 | 42 | 43 | //logo mask animation 44 | CAKeyframeAnimation *logoMaskAnimaiton = [CAKeyframeAnimation animationWithKeyPath:@"bounds"]; 45 | logoMaskAnimaiton.duration = 1.0f; 46 | logoMaskAnimaiton.beginTime = CACurrentMediaTime() + 1.0f;//延迟一秒 47 | 48 | CGRect initalBounds = maskLayer.bounds; 49 | CGRect secondBounds = CGRectMake(0, 0, 50, 50); 50 | CGRect finalBounds = CGRectMake(0, 0, 2000, 2000); 51 | logoMaskAnimaiton.values = @[[NSValue valueWithCGRect:initalBounds],[NSValue valueWithCGRect:secondBounds],[NSValue valueWithCGRect:finalBounds]]; 52 | logoMaskAnimaiton.keyTimes = @[@(0),@(0.5),@(1)]; 53 | logoMaskAnimaiton.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut],[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut],[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; 54 | logoMaskAnimaiton.removedOnCompletion = NO; 55 | logoMaskAnimaiton.fillMode = kCAFillModeForwards; 56 | [navc.view.layer.mask addAnimation:logoMaskAnimaiton forKey:@"logoMaskAnimaiton"]; 57 | 58 | 59 | //maskBackgroundView fade animation 60 | [UIView animateWithDuration:0.1 delay:1.35 options:UIViewAnimationOptionCurveEaseIn animations:^{ 61 | 62 | maskBackgroundView.alpha = 0.0; 63 | 64 | } completion:^(BOOL finished) { 65 | 66 | [maskBackgroundView removeFromSuperview]; 67 | 68 | }]; 69 | 70 | 71 | //navc.view bounce animation 72 | [UIView animateWithDuration:0.25 delay:1.3 options:UIViewAnimationOptionTransitionNone animations:^{ 73 | 74 | navc.view.transform = CGAffineTransformMakeScale(1.05, 1.05); 75 | 76 | } completion:^(BOOL finished) { 77 | 78 | [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 79 | 80 | navc.view.transform = CGAffineTransformIdentity; 81 | 82 | } completion:^(BOOL finished) { 83 | 84 | navc.view.layer.mask = nil; 85 | 86 | }]; 87 | }]; 88 | 89 | return YES; 90 | } 91 | 92 | 93 | - (void)applicationWillResignActive:(UIApplication *)application { 94 | // 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. 95 | // 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. 96 | } 97 | 98 | - (void)applicationDidEnterBackground:(UIApplication *)application { 99 | // 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. 100 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 101 | } 102 | 103 | - (void)applicationWillEnterForeground:(UIApplication *)application { 104 | // 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. 105 | } 106 | 107 | - (void)applicationDidBecomeActive:(UIApplication *)application { 108 | // 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. 109 | } 110 | 111 | - (void)applicationWillTerminate:(UIApplication *)application { 112 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "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 | } -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/Images.xcassets/home_demo.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/SplashAnimiationDemo/SplashAnimiationDemo/Images.xcassets/home_demo.imageset/1.png -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/Images.xcassets/home_demo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "1.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/Images.xcassets/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "logo.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/Images.xcassets/logo.imageset/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/SplashAnimiationDemo/SplashAnimiationDemo/Images.xcassets/logo.imageset/logo.png -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SplashAnimiationDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SplashAnimiationDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.title = @"首页"; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SplashAnimiationDemo 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. 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 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SplashAnimiationDemo/SplashAnimiationDemoTests/SplashAnimiationDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SplashAnimiationDemoTests.m 3 | // SplashAnimiationDemoTests 4 | // 5 | // Created by Kitten Yang on 15/8/9. 6 | // Copyright (c) 2015年 Kitten Yang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface SplashAnimiationDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation SplashAnimiationDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /circleAnim.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/circleAnim.gif -------------------------------------------------------------------------------- /curverAnim_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/curverAnim_2.gif -------------------------------------------------------------------------------- /splash animatino.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/Animations/0f7136741f28076c7b55ea8f22e96df10bd76da7/splash animatino.gif --------------------------------------------------------------------------------