├── CAShapeLayer&UIBezierPath ├── CAShapeLayer&UIBezierPath.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ ├── Chairman.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── laiyoung_.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── Chairman.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── CAShapeLayer&UIBezierPath.xcscheme │ │ └── xcschememanagement.plist └── CAShapeLayer&UIBezierPath │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── README.md /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 873263341CF3067400B5069D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 873263331CF3067400B5069D /* main.m */; }; 11 | 873263371CF3067400B5069D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 873263361CF3067400B5069D /* AppDelegate.m */; }; 12 | 8732633A1CF3067500B5069D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 873263391CF3067400B5069D /* ViewController.m */; }; 13 | 8732633D1CF3067500B5069D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8732633B1CF3067500B5069D /* Main.storyboard */; }; 14 | 8732633F1CF3067500B5069D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8732633E1CF3067500B5069D /* Assets.xcassets */; }; 15 | 873263421CF3067500B5069D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873263401CF3067500B5069D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 8732632F1CF3067400B5069D /* CAShapeLayer&UIBezierPath.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CAShapeLayer&UIBezierPath.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 873263331CF3067400B5069D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 21 | 873263351CF3067400B5069D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 22 | 873263361CF3067400B5069D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 23 | 873263381CF3067400B5069D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 24 | 873263391CF3067400B5069D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 25 | 8732633C1CF3067500B5069D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 8732633E1CF3067500B5069D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 873263411CF3067500B5069D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 873263431CF3067500B5069D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 8732632C1CF3067400B5069D /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 873263261CF3067400B5069D = { 43 | isa = PBXGroup; 44 | children = ( 45 | 873263311CF3067400B5069D /* CAShapeLayer&UIBezierPath */, 46 | 873263301CF3067400B5069D /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 873263301CF3067400B5069D /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 8732632F1CF3067400B5069D /* CAShapeLayer&UIBezierPath.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 873263311CF3067400B5069D /* CAShapeLayer&UIBezierPath */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 873263351CF3067400B5069D /* AppDelegate.h */, 62 | 873263361CF3067400B5069D /* AppDelegate.m */, 63 | 873263381CF3067400B5069D /* ViewController.h */, 64 | 873263391CF3067400B5069D /* ViewController.m */, 65 | 8732633B1CF3067500B5069D /* Main.storyboard */, 66 | 8732633E1CF3067500B5069D /* Assets.xcassets */, 67 | 873263401CF3067500B5069D /* LaunchScreen.storyboard */, 68 | 873263431CF3067500B5069D /* Info.plist */, 69 | 873263321CF3067400B5069D /* Supporting Files */, 70 | ); 71 | path = "CAShapeLayer&UIBezierPath"; 72 | sourceTree = ""; 73 | }; 74 | 873263321CF3067400B5069D /* Supporting Files */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 873263331CF3067400B5069D /* main.m */, 78 | ); 79 | name = "Supporting Files"; 80 | sourceTree = ""; 81 | }; 82 | /* End PBXGroup section */ 83 | 84 | /* Begin PBXNativeTarget section */ 85 | 8732632E1CF3067400B5069D /* CAShapeLayer&UIBezierPath */ = { 86 | isa = PBXNativeTarget; 87 | buildConfigurationList = 873263461CF3067500B5069D /* Build configuration list for PBXNativeTarget "CAShapeLayer&UIBezierPath" */; 88 | buildPhases = ( 89 | 8732632B1CF3067400B5069D /* Sources */, 90 | 8732632C1CF3067400B5069D /* Frameworks */, 91 | 8732632D1CF3067400B5069D /* Resources */, 92 | ); 93 | buildRules = ( 94 | ); 95 | dependencies = ( 96 | ); 97 | name = "CAShapeLayer&UIBezierPath"; 98 | productName = "CAShapeLayer&UIBezierPath"; 99 | productReference = 8732632F1CF3067400B5069D /* CAShapeLayer&UIBezierPath.app */; 100 | productType = "com.apple.product-type.application"; 101 | }; 102 | /* End PBXNativeTarget section */ 103 | 104 | /* Begin PBXProject section */ 105 | 873263271CF3067400B5069D /* Project object */ = { 106 | isa = PBXProject; 107 | attributes = { 108 | LastUpgradeCheck = 0730; 109 | ORGANIZATIONNAME = LaiYoung; 110 | TargetAttributes = { 111 | 8732632E1CF3067400B5069D = { 112 | CreatedOnToolsVersion = 7.3.1; 113 | }; 114 | }; 115 | }; 116 | buildConfigurationList = 8732632A1CF3067400B5069D /* Build configuration list for PBXProject "CAShapeLayer&UIBezierPath" */; 117 | compatibilityVersion = "Xcode 3.2"; 118 | developmentRegion = English; 119 | hasScannedForEncodings = 0; 120 | knownRegions = ( 121 | en, 122 | Base, 123 | ); 124 | mainGroup = 873263261CF3067400B5069D; 125 | productRefGroup = 873263301CF3067400B5069D /* Products */; 126 | projectDirPath = ""; 127 | projectRoot = ""; 128 | targets = ( 129 | 8732632E1CF3067400B5069D /* CAShapeLayer&UIBezierPath */, 130 | ); 131 | }; 132 | /* End PBXProject section */ 133 | 134 | /* Begin PBXResourcesBuildPhase section */ 135 | 8732632D1CF3067400B5069D /* Resources */ = { 136 | isa = PBXResourcesBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | 873263421CF3067500B5069D /* LaunchScreen.storyboard in Resources */, 140 | 8732633F1CF3067500B5069D /* Assets.xcassets in Resources */, 141 | 8732633D1CF3067500B5069D /* Main.storyboard in Resources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXResourcesBuildPhase section */ 146 | 147 | /* Begin PBXSourcesBuildPhase section */ 148 | 8732632B1CF3067400B5069D /* Sources */ = { 149 | isa = PBXSourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | 8732633A1CF3067500B5069D /* ViewController.m in Sources */, 153 | 873263371CF3067400B5069D /* AppDelegate.m in Sources */, 154 | 873263341CF3067400B5069D /* main.m in Sources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXSourcesBuildPhase section */ 159 | 160 | /* Begin PBXVariantGroup section */ 161 | 8732633B1CF3067500B5069D /* Main.storyboard */ = { 162 | isa = PBXVariantGroup; 163 | children = ( 164 | 8732633C1CF3067500B5069D /* Base */, 165 | ); 166 | name = Main.storyboard; 167 | sourceTree = ""; 168 | }; 169 | 873263401CF3067500B5069D /* LaunchScreen.storyboard */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | 873263411CF3067500B5069D /* Base */, 173 | ); 174 | name = LaunchScreen.storyboard; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXVariantGroup section */ 178 | 179 | /* Begin XCBuildConfiguration section */ 180 | 873263441CF3067500B5069D /* Debug */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_ANALYZER_NONNULL = YES; 185 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 186 | CLANG_CXX_LIBRARY = "libc++"; 187 | CLANG_ENABLE_MODULES = YES; 188 | CLANG_ENABLE_OBJC_ARC = YES; 189 | CLANG_WARN_BOOL_CONVERSION = YES; 190 | CLANG_WARN_CONSTANT_CONVERSION = YES; 191 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 192 | CLANG_WARN_EMPTY_BODY = YES; 193 | CLANG_WARN_ENUM_CONVERSION = YES; 194 | CLANG_WARN_INT_CONVERSION = YES; 195 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 196 | CLANG_WARN_UNREACHABLE_CODE = YES; 197 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 198 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 199 | COPY_PHASE_STRIP = NO; 200 | DEBUG_INFORMATION_FORMAT = dwarf; 201 | ENABLE_STRICT_OBJC_MSGSEND = YES; 202 | ENABLE_TESTABILITY = YES; 203 | GCC_C_LANGUAGE_STANDARD = gnu99; 204 | GCC_DYNAMIC_NO_PIC = NO; 205 | GCC_NO_COMMON_BLOCKS = YES; 206 | GCC_OPTIMIZATION_LEVEL = 0; 207 | GCC_PREPROCESSOR_DEFINITIONS = ( 208 | "DEBUG=1", 209 | "$(inherited)", 210 | ); 211 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 212 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 213 | GCC_WARN_UNDECLARED_SELECTOR = YES; 214 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 215 | GCC_WARN_UNUSED_FUNCTION = YES; 216 | GCC_WARN_UNUSED_VARIABLE = YES; 217 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 218 | MTL_ENABLE_DEBUG_INFO = YES; 219 | ONLY_ACTIVE_ARCH = YES; 220 | SDKROOT = iphoneos; 221 | }; 222 | name = Debug; 223 | }; 224 | 873263451CF3067500B5069D /* Release */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | ALWAYS_SEARCH_USER_PATHS = NO; 228 | CLANG_ANALYZER_NONNULL = YES; 229 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 230 | CLANG_CXX_LIBRARY = "libc++"; 231 | CLANG_ENABLE_MODULES = YES; 232 | CLANG_ENABLE_OBJC_ARC = YES; 233 | CLANG_WARN_BOOL_CONVERSION = YES; 234 | CLANG_WARN_CONSTANT_CONVERSION = YES; 235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 236 | CLANG_WARN_EMPTY_BODY = YES; 237 | CLANG_WARN_ENUM_CONVERSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 240 | CLANG_WARN_UNREACHABLE_CODE = YES; 241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 243 | COPY_PHASE_STRIP = NO; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | ENABLE_NS_ASSERTIONS = NO; 246 | ENABLE_STRICT_OBJC_MSGSEND = YES; 247 | GCC_C_LANGUAGE_STANDARD = gnu99; 248 | GCC_NO_COMMON_BLOCKS = YES; 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 256 | MTL_ENABLE_DEBUG_INFO = NO; 257 | SDKROOT = iphoneos; 258 | VALIDATE_PRODUCT = YES; 259 | }; 260 | name = Release; 261 | }; 262 | 873263471CF3067500B5069D /* Debug */ = { 263 | isa = XCBuildConfiguration; 264 | buildSettings = { 265 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 266 | INFOPLIST_FILE = "CAShapeLayer&UIBezierPath/Info.plist"; 267 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 268 | PRODUCT_BUNDLE_IDENTIFIER = "com.LaiYoung.CAShapeLayer-UIBezierPath"; 269 | PRODUCT_NAME = "$(TARGET_NAME)"; 270 | }; 271 | name = Debug; 272 | }; 273 | 873263481CF3067500B5069D /* Release */ = { 274 | isa = XCBuildConfiguration; 275 | buildSettings = { 276 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 277 | INFOPLIST_FILE = "CAShapeLayer&UIBezierPath/Info.plist"; 278 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 279 | PRODUCT_BUNDLE_IDENTIFIER = "com.LaiYoung.CAShapeLayer-UIBezierPath"; 280 | PRODUCT_NAME = "$(TARGET_NAME)"; 281 | }; 282 | name = Release; 283 | }; 284 | /* End XCBuildConfiguration section */ 285 | 286 | /* Begin XCConfigurationList section */ 287 | 8732632A1CF3067400B5069D /* Build configuration list for PBXProject "CAShapeLayer&UIBezierPath" */ = { 288 | isa = XCConfigurationList; 289 | buildConfigurations = ( 290 | 873263441CF3067500B5069D /* Debug */, 291 | 873263451CF3067500B5069D /* Release */, 292 | ); 293 | defaultConfigurationIsVisible = 0; 294 | defaultConfigurationName = Release; 295 | }; 296 | 873263461CF3067500B5069D /* Build configuration list for PBXNativeTarget "CAShapeLayer&UIBezierPath" */ = { 297 | isa = XCConfigurationList; 298 | buildConfigurations = ( 299 | 873263471CF3067500B5069D /* Debug */, 300 | 873263481CF3067500B5069D /* Release */, 301 | ); 302 | defaultConfigurationIsVisible = 0; 303 | }; 304 | /* End XCConfigurationList section */ 305 | }; 306 | rootObject = 873263271CF3067400B5069D /* Project object */; 307 | } 308 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/project.xcworkspace/xcuserdata/Chairman.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLLaiYoung/BezierPath/444aa7e1943f906d85a21c2dc2d7d0511dc8e57c/CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/project.xcworkspace/xcuserdata/Chairman.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/project.xcworkspace/xcuserdata/laiyoung_.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLLaiYoung/BezierPath/444aa7e1943f906d85a21c2dc2d7d0511dc8e57c/CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/project.xcworkspace/xcuserdata/laiyoung_.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/xcuserdata/Chairman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/xcuserdata/Chairman.xcuserdatad/xcschemes/CAShapeLayer&UIBezierPath.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath.xcodeproj/xcuserdata/Chairman.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CAShapeLayer&UIBezierPath.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8732632E1CF3067400B5069D 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CAShapeLayer&UIBezierPath 4 | // 5 | // Created by chairman on 16/5/23. 6 | // Copyright © 2016年 LaiYoung. 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 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CAShapeLayer&UIBezierPath 4 | // 5 | // Created by chairman on 16/5/23. 6 | // Copyright © 2016年 LaiYoung. 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 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/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 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CAShapeLayer&UIBezierPath 4 | // 5 | // Created by chairman on 16/5/23. 6 | // Copyright © 2016年 LaiYoung. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CAShapeLayer&UIBezierPath 4 | // 5 | // Created by chairman on 16/5/23. 6 | // Copyright © 2016年 LaiYoung. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #define kDefaultFrame CGRectMake(100, 100, 100, 100) 11 | /** 9==100-82/2 */ 12 | #define kRoundFrame CGRectMake(100+9, 100+9, 82, 82) 13 | #define SCREEN_SIZE [[UIScreen mainScreen] bounds].size 14 | @interface ViewController () 15 | @property (nonatomic, strong) CAShapeLayer *layer; 16 | @property (nonatomic, assign, getter=isCompleteAnimation) BOOL completeAnimation; 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // [self drawSolidRectangular]; 24 | // [self drawHollowRectangular]; 25 | // [self drawRoundedCornerRadiusShape]; 26 | // [self drawFanshaped]; 27 | // [self drawRound]; 28 | // [self drawbyRoundingCornersWithTopRight]; 29 | // [self drawOval]; 30 | // [self drawCurve]; 31 | // [self drawCurve2]; 32 | // [self drawCurveWithAnimation]; 33 | // [self drawCurveWithAnimation2]; 34 | // [self drawCurveWithAnimation3]; 35 | // [self drawRoundWithAnimation]; 36 | // [self draw]; 37 | // [self drawPie]; 38 | // [self drawHollowRectangularWithAnimation]; 39 | [self drawPieWithAnimation]; 40 | } 41 | /** 动画->饼图 点击屏幕 */ 42 | /** 43 | * 这种动画是利用一个layer覆盖在已经画好的饼图上面,然后对覆盖的layer'strokeEnd'做动画 44 | * 在自定义UIView里面使用self.bouns 45 | * 画图时候需要center这个center是这个UIView的中心点,而不是它在父容器的center 46 | */ 47 | 48 | - (void)drawPieWithAnimation { 49 | //* 最外层layer */ 50 | UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:kDefaultFrame cornerRadius:kDefaultFrame.size.height/2]; 51 | CAShapeLayer *layer = [CAShapeLayer layer]; 52 | layer.path = path.CGPath; 53 | layer.fillColor = [UIColor whiteColor].CGColor; 54 | layer.strokeColor = [UIColor clearColor].CGColor; 55 | [self.view.layer addSublayer:layer]; 56 | 57 | NSArray *sections = @[@20,@10,@40,@60,@70]; 58 | NSArray *sectionColors = @[[UIColor lightGrayColor],[UIColor yellowColor],[UIColor cyanColor],[UIColor orangeColor],[UIColor purpleColor]]; 59 | float total = 0.0,starAngle=M_PI/2,endAngle; 60 | for (NSInteger i=0; i *)touches withEvent:(UIEvent *)event { 424 | CABasicAnimation *baseAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 425 | baseAnimation.duration = 1.0f; 426 | if (self.isCompleteAnimation) { 427 | self.completeAnimation = NO; 428 | baseAnimation.fromValue = @1.0; 429 | baseAnimation.toValue = @0.0; 430 | } else { 431 | self.completeAnimation = YES; 432 | baseAnimation.fromValue = @0.0; 433 | baseAnimation.toValue = @1.0; 434 | } 435 | /** 保持动画执行的状态 */ 436 | baseAnimation.removedOnCompletion = NO;//执行完成后动画对象不要移除 437 | baseAnimation.fillMode = kCAFillModeForwards;//保持当前状态 438 | [self.layer addAnimation:baseAnimation forKey:nil]; 439 | } 440 | - (void)didReceiveMemoryWarning { 441 | [super didReceiveMemoryWarning]; 442 | // Dispose of any resources that can be recreated. 443 | } 444 | 445 | @end 446 | -------------------------------------------------------------------------------- /CAShapeLayer&UIBezierPath/CAShapeLayer&UIBezierPath/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CAShapeLayer&UIBezierPath 4 | // 5 | // Created by chairman on 16/5/23. 6 | // Copyright © 2016年 LaiYoung. 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Effect 2 | 3 | 4 | ![实心矩形](http://upload-images.jianshu.io/upload_images/959078-a091161a5720447b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 5 | 6 | ![空心矩形.png](http://upload-images.jianshu.io/upload_images/959078-4a60ed7646f2996d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 7 | 8 | ![圆角矩形.png](http://upload-images.jianshu.io/upload_images/959078-afce88b40c68fb2b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 9 | 10 | 11 | ![扇形.png](http://upload-images.jianshu.io/upload_images/959078-9fcda9a9c9201578.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 12 | 13 | ![圆.png](http://upload-images.jianshu.io/upload_images/959078-db416eff6c38a227.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 14 | 15 | ![圆角(右上).png](http://upload-images.jianshu.io/upload_images/959078-001a3540f3466315.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 16 | 17 | ![椭圆.png](http://upload-images.jianshu.io/upload_images/959078-a3915b983880c066.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 18 | 19 | ![曲线.png](http://upload-images.jianshu.io/upload_images/959078-812801f8132e3145.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 20 | 21 | ![曲线2.png](http://upload-images.jianshu.io/upload_images/959078-d1285b29269250fa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 22 | 23 | ![饼图.png](http://upload-images.jianshu.io/upload_images/959078-192a0313ef55b40d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/155) 24 | 25 | ![动画曲线.gif](http://upload-images.jianshu.io/upload_images/959078-1e098d51c605b460.gif?imageMogr2/auto-orient/strip) 26 | 27 | ![动画曲线2.gif](http://upload-images.jianshu.io/upload_images/959078-98918463b734de00.gif?imageMogr2/auto-orient/strip) 28 | 29 | ![动画曲线3.gif](http://upload-images.jianshu.io/upload_images/959078-5941114f51fcaad0.gif?imageMogr2/auto-orient/strip) 30 | 31 | ![动画画圆.gif](http://upload-images.jianshu.io/upload_images/959078-cb58b55b527fcd89.gif?imageMogr2/auto-orient/strip) 32 | 33 | ![动画画矩形.gif](http://upload-images.jianshu.io/upload_images/959078-1592559b44cabfc2.gif?imageMogr2/auto-orient/strip) 34 | 35 | ![动画画饼图.gif](http://upload-images.jianshu.io/upload_images/959078-4d1bc3219a591bdb.gif?imageMogr2/auto-orient/strip) 36 | --------------------------------------------------------------------------------