├── .gitignore ├── .swift-version ├── ALRadialMenu.podspec ├── ALRadialMenu.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── Example.xcscheme ├── ALRadialMenu ├── ALRadialMenu.swift └── ALRadialMenuButton.swift ├── ALRadialMenuTests ├── ALRadialMenuTests.swift └── Supporting Files │ └── Info.plist ├── Example ├── AppDelegate.swift ├── Supporting Files │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── icon@120.png │ │ │ ├── icon@180.png │ │ │ ├── icon@58.png │ │ │ ├── icon@80.png │ │ │ └── icon@87.png │ │ ├── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── splash-3.5.png │ │ │ ├── splash-4.7.png │ │ │ ├── splash-4.png │ │ │ └── splash-5.5.png │ │ ├── icon1.imageset │ │ │ ├── Contents.json │ │ │ ├── icon1.png │ │ │ ├── icon1@2x.png │ │ │ └── icon1@3x.png │ │ ├── icon2.imageset │ │ │ ├── Contents.json │ │ │ ├── icon2.png │ │ │ ├── icon2@2x.png │ │ │ └── icon2@3x.png │ │ ├── icon3.imageset │ │ │ ├── Contents.json │ │ │ ├── icon3.png │ │ │ ├── icon3@2x.png │ │ │ └── icon3@3x.png │ │ ├── icon4.imageset │ │ │ ├── Contents.json │ │ │ ├── icon4.png │ │ │ ├── icon4@2x.png │ │ │ └── icon4@3x.png │ │ ├── icon5.imageset │ │ │ ├── Contents.json │ │ │ ├── icon5.png │ │ │ ├── icon5@2x.png │ │ │ └── icon5@3x.png │ │ ├── icon6.imageset │ │ │ ├── Contents.json │ │ │ ├── icon6.png │ │ │ ├── icon6@2x.png │ │ │ └── icon6@3x.png │ │ ├── icon7.imageset │ │ │ ├── Contents.json │ │ │ ├── icon7.png │ │ │ ├── icon7@2x.png │ │ │ └── icon7@3x.png │ │ └── icon8.imageset │ │ │ ├── Contents.json │ │ │ ├── icon8.png │ │ │ ├── icon8@2x.png │ │ │ └── icon8@3x.png │ └── Info.plist └── ViewController.swift ├── LICENSE ├── README.md └── demo.mov /.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 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 2 | -------------------------------------------------------------------------------- /ALRadialMenu.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = "ALRadialMenu" 3 | spec.version = "2.0.0" 4 | spec.summary = "A radial/circular menu featuring spring animations" 5 | spec.source = { :git => "https://github.com/AlexLittlejohn/ALRadialMenu.git", :tag => spec.version.to_s } 6 | spec.requires_arc = true 7 | spec.platform = :ios, "8.0" 8 | spec.license = "MIT" 9 | spec.source_files = "ALRadialMenu/*.{swift}" 10 | spec.homepage = "https://github.com/AlexLittlejohn/ALRadialMenu" 11 | spec.author = { "Alex Littlejohn" => "alexlittlejohn@me.com" } 12 | spec.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' } 13 | end 14 | -------------------------------------------------------------------------------- /ALRadialMenu.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FA90629A1AED25F700B7735F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA9062991AED25F700B7735F /* AppDelegate.swift */; }; 11 | FA90629C1AED25F700B7735F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90629B1AED25F700B7735F /* ViewController.swift */; }; 12 | FA9062A11AED25F700B7735F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA9062A01AED25F700B7735F /* Images.xcassets */; }; 13 | FA9062B01AED25F700B7735F /* ALRadialMenuTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA9062AF1AED25F700B7735F /* ALRadialMenuTests.swift */; }; 14 | FA9062BB1AED26FC00B7735F /* ALRadialMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA9062BA1AED26FC00B7735F /* ALRadialMenu.swift */; }; 15 | FA9062BD1AED272800B7735F /* ALRadialMenuButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA9062BC1AED272800B7735F /* ALRadialMenuButton.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | FA9062AA1AED25F700B7735F /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = FA90628C1AED25F700B7735F /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = FA9062931AED25F700B7735F; 24 | remoteInfo = ALRadialMenu; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | FA9062941AED25F700B7735F /* ALRadialMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ALRadialMenu.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | FA9062981AED25F700B7735F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | FA9062991AED25F700B7735F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 32 | FA90629B1AED25F700B7735F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 33 | FA9062A01AED25F700B7735F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 34 | FA9062A91AED25F700B7735F /* ALRadialMenuTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ALRadialMenuTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | FA9062AE1AED25F700B7735F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | FA9062AF1AED25F700B7735F /* ALRadialMenuTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ALRadialMenuTests.swift; sourceTree = ""; }; 37 | FA9062BA1AED26FC00B7735F /* ALRadialMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ALRadialMenu.swift; sourceTree = ""; }; 38 | FA9062BC1AED272800B7735F /* ALRadialMenuButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ALRadialMenuButton.swift; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | FA9062911AED25F700B7735F /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | FA9062A61AED25F700B7735F /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | FA90628B1AED25F700B7735F = { 60 | isa = PBXGroup; 61 | children = ( 62 | FA9062B91AED264500B7735F /* Example */, 63 | FA9062961AED25F700B7735F /* ALRadialMenu */, 64 | FA9062AC1AED25F700B7735F /* ALRadialMenuTests */, 65 | FA9062951AED25F700B7735F /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | FA9062951AED25F700B7735F /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | FA9062941AED25F700B7735F /* ALRadialMenu.app */, 73 | FA9062A91AED25F700B7735F /* ALRadialMenuTests.xctest */, 74 | ); 75 | name = Products; 76 | sourceTree = ""; 77 | }; 78 | FA9062961AED25F700B7735F /* ALRadialMenu */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | FA9062BA1AED26FC00B7735F /* ALRadialMenu.swift */, 82 | FA9062BC1AED272800B7735F /* ALRadialMenuButton.swift */, 83 | ); 84 | path = ALRadialMenu; 85 | sourceTree = ""; 86 | }; 87 | FA9062971AED25F700B7735F /* Supporting Files */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | FA9062A01AED25F700B7735F /* Images.xcassets */, 91 | FA9062981AED25F700B7735F /* Info.plist */, 92 | ); 93 | path = "Supporting Files"; 94 | sourceTree = ""; 95 | }; 96 | FA9062AC1AED25F700B7735F /* ALRadialMenuTests */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | FA9062AF1AED25F700B7735F /* ALRadialMenuTests.swift */, 100 | FA9062AD1AED25F700B7735F /* Supporting Files */, 101 | ); 102 | path = ALRadialMenuTests; 103 | sourceTree = ""; 104 | }; 105 | FA9062AD1AED25F700B7735F /* Supporting Files */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | FA9062AE1AED25F700B7735F /* Info.plist */, 109 | ); 110 | path = "Supporting Files"; 111 | sourceTree = ""; 112 | }; 113 | FA9062B91AED264500B7735F /* Example */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | FA9062991AED25F700B7735F /* AppDelegate.swift */, 117 | FA90629B1AED25F700B7735F /* ViewController.swift */, 118 | FA9062971AED25F700B7735F /* Supporting Files */, 119 | ); 120 | path = Example; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXNativeTarget section */ 126 | FA9062931AED25F700B7735F /* ALRadialMenu */ = { 127 | isa = PBXNativeTarget; 128 | buildConfigurationList = FA9062B31AED25F700B7735F /* Build configuration list for PBXNativeTarget "ALRadialMenu" */; 129 | buildPhases = ( 130 | FA9062901AED25F700B7735F /* Sources */, 131 | FA9062911AED25F700B7735F /* Frameworks */, 132 | FA9062921AED25F700B7735F /* Resources */, 133 | ); 134 | buildRules = ( 135 | ); 136 | dependencies = ( 137 | ); 138 | name = ALRadialMenu; 139 | productName = ALRadialMenu; 140 | productReference = FA9062941AED25F700B7735F /* ALRadialMenu.app */; 141 | productType = "com.apple.product-type.application"; 142 | }; 143 | FA9062A81AED25F700B7735F /* ALRadialMenuTests */ = { 144 | isa = PBXNativeTarget; 145 | buildConfigurationList = FA9062B61AED25F700B7735F /* Build configuration list for PBXNativeTarget "ALRadialMenuTests" */; 146 | buildPhases = ( 147 | FA9062A51AED25F700B7735F /* Sources */, 148 | FA9062A61AED25F700B7735F /* Frameworks */, 149 | FA9062A71AED25F700B7735F /* Resources */, 150 | ); 151 | buildRules = ( 152 | ); 153 | dependencies = ( 154 | FA9062AB1AED25F700B7735F /* PBXTargetDependency */, 155 | ); 156 | name = ALRadialMenuTests; 157 | productName = ALRadialMenuTests; 158 | productReference = FA9062A91AED25F700B7735F /* ALRadialMenuTests.xctest */; 159 | productType = "com.apple.product-type.bundle.unit-test"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | FA90628C1AED25F700B7735F /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastSwiftMigration = 0730; 168 | LastSwiftUpdateCheck = 0730; 169 | LastUpgradeCheck = 0900; 170 | ORGANIZATIONNAME = zero; 171 | TargetAttributes = { 172 | FA9062931AED25F700B7735F = { 173 | CreatedOnToolsVersion = 6.3.1; 174 | DevelopmentTeam = GAPQH4AM76; 175 | LastSwiftMigration = 0900; 176 | }; 177 | FA9062A81AED25F700B7735F = { 178 | CreatedOnToolsVersion = 6.3.1; 179 | DevelopmentTeam = GAPQH4AM76; 180 | LastSwiftMigration = 0900; 181 | TestTargetID = FA9062931AED25F700B7735F; 182 | }; 183 | }; 184 | }; 185 | buildConfigurationList = FA90628F1AED25F700B7735F /* Build configuration list for PBXProject "ALRadialMenu" */; 186 | compatibilityVersion = "Xcode 3.2"; 187 | developmentRegion = English; 188 | hasScannedForEncodings = 0; 189 | knownRegions = ( 190 | en, 191 | Base, 192 | ); 193 | mainGroup = FA90628B1AED25F700B7735F; 194 | productRefGroup = FA9062951AED25F700B7735F /* Products */; 195 | projectDirPath = ""; 196 | projectRoot = ""; 197 | targets = ( 198 | FA9062931AED25F700B7735F /* ALRadialMenu */, 199 | FA9062A81AED25F700B7735F /* ALRadialMenuTests */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | FA9062921AED25F700B7735F /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | FA9062A11AED25F700B7735F /* Images.xcassets in Resources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | FA9062A71AED25F700B7735F /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | FA9062901AED25F700B7735F /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | FA90629C1AED25F700B7735F /* ViewController.swift in Sources */, 228 | FA90629A1AED25F700B7735F /* AppDelegate.swift in Sources */, 229 | FA9062BD1AED272800B7735F /* ALRadialMenuButton.swift in Sources */, 230 | FA9062BB1AED26FC00B7735F /* ALRadialMenu.swift in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | FA9062A51AED25F700B7735F /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | FA9062B01AED25F700B7735F /* ALRadialMenuTests.swift in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXSourcesBuildPhase section */ 243 | 244 | /* Begin PBXTargetDependency section */ 245 | FA9062AB1AED25F700B7735F /* PBXTargetDependency */ = { 246 | isa = PBXTargetDependency; 247 | target = FA9062931AED25F700B7735F /* ALRadialMenu */; 248 | targetProxy = FA9062AA1AED25F700B7735F /* PBXContainerItemProxy */; 249 | }; 250 | /* End PBXTargetDependency section */ 251 | 252 | /* Begin XCBuildConfiguration section */ 253 | FA9062B11AED25F700B7735F /* Debug */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 258 | CLANG_CXX_LIBRARY = "libc++"; 259 | CLANG_ENABLE_MODULES = YES; 260 | CLANG_ENABLE_OBJC_ARC = YES; 261 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 262 | CLANG_WARN_BOOL_CONVERSION = YES; 263 | CLANG_WARN_COMMA = YES; 264 | CLANG_WARN_CONSTANT_CONVERSION = YES; 265 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 266 | CLANG_WARN_EMPTY_BODY = YES; 267 | CLANG_WARN_ENUM_CONVERSION = YES; 268 | CLANG_WARN_INFINITE_RECURSION = YES; 269 | CLANG_WARN_INT_CONVERSION = YES; 270 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 271 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 272 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 273 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 274 | CLANG_WARN_STRICT_PROTOTYPES = YES; 275 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 276 | CLANG_WARN_UNREACHABLE_CODE = YES; 277 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 278 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 279 | COPY_PHASE_STRIP = NO; 280 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | ENABLE_TESTABILITY = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_DYNAMIC_NO_PIC = NO; 285 | GCC_NO_COMMON_BLOCKS = YES; 286 | GCC_OPTIMIZATION_LEVEL = 0; 287 | GCC_PREPROCESSOR_DEFINITIONS = ( 288 | "DEBUG=1", 289 | "$(inherited)", 290 | ); 291 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 299 | MTL_ENABLE_DEBUG_INFO = YES; 300 | ONLY_ACTIVE_ARCH = YES; 301 | SDKROOT = iphoneos; 302 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | }; 305 | name = Debug; 306 | }; 307 | FA9062B21AED25F700B7735F /* Release */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | ALWAYS_SEARCH_USER_PATHS = NO; 311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 312 | CLANG_CXX_LIBRARY = "libc++"; 313 | CLANG_ENABLE_MODULES = YES; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_COMMA = YES; 318 | CLANG_WARN_CONSTANT_CONVERSION = YES; 319 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 320 | CLANG_WARN_EMPTY_BODY = YES; 321 | CLANG_WARN_ENUM_CONVERSION = YES; 322 | CLANG_WARN_INFINITE_RECURSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 325 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 326 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 327 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 328 | CLANG_WARN_STRICT_PROTOTYPES = YES; 329 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 330 | CLANG_WARN_UNREACHABLE_CODE = YES; 331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 332 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 333 | COPY_PHASE_STRIP = NO; 334 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 335 | ENABLE_NS_ASSERTIONS = NO; 336 | ENABLE_STRICT_OBJC_MSGSEND = YES; 337 | GCC_C_LANGUAGE_STANDARD = gnu99; 338 | GCC_NO_COMMON_BLOCKS = YES; 339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 341 | GCC_WARN_UNDECLARED_SELECTOR = YES; 342 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 343 | GCC_WARN_UNUSED_FUNCTION = YES; 344 | GCC_WARN_UNUSED_VARIABLE = YES; 345 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 346 | MTL_ENABLE_DEBUG_INFO = NO; 347 | SDKROOT = iphoneos; 348 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 349 | TARGETED_DEVICE_FAMILY = "1,2"; 350 | VALIDATE_PRODUCT = YES; 351 | }; 352 | name = Release; 353 | }; 354 | FA9062B41AED25F700B7735F /* Debug */ = { 355 | isa = XCBuildConfiguration; 356 | buildSettings = { 357 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 358 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 359 | DEVELOPMENT_TEAM = GAPQH4AM76; 360 | INFOPLIST_FILE = "Example/Supporting Files/Info.plist"; 361 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 362 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 363 | PRODUCT_BUNDLE_IDENTIFIER = com.alx.zero.ALRadialMenu; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 366 | SWIFT_VERSION = 4.0; 367 | TARGETED_DEVICE_FAMILY = 1; 368 | }; 369 | name = Debug; 370 | }; 371 | FA9062B51AED25F700B7735F /* Release */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 375 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 376 | DEVELOPMENT_TEAM = GAPQH4AM76; 377 | INFOPLIST_FILE = "Example/Supporting Files/Info.plist"; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 380 | PRODUCT_BUNDLE_IDENTIFIER = com.alx.zero.ALRadialMenu; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 383 | SWIFT_VERSION = 4.0; 384 | TARGETED_DEVICE_FAMILY = 1; 385 | }; 386 | name = Release; 387 | }; 388 | FA9062B71AED25F700B7735F /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | BUNDLE_LOADER = "$(TEST_HOST)"; 392 | DEVELOPMENT_TEAM = GAPQH4AM76; 393 | FRAMEWORK_SEARCH_PATHS = ( 394 | "$(SDKROOT)/Developer/Library/Frameworks", 395 | "$(inherited)", 396 | ); 397 | GCC_PREPROCESSOR_DEFINITIONS = ( 398 | "DEBUG=1", 399 | "$(inherited)", 400 | ); 401 | INFOPLIST_FILE = "ALRadialMenuTests/Supporting Files/Info.plist"; 402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 403 | PRODUCT_BUNDLE_IDENTIFIER = "com.zero.$(PRODUCT_NAME:rfc1034identifier)"; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 406 | SWIFT_VERSION = 4.0; 407 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ALRadialMenu.app/ALRadialMenu"; 408 | }; 409 | name = Debug; 410 | }; 411 | FA9062B81AED25F700B7735F /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | BUNDLE_LOADER = "$(TEST_HOST)"; 415 | DEVELOPMENT_TEAM = GAPQH4AM76; 416 | FRAMEWORK_SEARCH_PATHS = ( 417 | "$(SDKROOT)/Developer/Library/Frameworks", 418 | "$(inherited)", 419 | ); 420 | INFOPLIST_FILE = "ALRadialMenuTests/Supporting Files/Info.plist"; 421 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 422 | PRODUCT_BUNDLE_IDENTIFIER = "com.zero.$(PRODUCT_NAME:rfc1034identifier)"; 423 | PRODUCT_NAME = "$(TARGET_NAME)"; 424 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 425 | SWIFT_VERSION = 4.0; 426 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ALRadialMenu.app/ALRadialMenu"; 427 | }; 428 | name = Release; 429 | }; 430 | /* End XCBuildConfiguration section */ 431 | 432 | /* Begin XCConfigurationList section */ 433 | FA90628F1AED25F700B7735F /* Build configuration list for PBXProject "ALRadialMenu" */ = { 434 | isa = XCConfigurationList; 435 | buildConfigurations = ( 436 | FA9062B11AED25F700B7735F /* Debug */, 437 | FA9062B21AED25F700B7735F /* Release */, 438 | ); 439 | defaultConfigurationIsVisible = 0; 440 | defaultConfigurationName = Release; 441 | }; 442 | FA9062B31AED25F700B7735F /* Build configuration list for PBXNativeTarget "ALRadialMenu" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | FA9062B41AED25F700B7735F /* Debug */, 446 | FA9062B51AED25F700B7735F /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | FA9062B61AED25F700B7735F /* Build configuration list for PBXNativeTarget "ALRadialMenuTests" */ = { 452 | isa = XCConfigurationList; 453 | buildConfigurations = ( 454 | FA9062B71AED25F700B7735F /* Debug */, 455 | FA9062B81AED25F700B7735F /* Release */, 456 | ); 457 | defaultConfigurationIsVisible = 0; 458 | defaultConfigurationName = Release; 459 | }; 460 | /* End XCConfigurationList section */ 461 | }; 462 | rootObject = FA90628C1AED25F700B7735F /* Project object */; 463 | } 464 | -------------------------------------------------------------------------------- /ALRadialMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ALRadialMenu.xcodeproj/xcshareddata/xcschemes/Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 66 | 68 | 74 | 75 | 76 | 77 | 78 | 79 | 85 | 87 | 93 | 94 | 95 | 96 | 98 | 99 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /ALRadialMenu/ALRadialMenu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ALRadialMenu.swift 3 | // ALRadialMenu 4 | // 5 | // Created by Alex Littlejohn on 2015/04/26. 6 | // Copyright (c) 2015 zero. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public typealias ALAnimationsClosure = () -> Void 12 | 13 | private struct Angle { 14 | var degrees: Double 15 | 16 | func radians() -> Double { 17 | return degrees * (Double.pi / 180) 18 | } 19 | } 20 | 21 | public class ALRadialMenu: UIButton { 22 | 23 | // MARK: Public API 24 | 25 | public convenience init() { 26 | self.init(frame: CGRect.zero) 27 | } 28 | 29 | public override init(frame: CGRect) { 30 | super.init(frame: frame) 31 | commonInit() 32 | } 33 | 34 | required public init?(coder aDecoder: NSCoder) { 35 | super.init(coder: aDecoder) 36 | commonInit() 37 | } 38 | 39 | /** 40 | Set a delay to stagger the showing of each subsequent radial button 41 | 42 | Note: this is a bit buggy when using UIView animations 43 | 44 | Default = 0 45 | 46 | - parameter Double: The delay in seconds 47 | */ 48 | @discardableResult 49 | public func setDelay(delay: Double) -> Self { 50 | self.delay = delay 51 | return self 52 | } 53 | 54 | /** 55 | Set the buttons to display when present is called. Each button should be an instance of ALRadialMenuButton 56 | 57 | - parameter Array: An array of ALRadialMenuButton instances 58 | */ 59 | @discardableResult 60 | public func setButtons(buttons: [ALRadialMenuButton]) -> Self { 61 | self.buttons = buttons 62 | 63 | for i in 0.. Self { 88 | self.dismissOnOverlayTap = dismissOnOverlayTap 89 | return self 90 | } 91 | 92 | /** 93 | Set the radius to control how far from the point of origin the buttons should show when the menu is open 94 | 95 | Default = 100 96 | 97 | - parameter Double: the radius in pts 98 | */ 99 | @discardableResult 100 | public func setRadius(radius: Double) -> Self { 101 | self.radius = radius 102 | return self 103 | } 104 | 105 | /** 106 | Set the starting angle from which to lay out the buttons 107 | 108 | Default = 270 109 | 110 | - parameter Double: the angle in degrees 111 | */ 112 | @discardableResult 113 | public func setStartAngle(degrees: Double) -> Self { 114 | self.startAngle = Angle(degrees: degrees) 115 | return self 116 | } 117 | 118 | /** 119 | Set the total circumference that the buttons should be laid out in 120 | 121 | Default = 360 122 | 123 | - parameter Double: the circumference in degrees 124 | */ 125 | @discardableResult 126 | public func setCircumference(degrees: Double) -> Self { 127 | self.circumference = Angle(degrees: degrees) 128 | return self 129 | } 130 | 131 | /** 132 | Set the origin point from which the buttons should animate 133 | 134 | Default = self.center 135 | 136 | - parameter CGPoint: the origin point 137 | */ 138 | @discardableResult 139 | public func setAnimationOrigin(animationOrigin: CGPoint) -> Self { 140 | self.animationOrigin = animationOrigin 141 | return self 142 | } 143 | 144 | /** 145 | Set closure that will be called on dismiss 146 | 147 | Default = nil 148 | 149 | */ 150 | @discardableResult 151 | public func setOnDismiss(onDismiss: @escaping ALAnimationsClosure) -> Self { 152 | self.onDismiss = onDismiss 153 | return self 154 | } 155 | 156 | /** 157 | Set the background color of overlay view 158 | 159 | Default = default UIView background color 160 | 161 | - parameter UIColor: color 162 | */ 163 | @discardableResult 164 | public func setOverlayBackgroundColor(backgroundColor: UIColor) -> Self { 165 | self.overlayView.backgroundColor = backgroundColor 166 | return self 167 | } 168 | 169 | /** 170 | Present the buttons in the specified view's window 171 | 172 | - parameter UIView: view 173 | */ 174 | @discardableResult 175 | public func presentInView(view: UIView) -> Self { 176 | return presentInWindow(win: view.window!) 177 | } 178 | 179 | /** 180 | Present the buttons in the specified window 181 | 182 | - parameter UIWindow: window 183 | */ 184 | @discardableResult 185 | public func presentInWindow(win: UIWindow) -> Self { 186 | 187 | if buttons.count == 0 { 188 | print("ALRadialMenu has no buttons to present") 189 | return self 190 | } 191 | 192 | if animationOrigin == nil { 193 | animationOrigin = center 194 | } 195 | 196 | win.addSubview(overlayView) 197 | 198 | for i in 0.. CGPoint { 313 | 314 | let radians = angle.radians() 315 | let x = origin.x + CGFloat(radius) * CGFloat(cos(radians)) 316 | let y = origin.y + CGFloat(radius) * CGFloat(sin(radians)) 317 | 318 | return CGPoint(x: x, y: y) 319 | } 320 | 321 | private func calculateSpacing() { 322 | if buttons.count > 0 { 323 | 324 | var c = buttons.count 325 | 326 | if circumference.degrees < 360 && c > 1 { 327 | c -= 1 328 | } 329 | 330 | spacingDegrees = Angle(degrees: circumference.degrees / Double(c)) 331 | } 332 | } 333 | } 334 | -------------------------------------------------------------------------------- /ALRadialMenu/ALRadialMenuButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ALRadialMenuButton.swift 3 | // ALRadialMenu 4 | // 5 | // Created by Alex Littlejohn on 2015/04/26. 6 | // Copyright (c) 2015 zero. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public typealias ALRadialMenuButtonAction = (UIButton) -> Void 12 | 13 | public class ALRadialMenuButton: UIButton { 14 | public var action: ALRadialMenuButtonAction? { 15 | didSet { 16 | configureAction() 17 | } 18 | } 19 | 20 | private func configureAction() { 21 | addTarget(self, action: #selector(performAction), for: .touchUpInside) 22 | } 23 | 24 | @objc internal func performAction() { 25 | if let a = action { 26 | a(self) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ALRadialMenuTests/ALRadialMenuTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ALRadialMenuTests.swift 3 | // ALRadialMenuTests 4 | // 5 | // Created by Alex Littlejohn on 2015/04/26. 6 | // Copyright (c) 2015 zero. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class ALRadialMenuTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ALRadialMenuTests/Supporting Files/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 | -------------------------------------------------------------------------------- /Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ALRadialMenu 4 | // 5 | // Created by Alex Littlejohn on 2015/04/26. 6 | // Copyright (c) 2015 zero. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 17 | 18 | window = UIWindow(frame: UIScreen.main.bounds) 19 | window?.rootViewController = ViewController() 20 | window?.makeKeyAndVisible() 21 | 22 | return true 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon@58.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon@87.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "icon@80.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon@120.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "idiom" : "iphone", 29 | "size" : "60x60", 30 | "filename" : "icon@120.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "icon@180.png", 37 | "scale" : "3x" 38 | } 39 | ], 40 | "info" : { 41 | "version" : 1, 42 | "author" : "xcode" 43 | } 44 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@120.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@180.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@58.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@80.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/AppIcon.appiconset/icon@87.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "splash-5.5.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "667h", 16 | "filename" : "splash-4.7.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "orientation" : "portrait", 23 | "idiom" : "iphone", 24 | "extent" : "full-screen", 25 | "minimum-system-version" : "7.0", 26 | "filename" : "splash-3.5.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "extent" : "full-screen", 31 | "idiom" : "iphone", 32 | "subtype" : "retina4", 33 | "filename" : "splash-4.png", 34 | "minimum-system-version" : "7.0", 35 | "orientation" : "portrait", 36 | "scale" : "2x" 37 | } 38 | ], 39 | "info" : { 40 | "version" : 1, 41 | "author" : "xcode" 42 | } 43 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-3.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-3.5.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-4.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-4.7.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-4.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-5.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/LaunchImage.launchimage/splash-5.5.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon1.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon1@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon1@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon1.imageset/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon1.imageset/icon1.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon1.imageset/icon1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon1.imageset/icon1@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon1.imageset/icon1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon1.imageset/icon1@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon2.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon2@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon2@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon2.imageset/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon2.imageset/icon2.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon2.imageset/icon2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon2.imageset/icon2@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon2.imageset/icon2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon2.imageset/icon2@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon3.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon3@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon3@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon3.imageset/icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon3.imageset/icon3.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon3.imageset/icon3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon3.imageset/icon3@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon3.imageset/icon3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon3.imageset/icon3@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon4.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon4@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon4@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon4.imageset/icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon4.imageset/icon4.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon4.imageset/icon4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon4.imageset/icon4@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon4.imageset/icon4@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon4.imageset/icon4@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon5.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon5@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon5@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon5.imageset/icon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon5.imageset/icon5.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon5.imageset/icon5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon5.imageset/icon5@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon5.imageset/icon5@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon5.imageset/icon5@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon6.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon6@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon6@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon6.imageset/icon6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon6.imageset/icon6.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon6.imageset/icon6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon6.imageset/icon6@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon6.imageset/icon6@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon6.imageset/icon6@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon7.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon7@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon7@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon7.imageset/icon7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon7.imageset/icon7.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon7.imageset/icon7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon7.imageset/icon7@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon7.imageset/icon7@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon7.imageset/icon7@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon8.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "icon8@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "icon8@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon8.imageset/icon8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon8.imageset/icon8.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon8.imageset/icon8@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon8.imageset/icon8@2x.png -------------------------------------------------------------------------------- /Example/Supporting Files/Images.xcassets/icon8.imageset/icon8@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/Example/Supporting Files/Images.xcassets/icon8.imageset/icon8@3x.png -------------------------------------------------------------------------------- /Example/Supporting Files/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 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ALRadialMenu 4 | // 5 | // Created by Alex Littlejohn on 2015/04/26. 6 | // Copyright (c) 2015 zero. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | let label = UILabel() 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | let gesture = UITapGestureRecognizer(target: self, action: #selector(showMenu(sender:))) 18 | view.addGestureRecognizer(gesture) 19 | view.backgroundColor = UIColor.white 20 | 21 | label.textColor = UIColor.lightGray 22 | label.text = "Tap anywhere" 23 | label.sizeToFit() 24 | label.center = view.center 25 | 26 | view.addSubview(label) 27 | } 28 | 29 | func generateButtons() -> [ALRadialMenuButton] { 30 | 31 | var buttons = [ALRadialMenuButton]() 32 | 33 | for i in 0..<8 { 34 | let button = ALRadialMenuButton(frame: CGRect(x: 0, y: 0, width: 44, height: 44)) 35 | button.setImage(UIImage(named: "icon\(i+1)"), for: UIControlState.normal) 36 | buttons.append(button) 37 | } 38 | 39 | return buttons 40 | } 41 | 42 | @objc func showMenu(sender: UITapGestureRecognizer) { 43 | ALRadialMenu() 44 | .setButtons(buttons: generateButtons()) 45 | .setDelay(delay: 0.05) 46 | .setAnimationOrigin(animationOrigin: sender.location(in: view)) 47 | .presentInView(view: view) 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alex Littlejohn 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :warning: This project is unmaintained 2 | 3 | # ALRadialMenu 4 | A radial/circular menu featuring spring animations. Written in swift. 5 | Experimenting with fluent interfaces (https://github.com/vandadnp/swift-weekly/blob/master/issue05/README.md) 6 | 7 | ![Screen](https://cloud.githubusercontent.com/assets/932822/7349115/18865370-ecf7-11e4-839d-ad8c225c2283.png) 8 | 9 | ### Usage 10 | 11 | ```swift 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | let gesture = UITapGestureRecognizer(target: self, action: "showMenu:") 15 | view.addGestureRecognizer(gesture) 16 | } 17 | 18 | func showMenu(sender: UITapGestureRecognizer) { 19 | 20 | var buttons = [ALRadialMenuButton]() 21 | 22 | ... 23 | /// create buttons 24 | ... 25 | 26 | ALRadialMenu() 27 | .setButtons(buttons) 28 | .setAnimationOrigin(sender.locationInView(view)) 29 | .presentInView(view) 30 | } 31 | ``` 32 | 33 | ## License 34 | ALRadialMenu is available under the MIT license. See the LICENSE file for more info. 35 | -------------------------------------------------------------------------------- /demo.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexLittlejohn/ALRadialMenu/aa80ae2ad62cb5c193627df517d248d9e81c39f4/demo.mov --------------------------------------------------------------------------------