├── .gitignore ├── CATRadarView.gif ├── CATRadarView.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── CATRadarView ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── CATRadarViewTests ├── CATRadarViewTests.m └── Info.plist ├── CATRadarViewUITests ├── CATRadarViewUITests.m └── Info.plist ├── Classes ├── CATRadarView.h └── CATRadarView.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /CATRadarView.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CatchZeng/CATRadarView/0affd78f4039cfc2cebf9e306a4791f34a08a6dd/CATRadarView.gif -------------------------------------------------------------------------------- /CATRadarView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5DBC06441D35321D00022EF4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBC06431D35321D00022EF4 /* main.m */; }; 11 | 5DBC06471D35321D00022EF4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBC06461D35321D00022EF4 /* AppDelegate.m */; }; 12 | 5DBC064A1D35321D00022EF4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBC06491D35321D00022EF4 /* ViewController.m */; }; 13 | 5DBC064D1D35321D00022EF4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5DBC064B1D35321D00022EF4 /* Main.storyboard */; }; 14 | 5DBC064F1D35321D00022EF4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5DBC064E1D35321D00022EF4 /* Assets.xcassets */; }; 15 | 5DBC06521D35321D00022EF4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5DBC06501D35321D00022EF4 /* LaunchScreen.storyboard */; }; 16 | 5DBC065D1D35321D00022EF4 /* CATRadarViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBC065C1D35321D00022EF4 /* CATRadarViewTests.m */; }; 17 | 5DBC06681D35321D00022EF4 /* CATRadarViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBC06671D35321D00022EF4 /* CATRadarViewUITests.m */; }; 18 | 5DBC067B1D35328E00022EF4 /* CATRadarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBC067A1D35328E00022EF4 /* CATRadarView.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 5DBC06591D35321D00022EF4 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 5DBC06371D35321D00022EF4 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 5DBC063E1D35321D00022EF4; 27 | remoteInfo = CATRadarView; 28 | }; 29 | 5DBC06641D35321D00022EF4 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 5DBC06371D35321D00022EF4 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 5DBC063E1D35321D00022EF4; 34 | remoteInfo = CATRadarView; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 5DBC063F1D35321D00022EF4 /* CATRadarView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CATRadarView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 5DBC06431D35321D00022EF4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 5DBC06451D35321D00022EF4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 5DBC06461D35321D00022EF4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 5DBC06481D35321D00022EF4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | 5DBC06491D35321D00022EF4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | 5DBC064C1D35321D00022EF4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 5DBC064E1D35321D00022EF4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 5DBC06511D35321D00022EF4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 5DBC06531D35321D00022EF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 5DBC06581D35321D00022EF4 /* CATRadarViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CATRadarViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 5DBC065C1D35321D00022EF4 /* CATRadarViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CATRadarViewTests.m; sourceTree = ""; }; 51 | 5DBC065E1D35321D00022EF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 5DBC06631D35321D00022EF4 /* CATRadarViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CATRadarViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 5DBC06671D35321D00022EF4 /* CATRadarViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CATRadarViewUITests.m; sourceTree = ""; }; 54 | 5DBC06691D35321D00022EF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 5DBC06791D35328E00022EF4 /* CATRadarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CATRadarView.h; sourceTree = ""; }; 56 | 5DBC067A1D35328E00022EF4 /* CATRadarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CATRadarView.m; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 5DBC063C1D35321D00022EF4 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | 5DBC06551D35321D00022EF4 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | 5DBC06601D35321D00022EF4 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 5DBC06361D35321D00022EF4 = { 85 | isa = PBXGroup; 86 | children = ( 87 | 5DBC06411D35321D00022EF4 /* CATRadarView */, 88 | 5DBC065B1D35321D00022EF4 /* CATRadarViewTests */, 89 | 5DBC06661D35321D00022EF4 /* CATRadarViewUITests */, 90 | 5DBC06401D35321D00022EF4 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 5DBC06401D35321D00022EF4 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 5DBC063F1D35321D00022EF4 /* CATRadarView.app */, 98 | 5DBC06581D35321D00022EF4 /* CATRadarViewTests.xctest */, 99 | 5DBC06631D35321D00022EF4 /* CATRadarViewUITests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 5DBC06411D35321D00022EF4 /* CATRadarView */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 5DBC06751D35323000022EF4 /* Classes */, 108 | 5DBC06451D35321D00022EF4 /* AppDelegate.h */, 109 | 5DBC06461D35321D00022EF4 /* AppDelegate.m */, 110 | 5DBC06481D35321D00022EF4 /* ViewController.h */, 111 | 5DBC06491D35321D00022EF4 /* ViewController.m */, 112 | 5DBC064B1D35321D00022EF4 /* Main.storyboard */, 113 | 5DBC064E1D35321D00022EF4 /* Assets.xcassets */, 114 | 5DBC06501D35321D00022EF4 /* LaunchScreen.storyboard */, 115 | 5DBC06531D35321D00022EF4 /* Info.plist */, 116 | 5DBC06421D35321D00022EF4 /* Supporting Files */, 117 | ); 118 | path = CATRadarView; 119 | sourceTree = ""; 120 | }; 121 | 5DBC06421D35321D00022EF4 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 5DBC06431D35321D00022EF4 /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 5DBC065B1D35321D00022EF4 /* CATRadarViewTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 5DBC065C1D35321D00022EF4 /* CATRadarViewTests.m */, 133 | 5DBC065E1D35321D00022EF4 /* Info.plist */, 134 | ); 135 | path = CATRadarViewTests; 136 | sourceTree = ""; 137 | }; 138 | 5DBC06661D35321D00022EF4 /* CATRadarViewUITests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 5DBC06671D35321D00022EF4 /* CATRadarViewUITests.m */, 142 | 5DBC06691D35321D00022EF4 /* Info.plist */, 143 | ); 144 | path = CATRadarViewUITests; 145 | sourceTree = ""; 146 | }; 147 | 5DBC06751D35323000022EF4 /* Classes */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 5DBC06791D35328E00022EF4 /* CATRadarView.h */, 151 | 5DBC067A1D35328E00022EF4 /* CATRadarView.m */, 152 | ); 153 | path = Classes; 154 | sourceTree = SOURCE_ROOT; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | 5DBC063E1D35321D00022EF4 /* CATRadarView */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 5DBC066C1D35321D00022EF4 /* Build configuration list for PBXNativeTarget "CATRadarView" */; 162 | buildPhases = ( 163 | 5DBC063B1D35321D00022EF4 /* Sources */, 164 | 5DBC063C1D35321D00022EF4 /* Frameworks */, 165 | 5DBC063D1D35321D00022EF4 /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = CATRadarView; 172 | productName = CATRadarView; 173 | productReference = 5DBC063F1D35321D00022EF4 /* CATRadarView.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | 5DBC06571D35321D00022EF4 /* CATRadarViewTests */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 5DBC066F1D35321D00022EF4 /* Build configuration list for PBXNativeTarget "CATRadarViewTests" */; 179 | buildPhases = ( 180 | 5DBC06541D35321D00022EF4 /* Sources */, 181 | 5DBC06551D35321D00022EF4 /* Frameworks */, 182 | 5DBC06561D35321D00022EF4 /* Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | 5DBC065A1D35321D00022EF4 /* PBXTargetDependency */, 188 | ); 189 | name = CATRadarViewTests; 190 | productName = CATRadarViewTests; 191 | productReference = 5DBC06581D35321D00022EF4 /* CATRadarViewTests.xctest */; 192 | productType = "com.apple.product-type.bundle.unit-test"; 193 | }; 194 | 5DBC06621D35321D00022EF4 /* CATRadarViewUITests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = 5DBC06721D35321D00022EF4 /* Build configuration list for PBXNativeTarget "CATRadarViewUITests" */; 197 | buildPhases = ( 198 | 5DBC065F1D35321D00022EF4 /* Sources */, 199 | 5DBC06601D35321D00022EF4 /* Frameworks */, 200 | 5DBC06611D35321D00022EF4 /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | 5DBC06651D35321D00022EF4 /* PBXTargetDependency */, 206 | ); 207 | name = CATRadarViewUITests; 208 | productName = CATRadarViewUITests; 209 | productReference = 5DBC06631D35321D00022EF4 /* CATRadarViewUITests.xctest */; 210 | productType = "com.apple.product-type.bundle.ui-testing"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | 5DBC06371D35321D00022EF4 /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 0730; 219 | ORGANIZATIONNAME = catch; 220 | TargetAttributes = { 221 | 5DBC063E1D35321D00022EF4 = { 222 | CreatedOnToolsVersion = 7.3; 223 | DevelopmentTeam = YC9L8JKS7R; 224 | }; 225 | 5DBC06571D35321D00022EF4 = { 226 | CreatedOnToolsVersion = 7.3; 227 | DevelopmentTeam = YC9L8JKS7R; 228 | TestTargetID = 5DBC063E1D35321D00022EF4; 229 | }; 230 | 5DBC06621D35321D00022EF4 = { 231 | CreatedOnToolsVersion = 7.3; 232 | DevelopmentTeam = YC9L8JKS7R; 233 | TestTargetID = 5DBC063E1D35321D00022EF4; 234 | }; 235 | }; 236 | }; 237 | buildConfigurationList = 5DBC063A1D35321D00022EF4 /* Build configuration list for PBXProject "CATRadarView" */; 238 | compatibilityVersion = "Xcode 3.2"; 239 | developmentRegion = English; 240 | hasScannedForEncodings = 0; 241 | knownRegions = ( 242 | en, 243 | Base, 244 | ); 245 | mainGroup = 5DBC06361D35321D00022EF4; 246 | productRefGroup = 5DBC06401D35321D00022EF4 /* Products */; 247 | projectDirPath = ""; 248 | projectRoot = ""; 249 | targets = ( 250 | 5DBC063E1D35321D00022EF4 /* CATRadarView */, 251 | 5DBC06571D35321D00022EF4 /* CATRadarViewTests */, 252 | 5DBC06621D35321D00022EF4 /* CATRadarViewUITests */, 253 | ); 254 | }; 255 | /* End PBXProject section */ 256 | 257 | /* Begin PBXResourcesBuildPhase section */ 258 | 5DBC063D1D35321D00022EF4 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 5DBC06521D35321D00022EF4 /* LaunchScreen.storyboard in Resources */, 263 | 5DBC064F1D35321D00022EF4 /* Assets.xcassets in Resources */, 264 | 5DBC064D1D35321D00022EF4 /* Main.storyboard in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | 5DBC06561D35321D00022EF4 /* Resources */ = { 269 | isa = PBXResourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | 5DBC06611D35321D00022EF4 /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXResourcesBuildPhase section */ 283 | 284 | /* Begin PBXSourcesBuildPhase section */ 285 | 5DBC063B1D35321D00022EF4 /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 5DBC067B1D35328E00022EF4 /* CATRadarView.m in Sources */, 290 | 5DBC064A1D35321D00022EF4 /* ViewController.m in Sources */, 291 | 5DBC06471D35321D00022EF4 /* AppDelegate.m in Sources */, 292 | 5DBC06441D35321D00022EF4 /* main.m in Sources */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | 5DBC06541D35321D00022EF4 /* Sources */ = { 297 | isa = PBXSourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | 5DBC065D1D35321D00022EF4 /* CATRadarViewTests.m in Sources */, 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | 5DBC065F1D35321D00022EF4 /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 5DBC06681D35321D00022EF4 /* CATRadarViewUITests.m in Sources */, 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | /* End PBXSourcesBuildPhase section */ 313 | 314 | /* Begin PBXTargetDependency section */ 315 | 5DBC065A1D35321D00022EF4 /* PBXTargetDependency */ = { 316 | isa = PBXTargetDependency; 317 | target = 5DBC063E1D35321D00022EF4 /* CATRadarView */; 318 | targetProxy = 5DBC06591D35321D00022EF4 /* PBXContainerItemProxy */; 319 | }; 320 | 5DBC06651D35321D00022EF4 /* PBXTargetDependency */ = { 321 | isa = PBXTargetDependency; 322 | target = 5DBC063E1D35321D00022EF4 /* CATRadarView */; 323 | targetProxy = 5DBC06641D35321D00022EF4 /* PBXContainerItemProxy */; 324 | }; 325 | /* End PBXTargetDependency section */ 326 | 327 | /* Begin PBXVariantGroup section */ 328 | 5DBC064B1D35321D00022EF4 /* Main.storyboard */ = { 329 | isa = PBXVariantGroup; 330 | children = ( 331 | 5DBC064C1D35321D00022EF4 /* Base */, 332 | ); 333 | name = Main.storyboard; 334 | sourceTree = ""; 335 | }; 336 | 5DBC06501D35321D00022EF4 /* LaunchScreen.storyboard */ = { 337 | isa = PBXVariantGroup; 338 | children = ( 339 | 5DBC06511D35321D00022EF4 /* Base */, 340 | ); 341 | name = LaunchScreen.storyboard; 342 | sourceTree = ""; 343 | }; 344 | /* End PBXVariantGroup section */ 345 | 346 | /* Begin XCBuildConfiguration section */ 347 | 5DBC066A1D35321D00022EF4 /* Debug */ = { 348 | isa = XCBuildConfiguration; 349 | buildSettings = { 350 | ALWAYS_SEARCH_USER_PATHS = NO; 351 | CLANG_ANALYZER_NONNULL = YES; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_MODULES = YES; 355 | CLANG_ENABLE_OBJC_ARC = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INT_CONVERSION = YES; 362 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 363 | CLANG_WARN_UNREACHABLE_CODE = YES; 364 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 365 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 366 | COPY_PHASE_STRIP = NO; 367 | DEBUG_INFORMATION_FORMAT = dwarf; 368 | ENABLE_STRICT_OBJC_MSGSEND = YES; 369 | ENABLE_TESTABILITY = YES; 370 | GCC_C_LANGUAGE_STANDARD = gnu99; 371 | GCC_DYNAMIC_NO_PIC = NO; 372 | GCC_NO_COMMON_BLOCKS = YES; 373 | GCC_OPTIMIZATION_LEVEL = 0; 374 | GCC_PREPROCESSOR_DEFINITIONS = ( 375 | "DEBUG=1", 376 | "$(inherited)", 377 | ); 378 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 379 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 380 | GCC_WARN_UNDECLARED_SELECTOR = YES; 381 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 382 | GCC_WARN_UNUSED_FUNCTION = YES; 383 | GCC_WARN_UNUSED_VARIABLE = YES; 384 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 385 | MTL_ENABLE_DEBUG_INFO = YES; 386 | ONLY_ACTIVE_ARCH = YES; 387 | SDKROOT = iphoneos; 388 | TARGETED_DEVICE_FAMILY = "1,2"; 389 | }; 390 | name = Debug; 391 | }; 392 | 5DBC066B1D35321D00022EF4 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_SEARCH_USER_PATHS = NO; 396 | CLANG_ANALYZER_NONNULL = YES; 397 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 398 | CLANG_CXX_LIBRARY = "libc++"; 399 | CLANG_ENABLE_MODULES = YES; 400 | CLANG_ENABLE_OBJC_ARC = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_CONSTANT_CONVERSION = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 413 | ENABLE_NS_ASSERTIONS = NO; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | GCC_C_LANGUAGE_STANDARD = gnu99; 416 | GCC_NO_COMMON_BLOCKS = YES; 417 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 418 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 419 | GCC_WARN_UNDECLARED_SELECTOR = YES; 420 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 421 | GCC_WARN_UNUSED_FUNCTION = YES; 422 | GCC_WARN_UNUSED_VARIABLE = YES; 423 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 424 | MTL_ENABLE_DEBUG_INFO = NO; 425 | SDKROOT = iphoneos; 426 | TARGETED_DEVICE_FAMILY = "1,2"; 427 | VALIDATE_PRODUCT = YES; 428 | }; 429 | name = Release; 430 | }; 431 | 5DBC066D1D35321D00022EF4 /* Debug */ = { 432 | isa = XCBuildConfiguration; 433 | buildSettings = { 434 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 435 | INFOPLIST_FILE = CATRadarView/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.catch.CATRadarView; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | }; 440 | name = Debug; 441 | }; 442 | 5DBC066E1D35321D00022EF4 /* Release */ = { 443 | isa = XCBuildConfiguration; 444 | buildSettings = { 445 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 446 | INFOPLIST_FILE = CATRadarView/Info.plist; 447 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 448 | PRODUCT_BUNDLE_IDENTIFIER = com.catch.CATRadarView; 449 | PRODUCT_NAME = "$(TARGET_NAME)"; 450 | }; 451 | name = Release; 452 | }; 453 | 5DBC06701D35321D00022EF4 /* Debug */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | BUNDLE_LOADER = "$(TEST_HOST)"; 457 | INFOPLIST_FILE = CATRadarViewTests/Info.plist; 458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 459 | PRODUCT_BUNDLE_IDENTIFIER = com.catch.CATRadarViewTests; 460 | PRODUCT_NAME = "$(TARGET_NAME)"; 461 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CATRadarView.app/CATRadarView"; 462 | }; 463 | name = Debug; 464 | }; 465 | 5DBC06711D35321D00022EF4 /* Release */ = { 466 | isa = XCBuildConfiguration; 467 | buildSettings = { 468 | BUNDLE_LOADER = "$(TEST_HOST)"; 469 | INFOPLIST_FILE = CATRadarViewTests/Info.plist; 470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 471 | PRODUCT_BUNDLE_IDENTIFIER = com.catch.CATRadarViewTests; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CATRadarView.app/CATRadarView"; 474 | }; 475 | name = Release; 476 | }; 477 | 5DBC06731D35321D00022EF4 /* Debug */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | INFOPLIST_FILE = CATRadarViewUITests/Info.plist; 481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 482 | PRODUCT_BUNDLE_IDENTIFIER = com.catch.CATRadarViewUITests; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TEST_TARGET_NAME = CATRadarView; 485 | }; 486 | name = Debug; 487 | }; 488 | 5DBC06741D35321D00022EF4 /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | INFOPLIST_FILE = CATRadarViewUITests/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = com.catch.CATRadarViewUITests; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | TEST_TARGET_NAME = CATRadarView; 496 | }; 497 | name = Release; 498 | }; 499 | /* End XCBuildConfiguration section */ 500 | 501 | /* Begin XCConfigurationList section */ 502 | 5DBC063A1D35321D00022EF4 /* Build configuration list for PBXProject "CATRadarView" */ = { 503 | isa = XCConfigurationList; 504 | buildConfigurations = ( 505 | 5DBC066A1D35321D00022EF4 /* Debug */, 506 | 5DBC066B1D35321D00022EF4 /* Release */, 507 | ); 508 | defaultConfigurationIsVisible = 0; 509 | defaultConfigurationName = Release; 510 | }; 511 | 5DBC066C1D35321D00022EF4 /* Build configuration list for PBXNativeTarget "CATRadarView" */ = { 512 | isa = XCConfigurationList; 513 | buildConfigurations = ( 514 | 5DBC066D1D35321D00022EF4 /* Debug */, 515 | 5DBC066E1D35321D00022EF4 /* Release */, 516 | ); 517 | defaultConfigurationIsVisible = 0; 518 | }; 519 | 5DBC066F1D35321D00022EF4 /* Build configuration list for PBXNativeTarget "CATRadarViewTests" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | 5DBC06701D35321D00022EF4 /* Debug */, 523 | 5DBC06711D35321D00022EF4 /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | }; 527 | 5DBC06721D35321D00022EF4 /* Build configuration list for PBXNativeTarget "CATRadarViewUITests" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 5DBC06731D35321D00022EF4 /* Debug */, 531 | 5DBC06741D35321D00022EF4 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | }; 535 | /* End XCConfigurationList section */ 536 | }; 537 | rootObject = 5DBC06371D35321D00022EF4 /* Project object */; 538 | } 539 | -------------------------------------------------------------------------------- /CATRadarView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CATRadarView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CATRadarView 4 | // 5 | // Created by zengcatch on 16/7/12. 6 | // Copyright © 2016年 catch. 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 | -------------------------------------------------------------------------------- /CATRadarView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CATRadarView 4 | // 5 | // Created by zengcatch on 16/7/12. 6 | // Copyright © 2016年 catch. 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 | -------------------------------------------------------------------------------- /CATRadarView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /CATRadarView/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 | -------------------------------------------------------------------------------- /CATRadarView/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 | -------------------------------------------------------------------------------- /CATRadarView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /CATRadarView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CATRadarView 4 | // 5 | // Created by zengcatch on 16/7/12. 6 | // Copyright © 2016年 catch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /CATRadarView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CATRadarView 4 | // 5 | // Created by zengcatch on 16/7/12. 6 | // Copyright © 2016年 catch. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "CATRadarView.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet CATRadarView *radarView; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | _radarView.fillColor = [UIColor blueColor]; 24 | _radarView.instanceCount = 4; 25 | _radarView.instanceDelay = 1; 26 | _radarView.animationDuration = _radarView.instanceCount* _radarView.instanceDelay; 27 | _radarView.opacityValue = 0.6f; 28 | 29 | [_radarView startAnimation]; 30 | } 31 | 32 | -(void)viewWillDisappear:(BOOL)animated{ 33 | [super viewWillDisappear:animated]; 34 | 35 | [_radarView stopAnimation]; 36 | } 37 | 38 | - (void)didReceiveMemoryWarning { 39 | [super didReceiveMemoryWarning]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /CATRadarView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CATRadarView 4 | // 5 | // Created by zengcatch on 16/7/12. 6 | // Copyright © 2016年 catch. 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 | -------------------------------------------------------------------------------- /CATRadarViewTests/CATRadarViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CATRadarViewTests.m 3 | // CATRadarViewTests 4 | // 5 | // Created by zengcatch on 16/7/12. 6 | // Copyright © 2016年 catch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CATRadarViewTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation CATRadarViewTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /CATRadarViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /CATRadarViewUITests/CATRadarViewUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CATRadarViewUITests.m 3 | // CATRadarViewUITests 4 | // 5 | // Created by zengcatch on 16/7/12. 6 | // Copyright © 2016年 catch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CATRadarViewUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation CATRadarViewUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /CATRadarViewUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Classes/CATRadarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CATRadarView.h 3 | // CATRadarView 4 | // 5 | // Created by catch on 16/7/12. 6 | // Copyright © 2016年 catch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * Custom Radar View 13 | */ 14 | @interface CATRadarView : UIView 15 | 16 | //fill color 17 | @property (nonatomic, strong) UIColor *fillColor; 18 | 19 | //instance count 20 | @property (nonatomic, assign) NSInteger instanceCount; 21 | 22 | //instance delay 23 | @property (nonatomic, assign) CFTimeInterval instanceDelay; 24 | 25 | //opacity 26 | @property (nonatomic, assign) CGFloat opacityValue; 27 | 28 | //animation duration 29 | @property (nonatomic, assign) CFTimeInterval animationDuration; 30 | 31 | /** 32 | * start animation 33 | */ 34 | -(void)startAnimation; 35 | 36 | /** 37 | * stop animation 38 | */ 39 | -(void)stopAnimation; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Classes/CATRadarView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CATRadarView.m 3 | // CATRadarView 4 | // 5 | // Created by catch on 16/7/12. 6 | // Copyright © 2016年 catch. All rights reserved. 7 | // 8 | 9 | #import "CATRadarView.h" 10 | 11 | @interface CATRadarView() 12 | 13 | @property (nonatomic, strong) CAShapeLayer *pulseLayer; 14 | @property (nonatomic, strong) CAReplicatorLayer *replicatorLayer; 15 | @property (nonatomic, strong) CAAnimationGroup *animaGroup; 16 | @property (nonatomic, strong) CABasicAnimation *opacityAnima; 17 | 18 | @end 19 | 20 | @implementation CATRadarView 21 | 22 | #pragma mark -- Init 23 | 24 | -(instancetype)init{ 25 | self = [super init]; 26 | if (self) { 27 | [self setup]; 28 | } 29 | return self; 30 | } 31 | 32 | -(instancetype)initWithCoder:(NSCoder *)aDecoder{ 33 | self = [super initWithCoder:aDecoder]; 34 | if (self) { 35 | [self setup]; 36 | } 37 | return self; 38 | } 39 | 40 | -(instancetype)initWithFrame:(CGRect)frame{ 41 | self = [super initWithFrame:frame]; 42 | if (self) { 43 | [self setup]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)setup{ 49 | self.layer.backgroundColor = [UIColor clearColor].CGColor; 50 | } 51 | 52 | #pragma mark -- Public Method 53 | 54 | -(void)startAnimation{ 55 | if (![self.layer.sublayers containsObject:self.replicatorLayer]) { 56 | [self.layer addSublayer:self.replicatorLayer]; 57 | } 58 | 59 | [self.pulseLayer removeAllAnimations]; 60 | [self.pulseLayer addAnimation:self.animaGroup forKey:@"groupAnimation"]; 61 | } 62 | 63 | -(void)stopAnimation{ 64 | if (_pulseLayer) { 65 | [_pulseLayer removeAllAnimations]; 66 | } 67 | } 68 | 69 | #pragma mark -- Setters & Getters 70 | 71 | -(void)setFillColor:(UIColor *)fillColor{ 72 | _fillColor = fillColor; 73 | self.pulseLayer.fillColor = fillColor.CGColor; 74 | } 75 | 76 | -(void)setInstanceCount:(NSInteger)instanceCount{ 77 | _instanceCount = instanceCount; 78 | self.replicatorLayer.instanceCount = instanceCount; 79 | } 80 | 81 | -(void)setInstanceDelay:(CFTimeInterval)instanceDelay{ 82 | _instanceDelay = instanceDelay; 83 | self.replicatorLayer.instanceDelay = instanceDelay; 84 | } 85 | 86 | -(void)setOpacityValue:(CGFloat)opacityValue{ 87 | _opacityValue = opacityValue; 88 | self.opacityAnima.fromValue = @(opacityValue); 89 | } 90 | 91 | -(void)setAnimationDuration:(CFTimeInterval)animationDuration{ 92 | _animationDuration = animationDuration; 93 | self.animaGroup.duration = animationDuration; 94 | } 95 | 96 | - (CAShapeLayer *)pulseLayer { 97 | if(_pulseLayer == nil) { 98 | _pulseLayer = [CAShapeLayer layer]; 99 | _pulseLayer.frame = self.layer.bounds; 100 | _pulseLayer.path = [UIBezierPath bezierPathWithOvalInRect:_pulseLayer.bounds].CGPath; 101 | _pulseLayer.fillColor = [UIColor blueColor].CGColor; 102 | _pulseLayer.opacity = 0.0; 103 | } 104 | return _pulseLayer; 105 | } 106 | 107 | - (CAReplicatorLayer *)replicatorLayer { 108 | if(_replicatorLayer == nil) { 109 | _replicatorLayer = [CAReplicatorLayer layer]; 110 | _replicatorLayer.frame = self.bounds; 111 | _replicatorLayer.instanceCount = 6; 112 | _replicatorLayer.instanceDelay = 1.5; 113 | [_replicatorLayer addSublayer:self.pulseLayer]; 114 | } 115 | return _replicatorLayer; 116 | } 117 | 118 | - (CAAnimationGroup *)animaGroup { 119 | if(_animaGroup == nil) { 120 | CABasicAnimation *scaleAnima = [CABasicAnimation animationWithKeyPath:@"transform"]; 121 | scaleAnima.fromValue = [NSValue valueWithCATransform3D:CATransform3DScale(CATransform3DIdentity, 0.0, 0.0, 0.0)]; 122 | scaleAnima.toValue = [NSValue valueWithCATransform3D:CATransform3DScale(CATransform3DIdentity, 1.0, 1.0, 0.0)]; 123 | 124 | _animaGroup = [CAAnimationGroup animation]; 125 | _animaGroup.animations = @[self.opacityAnima, scaleAnima]; 126 | _animaGroup.duration = 9; 127 | _animaGroup.autoreverses = NO; 128 | _animaGroup.repeatCount = HUGE; 129 | } 130 | return _animaGroup; 131 | } 132 | 133 | - (CABasicAnimation *)opacityAnima { 134 | if(_opacityAnima == nil) { 135 | _opacityAnima = [CABasicAnimation animationWithKeyPath:@"opacity"]; 136 | _opacityAnima.fromValue = @(0.3); 137 | _opacityAnima.toValue = @(0.0); 138 | } 139 | return _opacityAnima; 140 | } 141 | 142 | @end -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Catch Zeng 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CATRadarView 2 | 3 | iOS radar view. Swift implement [Ripples](https://github.com/CatchZeng/Ripples) 4 | 5 | # Effect 6 | 7 | ![Effect](https://github.com/CatchZeng/CATRadarView/blob/master/CATRadarView.gif) 8 | 9 | # Installation 10 | 11 | Add CATRadarView.h & CATRadarView.m to your project. 12 | 13 | 14 | # Usage 15 | 16 | You can init CATRadarView in code or xib. 17 | 18 | 19 | Animation 20 | 21 | ```objective-c 22 | 23 | [_radarView startAnimation]; 24 | 25 | [_radarView stopAnimation]; 26 | 27 | ``` 28 | 29 | Customization 30 | 31 | ```objective-c 32 | 33 | //fill color 34 | @property (nonatomic, strong) UIColor *fillColor; 35 | 36 | //instance count 37 | @property (nonatomic, assign) NSInteger instanceCount; 38 | 39 | //instance delay 40 | @property (nonatomic, assign) CFTimeInterval instanceDelay; 41 | 42 | //opacity 43 | @property (nonatomic, assign) CGFloat opacityValue; 44 | 45 | //animation duration 46 | @property (nonatomic, assign) CFTimeInterval animationDuration; 47 | 48 | 49 | ``` 50 | --------------------------------------------------------------------------------