├── .gitignore ├── Collect-Bridging-Header.h ├── Collect.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Pasosu.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Pasosu.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── Collect.xcscheme │ └── xcschememanagement.plist ├── Collect ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── CollectTests ├── CollectTests.swift └── Info.plist ├── CollectUITests ├── CollectUITests.swift └── Info.plist ├── README.md └── Souce ├── CollectButtonMenu.swift └── Humberger.swift /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /Collect-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /Collect.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 491767291BE4C62B00785E83 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491767281BE4C62B00785E83 /* AppDelegate.swift */; }; 11 | 4917672B1BE4C62B00785E83 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4917672A1BE4C62B00785E83 /* ViewController.swift */; }; 12 | 4917672E1BE4C62B00785E83 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4917672C1BE4C62B00785E83 /* Main.storyboard */; }; 13 | 491767301BE4C62B00785E83 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4917672F1BE4C62B00785E83 /* Assets.xcassets */; }; 14 | 491767331BE4C62B00785E83 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 491767311BE4C62B00785E83 /* LaunchScreen.storyboard */; }; 15 | 4917673E1BE4C62B00785E83 /* CollectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4917673D1BE4C62B00785E83 /* CollectTests.swift */; }; 16 | 491767491BE4C62B00785E83 /* CollectUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491767481BE4C62B00785E83 /* CollectUITests.swift */; }; 17 | 49566A3E1BFEE6BD00BEAE2A /* CollectButtonMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49566A3C1BFEE6BD00BEAE2A /* CollectButtonMenu.swift */; }; 18 | 49566A401BFEE75C00BEAE2A /* Humberger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49566A3F1BFEE75C00BEAE2A /* Humberger.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 4917673A1BE4C62B00785E83 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 4917671D1BE4C62B00785E83 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 491767241BE4C62B00785E83; 27 | remoteInfo = Collect; 28 | }; 29 | 491767451BE4C62B00785E83 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 4917671D1BE4C62B00785E83 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 491767241BE4C62B00785E83; 34 | remoteInfo = Collect; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 491767251BE4C62B00785E83 /* Collect.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Collect.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 491767281BE4C62B00785E83 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 4917672A1BE4C62B00785E83 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 42 | 4917672D1BE4C62B00785E83 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | 4917672F1BE4C62B00785E83 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | 491767321BE4C62B00785E83 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | 491767341BE4C62B00785E83 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 491767391BE4C62B00785E83 /* CollectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CollectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 4917673D1BE4C62B00785E83 /* CollectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectTests.swift; sourceTree = ""; }; 48 | 4917673F1BE4C62B00785E83 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 491767441BE4C62B00785E83 /* CollectUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CollectUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 491767481BE4C62B00785E83 /* CollectUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectUITests.swift; sourceTree = ""; }; 51 | 4917674A1BE4C62B00785E83 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 491767591BE4D0FC00785E83 /* Collect-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Collect-Bridging-Header.h"; sourceTree = ""; }; 53 | 49566A3C1BFEE6BD00BEAE2A /* CollectButtonMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectButtonMenu.swift; sourceTree = ""; }; 54 | 49566A3F1BFEE75C00BEAE2A /* Humberger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Humberger.swift; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 491767221BE4C62B00785E83 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | 491767361BE4C62B00785E83 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 491767411BE4C62B00785E83 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | 4917671C1BE4C62B00785E83 = { 83 | isa = PBXGroup; 84 | children = ( 85 | 491767271BE4C62B00785E83 /* Collect */, 86 | 4917673C1BE4C62B00785E83 /* CollectTests */, 87 | 491767471BE4C62B00785E83 /* CollectUITests */, 88 | 491767261BE4C62B00785E83 /* Products */, 89 | 49566A3A1BFEE6BD00BEAE2A /* Souce */, 90 | 491767591BE4D0FC00785E83 /* Collect-Bridging-Header.h */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 491767261BE4C62B00785E83 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 491767251BE4C62B00785E83 /* Collect.app */, 98 | 491767391BE4C62B00785E83 /* CollectTests.xctest */, 99 | 491767441BE4C62B00785E83 /* CollectUITests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 491767271BE4C62B00785E83 /* Collect */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 491767281BE4C62B00785E83 /* AppDelegate.swift */, 108 | 4917672A1BE4C62B00785E83 /* ViewController.swift */, 109 | 4917672C1BE4C62B00785E83 /* Main.storyboard */, 110 | 4917672F1BE4C62B00785E83 /* Assets.xcassets */, 111 | 491767311BE4C62B00785E83 /* LaunchScreen.storyboard */, 112 | 491767341BE4C62B00785E83 /* Info.plist */, 113 | ); 114 | path = Collect; 115 | sourceTree = ""; 116 | }; 117 | 4917673C1BE4C62B00785E83 /* CollectTests */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 4917673D1BE4C62B00785E83 /* CollectTests.swift */, 121 | 4917673F1BE4C62B00785E83 /* Info.plist */, 122 | ); 123 | path = CollectTests; 124 | sourceTree = ""; 125 | }; 126 | 491767471BE4C62B00785E83 /* CollectUITests */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 491767481BE4C62B00785E83 /* CollectUITests.swift */, 130 | 4917674A1BE4C62B00785E83 /* Info.plist */, 131 | ); 132 | path = CollectUITests; 133 | sourceTree = ""; 134 | }; 135 | 49566A3A1BFEE6BD00BEAE2A /* Souce */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 49566A3F1BFEE75C00BEAE2A /* Humberger.swift */, 139 | 49566A3C1BFEE6BD00BEAE2A /* CollectButtonMenu.swift */, 140 | ); 141 | path = Souce; 142 | sourceTree = ""; 143 | }; 144 | /* End PBXGroup section */ 145 | 146 | /* Begin PBXNativeTarget section */ 147 | 491767241BE4C62B00785E83 /* Collect */ = { 148 | isa = PBXNativeTarget; 149 | buildConfigurationList = 4917674D1BE4C62B00785E83 /* Build configuration list for PBXNativeTarget "Collect" */; 150 | buildPhases = ( 151 | 491767211BE4C62B00785E83 /* Sources */, 152 | 491767221BE4C62B00785E83 /* Frameworks */, 153 | 491767231BE4C62B00785E83 /* Resources */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | ); 159 | name = Collect; 160 | productName = Collect; 161 | productReference = 491767251BE4C62B00785E83 /* Collect.app */; 162 | productType = "com.apple.product-type.application"; 163 | }; 164 | 491767381BE4C62B00785E83 /* CollectTests */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 491767501BE4C62B00785E83 /* Build configuration list for PBXNativeTarget "CollectTests" */; 167 | buildPhases = ( 168 | 491767351BE4C62B00785E83 /* Sources */, 169 | 491767361BE4C62B00785E83 /* Frameworks */, 170 | 491767371BE4C62B00785E83 /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | 4917673B1BE4C62B00785E83 /* PBXTargetDependency */, 176 | ); 177 | name = CollectTests; 178 | productName = CollectTests; 179 | productReference = 491767391BE4C62B00785E83 /* CollectTests.xctest */; 180 | productType = "com.apple.product-type.bundle.unit-test"; 181 | }; 182 | 491767431BE4C62B00785E83 /* CollectUITests */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = 491767531BE4C62B00785E83 /* Build configuration list for PBXNativeTarget "CollectUITests" */; 185 | buildPhases = ( 186 | 491767401BE4C62B00785E83 /* Sources */, 187 | 491767411BE4C62B00785E83 /* Frameworks */, 188 | 491767421BE4C62B00785E83 /* Resources */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | 491767461BE4C62B00785E83 /* PBXTargetDependency */, 194 | ); 195 | name = CollectUITests; 196 | productName = CollectUITests; 197 | productReference = 491767441BE4C62B00785E83 /* CollectUITests.xctest */; 198 | productType = "com.apple.product-type.bundle.ui-testing"; 199 | }; 200 | /* End PBXNativeTarget section */ 201 | 202 | /* Begin PBXProject section */ 203 | 4917671D1BE4C62B00785E83 /* Project object */ = { 204 | isa = PBXProject; 205 | attributes = { 206 | LastSwiftUpdateCheck = 0710; 207 | LastUpgradeCheck = 0710; 208 | ORGANIZATIONNAME = "パソス"; 209 | TargetAttributes = { 210 | 491767241BE4C62B00785E83 = { 211 | CreatedOnToolsVersion = 7.1; 212 | DevelopmentTeam = HK9P6A38HP; 213 | }; 214 | 491767381BE4C62B00785E83 = { 215 | CreatedOnToolsVersion = 7.1; 216 | DevelopmentTeam = HK9P6A38HP; 217 | TestTargetID = 491767241BE4C62B00785E83; 218 | }; 219 | 491767431BE4C62B00785E83 = { 220 | CreatedOnToolsVersion = 7.1; 221 | DevelopmentTeam = HK9P6A38HP; 222 | TestTargetID = 491767241BE4C62B00785E83; 223 | }; 224 | }; 225 | }; 226 | buildConfigurationList = 491767201BE4C62B00785E83 /* Build configuration list for PBXProject "Collect" */; 227 | compatibilityVersion = "Xcode 3.2"; 228 | developmentRegion = English; 229 | hasScannedForEncodings = 0; 230 | knownRegions = ( 231 | en, 232 | Base, 233 | ); 234 | mainGroup = 4917671C1BE4C62B00785E83; 235 | productRefGroup = 491767261BE4C62B00785E83 /* Products */; 236 | projectDirPath = ""; 237 | projectRoot = ""; 238 | targets = ( 239 | 491767241BE4C62B00785E83 /* Collect */, 240 | 491767381BE4C62B00785E83 /* CollectTests */, 241 | 491767431BE4C62B00785E83 /* CollectUITests */, 242 | ); 243 | }; 244 | /* End PBXProject section */ 245 | 246 | /* Begin PBXResourcesBuildPhase section */ 247 | 491767231BE4C62B00785E83 /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | 491767331BE4C62B00785E83 /* LaunchScreen.storyboard in Resources */, 252 | 491767301BE4C62B00785E83 /* Assets.xcassets in Resources */, 253 | 4917672E1BE4C62B00785E83 /* Main.storyboard in Resources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | 491767371BE4C62B00785E83 /* Resources */ = { 258 | isa = PBXResourcesBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | 491767421BE4C62B00785E83 /* Resources */ = { 265 | isa = PBXResourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | /* End PBXResourcesBuildPhase section */ 272 | 273 | /* Begin PBXSourcesBuildPhase section */ 274 | 491767211BE4C62B00785E83 /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 4917672B1BE4C62B00785E83 /* ViewController.swift in Sources */, 279 | 491767291BE4C62B00785E83 /* AppDelegate.swift in Sources */, 280 | 49566A3E1BFEE6BD00BEAE2A /* CollectButtonMenu.swift in Sources */, 281 | 49566A401BFEE75C00BEAE2A /* Humberger.swift in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | 491767351BE4C62B00785E83 /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 4917673E1BE4C62B00785E83 /* CollectTests.swift in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | 491767401BE4C62B00785E83 /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | 491767491BE4C62B00785E83 /* CollectUITests.swift in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXTargetDependency section */ 304 | 4917673B1BE4C62B00785E83 /* PBXTargetDependency */ = { 305 | isa = PBXTargetDependency; 306 | target = 491767241BE4C62B00785E83 /* Collect */; 307 | targetProxy = 4917673A1BE4C62B00785E83 /* PBXContainerItemProxy */; 308 | }; 309 | 491767461BE4C62B00785E83 /* PBXTargetDependency */ = { 310 | isa = PBXTargetDependency; 311 | target = 491767241BE4C62B00785E83 /* Collect */; 312 | targetProxy = 491767451BE4C62B00785E83 /* PBXContainerItemProxy */; 313 | }; 314 | /* End PBXTargetDependency section */ 315 | 316 | /* Begin PBXVariantGroup section */ 317 | 4917672C1BE4C62B00785E83 /* Main.storyboard */ = { 318 | isa = PBXVariantGroup; 319 | children = ( 320 | 4917672D1BE4C62B00785E83 /* Base */, 321 | ); 322 | name = Main.storyboard; 323 | sourceTree = ""; 324 | }; 325 | 491767311BE4C62B00785E83 /* LaunchScreen.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | 491767321BE4C62B00785E83 /* Base */, 329 | ); 330 | name = LaunchScreen.storyboard; 331 | sourceTree = ""; 332 | }; 333 | /* End PBXVariantGroup section */ 334 | 335 | /* Begin XCBuildConfiguration section */ 336 | 4917674B1BE4C62B00785E83 /* Debug */ = { 337 | isa = XCBuildConfiguration; 338 | buildSettings = { 339 | ALWAYS_SEARCH_USER_PATHS = NO; 340 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 341 | CLANG_CXX_LIBRARY = "libc++"; 342 | CLANG_ENABLE_MODULES = YES; 343 | CLANG_ENABLE_OBJC_ARC = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 351 | CLANG_WARN_UNREACHABLE_CODE = YES; 352 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 353 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 354 | COPY_PHASE_STRIP = NO; 355 | DEBUG_INFORMATION_FORMAT = dwarf; 356 | ENABLE_STRICT_OBJC_MSGSEND = YES; 357 | ENABLE_TESTABILITY = YES; 358 | GCC_C_LANGUAGE_STANDARD = gnu99; 359 | GCC_DYNAMIC_NO_PIC = NO; 360 | GCC_NO_COMMON_BLOCKS = YES; 361 | GCC_OPTIMIZATION_LEVEL = 0; 362 | GCC_PREPROCESSOR_DEFINITIONS = ( 363 | "DEBUG=1", 364 | "$(inherited)", 365 | ); 366 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 367 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 368 | GCC_WARN_UNDECLARED_SELECTOR = YES; 369 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 370 | GCC_WARN_UNUSED_FUNCTION = YES; 371 | GCC_WARN_UNUSED_VARIABLE = YES; 372 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 373 | MTL_ENABLE_DEBUG_INFO = YES; 374 | ONLY_ACTIVE_ARCH = YES; 375 | SDKROOT = iphoneos; 376 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 377 | }; 378 | name = Debug; 379 | }; 380 | 4917674C1BE4C62B00785E83 /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ALWAYS_SEARCH_USER_PATHS = NO; 384 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 385 | CLANG_CXX_LIBRARY = "libc++"; 386 | CLANG_ENABLE_MODULES = YES; 387 | CLANG_ENABLE_OBJC_ARC = YES; 388 | CLANG_WARN_BOOL_CONVERSION = YES; 389 | CLANG_WARN_CONSTANT_CONVERSION = YES; 390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 391 | CLANG_WARN_EMPTY_BODY = YES; 392 | CLANG_WARN_ENUM_CONVERSION = YES; 393 | CLANG_WARN_INT_CONVERSION = YES; 394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 395 | CLANG_WARN_UNREACHABLE_CODE = YES; 396 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 397 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 398 | COPY_PHASE_STRIP = NO; 399 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 400 | ENABLE_NS_ASSERTIONS = NO; 401 | ENABLE_STRICT_OBJC_MSGSEND = YES; 402 | GCC_C_LANGUAGE_STANDARD = gnu99; 403 | GCC_NO_COMMON_BLOCKS = YES; 404 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 405 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 406 | GCC_WARN_UNDECLARED_SELECTOR = YES; 407 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 408 | GCC_WARN_UNUSED_FUNCTION = YES; 409 | GCC_WARN_UNUSED_VARIABLE = YES; 410 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 411 | MTL_ENABLE_DEBUG_INFO = NO; 412 | SDKROOT = iphoneos; 413 | VALIDATE_PRODUCT = YES; 414 | }; 415 | name = Release; 416 | }; 417 | 4917674E1BE4C62B00785E83 /* Debug */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | INFOPLIST_FILE = Collect/Info.plist; 423 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 425 | PRODUCT_BUNDLE_IDENTIFIER = com.passos.test.Collect; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SWIFT_OBJC_BRIDGING_HEADER = "Collect-Bridging-Header.h"; 428 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 429 | }; 430 | name = Debug; 431 | }; 432 | 4917674F1BE4C62B00785E83 /* Release */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 436 | CLANG_ENABLE_MODULES = YES; 437 | INFOPLIST_FILE = Collect/Info.plist; 438 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 440 | PRODUCT_BUNDLE_IDENTIFIER = com.passos.test.Collect; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | SWIFT_OBJC_BRIDGING_HEADER = "Collect-Bridging-Header.h"; 443 | }; 444 | name = Release; 445 | }; 446 | 491767511BE4C62B00785E83 /* Debug */ = { 447 | isa = XCBuildConfiguration; 448 | buildSettings = { 449 | BUNDLE_LOADER = "$(TEST_HOST)"; 450 | INFOPLIST_FILE = CollectTests/Info.plist; 451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 452 | PRODUCT_BUNDLE_IDENTIFIER = com.passos.test.CollectTests; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Collect.app/Collect"; 455 | }; 456 | name = Debug; 457 | }; 458 | 491767521BE4C62B00785E83 /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | buildSettings = { 461 | BUNDLE_LOADER = "$(TEST_HOST)"; 462 | INFOPLIST_FILE = CollectTests/Info.plist; 463 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 464 | PRODUCT_BUNDLE_IDENTIFIER = com.passos.test.CollectTests; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Collect.app/Collect"; 467 | }; 468 | name = Release; 469 | }; 470 | 491767541BE4C62B00785E83 /* Debug */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | INFOPLIST_FILE = CollectUITests/Info.plist; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 475 | PRODUCT_BUNDLE_IDENTIFIER = com.passos.test.CollectUITests; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | TEST_TARGET_NAME = Collect; 478 | USES_XCTRUNNER = YES; 479 | }; 480 | name = Debug; 481 | }; 482 | 491767551BE4C62B00785E83 /* Release */ = { 483 | isa = XCBuildConfiguration; 484 | buildSettings = { 485 | INFOPLIST_FILE = CollectUITests/Info.plist; 486 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 487 | PRODUCT_BUNDLE_IDENTIFIER = com.passos.test.CollectUITests; 488 | PRODUCT_NAME = "$(TARGET_NAME)"; 489 | TEST_TARGET_NAME = Collect; 490 | USES_XCTRUNNER = YES; 491 | }; 492 | name = Release; 493 | }; 494 | /* End XCBuildConfiguration section */ 495 | 496 | /* Begin XCConfigurationList section */ 497 | 491767201BE4C62B00785E83 /* Build configuration list for PBXProject "Collect" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | 4917674B1BE4C62B00785E83 /* Debug */, 501 | 4917674C1BE4C62B00785E83 /* Release */, 502 | ); 503 | defaultConfigurationIsVisible = 0; 504 | defaultConfigurationName = Release; 505 | }; 506 | 4917674D1BE4C62B00785E83 /* Build configuration list for PBXNativeTarget "Collect" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | 4917674E1BE4C62B00785E83 /* Debug */, 510 | 4917674F1BE4C62B00785E83 /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | 491767501BE4C62B00785E83 /* Build configuration list for PBXNativeTarget "CollectTests" */ = { 516 | isa = XCConfigurationList; 517 | buildConfigurations = ( 518 | 491767511BE4C62B00785E83 /* Debug */, 519 | 491767521BE4C62B00785E83 /* Release */, 520 | ); 521 | defaultConfigurationIsVisible = 0; 522 | defaultConfigurationName = Release; 523 | }; 524 | 491767531BE4C62B00785E83 /* Build configuration list for PBXNativeTarget "CollectUITests" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | 491767541BE4C62B00785E83 /* Debug */, 528 | 491767551BE4C62B00785E83 /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | /* End XCConfigurationList section */ 534 | }; 535 | rootObject = 4917671D1BE4C62B00785E83 /* Project object */; 536 | } 537 | -------------------------------------------------------------------------------- /Collect.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Collect.xcodeproj/project.xcworkspace/xcuserdata/Pasosu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pasos/CollectButtonMenu/70b6323d8183a413be4dbd24fd516b83b2852e14/Collect.xcodeproj/project.xcworkspace/xcuserdata/Pasosu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Collect.xcodeproj/xcuserdata/Pasosu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Collect.xcodeproj/xcuserdata/Pasosu.xcuserdatad/xcschemes/Collect.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Collect.xcodeproj/xcuserdata/Pasosu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Collect.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 491767241BE4C62B00785E83 16 | 17 | primary 18 | 19 | 20 | 491767381BE4C62B00785E83 21 | 22 | primary 23 | 24 | 25 | 491767431BE4C62B00785E83 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Collect/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Collect 4 | // 5 | // Created by パソス on 2015/10/31. 6 | // Copyright © 2015年 パソス. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Collect/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Collect/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 | 29 | -------------------------------------------------------------------------------- /Collect/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 | 33 | 59 | 70 | 81 | 92 | 106 | 125 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /Collect/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Collect/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Collect 4 | // 5 | // Created by パソス on 2015/10/31. 6 | // Copyright © 2015年 パソス. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | var collectBM1:CollectButtonMenu! 14 | var collectBM2:CollectButtonMenu! 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | roundedButton(buttons: [b1Button,b2Button,b3Button,b4Button,b5Button,b6Button]) 19 | 20 | collectBM1 = CollectButtonMenu(frame: CGRectMake(UIScreen.mainScreen().bounds.size.width-60, UIScreen.mainScreen().bounds.size.height*2/3, 50, 50), color: UIColor.redColor(), view_controller: self) 21 | collectBM1.LOCATE_TYPE = CollectButtonMenu.locate_name.Left 22 | collectBM1.NEAR_DISTANCE = 70 23 | collectBM1.add(button: b4Button, actiontype: [UIControlEvents.TouchUpInside]) 24 | collectBM1.add(button: b5Button, actiontype: [UIControlEvents.TouchUpInside]) 25 | collectBM1.add(button: b6Button, actiontype: [UIControlEvents.TouchUpInside]) 26 | self.view.addSubview(collectBM1) 27 | 28 | collectBM2 = CollectButtonMenu(frame: CGRectMake(UIScreen.mainScreen().bounds.size.width-60, UIScreen.mainScreen().bounds.size.height-60, 50, 50), color: UIColor.purpleColor(), view_controller: self) 29 | collectBM2.LOCATE_TYPE = CollectButtonMenu.locate_name.UpLeft 30 | collectBM2.NEAR_DISTANCE = 70 31 | collectBM2.add(button: b1Button, actiontype: [UIControlEvents.TouchDown, UIControlEvents.TouchUpInside]) 32 | collectBM2.add(button: b2Button, actiontype: [UIControlEvents.TouchDown, UIControlEvents.TouchUpInside]) 33 | collectBM2.add(button: b3Button, actiontype: [UIControlEvents.TouchDown, UIControlEvents.TouchUpInside]) 34 | self.view.addSubview(collectBM2) 35 | } 36 | 37 | override func didReceiveMemoryWarning() { 38 | super.didReceiveMemoryWarning() 39 | } 40 | 41 | //タッチイベント 42 | @IBAction func ButtonAction(sender: UIButton) { 43 | showNameLabel.text = sender.titleLabel?.text 44 | } 45 | 46 | @IBAction func ButtonTouchDown(sender: UIButton) { 47 | UIView.animateWithDuration(0.3, delay: 0.0, options: UIViewAnimationOptions(), animations: {() -> Void in 48 | self.touchDownLabel.transform = CGAffineTransformMakeScale(1.3, 1.3) 49 | } 50 | ,completion: {(finished: Bool) -> Void in 51 | self.touchDownLabel.transform = CGAffineTransformMakeScale(1.0, 1.0) 52 | } 53 | ) 54 | } 55 | 56 | //ボタンを丸くする関数 57 | func roundedButton(buttons _buttons :[UIButton]){ 58 | for _button in _buttons { 59 | _button.layer.cornerRadius = min(_button.layer.frame.width, _button.layer.frame.height)/2 60 | _button.layer.masksToBounds = true 61 | } 62 | } 63 | 64 | @IBOutlet weak var touchDownLabel: UILabel! 65 | @IBOutlet weak var showNameLabel: UILabel! 66 | @IBOutlet weak var collectButton: UIButton! 67 | @IBOutlet weak var b1Button: UIButton! 68 | @IBOutlet weak var b2Button: UIButton! 69 | @IBOutlet weak var b3Button: UIButton! 70 | @IBOutlet weak var b4Button: UIButton! 71 | @IBOutlet weak var b5Button: UIButton! 72 | @IBOutlet weak var b6Button: UIButton! 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /CollectTests/CollectTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectTests.swift 3 | // CollectTests 4 | // 5 | // Created by パソス on 2015/10/31. 6 | // Copyright © 2015年 パソス. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Collect 11 | 12 | class CollectTests: 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 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CollectTests/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 | -------------------------------------------------------------------------------- /CollectUITests/CollectUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectUITests.swift 3 | // CollectUITests 4 | // 5 | // Created by パソス on 2015/10/31. 6 | // Copyright © 2015年 パソス. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class CollectUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // 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. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CollectUITests/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #CollectButtonMenu 2 | 3 | CollectButtonMenu collect some grouped UIButton arround the CollectButtonMenu, if a user touch down the Button. 4 | And if the user drag and touch up in the UIButton, TouchEvent for the UIButton occur. 5 | 6 | A display use HumbergerButton 7 | 8 | http://robb.is/working-on/a-hamburger-button-transition/ 9 | 10 | ##Concept 11 | In the Latest, iphone device gets bigger. 12 | So, User can't touch the Button easily with one hand control. 13 | I want to touch all button easily near a thumb. 14 | 15 | ##How to Use 16 | 17 | ###initialize 18 | init(frame: CGRect, color: UIColor, view_controller: UIViewController) 19 | 20 | - frame: Position of CollectButtonMenu 21 | 22 | - color: BackGroundColor of CollectButtonMenu and grouped UIButtons when a user drag the UIButton. 23 | 24 | - view_controller: UIViewController the CollectButtonMenu is located in. 25 | 26 | ###add a UIButton in the group 27 | add(button: UIButton, actiontype: [UIControlEvents]) 28 | 29 | - button: a UIButton added in the group 30 | - actiontype: a occured TouchEvent when the touch up inside the UIButton (multi TouchEvents avaiable.TouchEvents occur in order based on array) 31 | 32 | 33 | ###remove a UIButton from the group 34 | remove(button: UIButton) 35 | 36 | - button: a UIButton removed from the group 37 | 38 | ###Option 39 | 40 | - BUTTON_COLOR:UIColor 41 | 42 | The BackGroundColor when a user drag a grouped UIButton 43 | 44 | initial value:UIColor.redColor() 45 | 46 | - NEAR_DISTANCE:Int: 47 | 48 | A distance between CollectButtonMenu and grouped UIBUttons when the UIButtons are collected [pixel] 49 | 50 | initial value:50 51 | 52 | - LOCATE_TYPE:locate_name 53 | 54 | a direction where UIButton locate 55 | 56 | initial value:locate_name.All 57 | ### locate_name 58 | locate_name.All 59 | 60 | locate_name.Up 61 | 62 | locate_name.Left 63 | 64 | locate_name.Right 65 | 66 | locate_name.Down 67 | 68 | locate_name.UpLeft 69 | 70 | locate_name.UpRight 71 | 72 | locate_name.DownLeft 73 | 74 | locate_name.DownRight 75 | -------------------------------------------------------------------------------- /Souce/CollectButtonMenu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectButton.swift 3 | // Collect 4 | // 5 | // Created by パソス on 2015/11/17. 6 | // Copyright © 2015年 パソス. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | public class CollectButtonMenu: HamburgerButton{ 13 | 14 | var targets:[TargetButton] = [] //集めるボタン格納 15 | var collect_state:Bool = false //集めているかの状態 16 | var view_controller:UIViewController! = nil //親のViewController格納 17 | enum locate_name { //配置タイプ名 18 | case All 19 | case Up 20 | case Left 21 | case Right 22 | case Down 23 | case UpLeft 24 | case UpRight 25 | case DownLeft 26 | case DownRight 27 | } 28 | 29 | var NEAR_DISTANCE:CGFloat = 40 //どれぐらい近くに配置するか 30 | var BUTTON_COLOR:UIColor = UIColor.redColor() //ドラッグ時に染める色 31 | var LOCATE_TYPE: locate_name = locate_name.All //配置するタイプ 32 | 33 | init(frame _frame:CGRect, color _color:UIColor, view_controller _view_controller:UIViewController ){ 34 | super.init(frame: _frame, color: _color) 35 | BUTTON_COLOR = _color 36 | view_controller = _view_controller 37 | } 38 | 39 | required public init?(coder aDecoder: NSCoder) { 40 | super.init(coder: aDecoder) 41 | } 42 | 43 | //集めるボタングループに追加 44 | func add(button _button:UIButton, actiontype _action_type:[UIControlEvents]) { 45 | targets.append(TargetButton(button: _button, action_event: _action_type)) 46 | 47 | } 48 | 49 | //集めるボタングループから除外 50 | func remove(button _button:UIButton){ 51 | var i = 0 52 | for target in targets { 53 | if target.button == _button { 54 | targets.removeAtIndex(i) 55 | } 56 | i += 1 57 | } 58 | } 59 | 60 | //グループに入っているボタンかどうか指定 61 | func is_exist(button _button:UIButton)-> Bool{ 62 | for target in targets { 63 | if target.button == _button { 64 | return true 65 | } 66 | } 67 | return false 68 | } 69 | 70 | //☆タッチイベント 71 | 72 | //ドラッグ開始 73 | override public func touchesBegan(touches: Set, withEvent event: UIEvent?) { 74 | collect() 75 | collect_state = true 76 | self.showsMenu = !self.showsMenu//★ハンバーガー継承の場合 77 | } 78 | 79 | //ドラッグ終了 80 | override public func touchesEnded(touches: Set, withEvent event: UIEvent?) { 81 | 82 | //ボタンのタッチ関数呼び出し 83 | 84 | //タッチ位置取得 85 | let aTouch = touches.first 86 | let location = aTouch!.locationInView(view_controller.view) 87 | 88 | for target in targets { 89 | if(target.button.frame.contains(location)){ 90 | for action_event in target.action_events { 91 | target.button.sendActionsForControlEvents(action_event) 92 | } 93 | UIView.animateWithDuration(0.3, delay: 0.8, options: UIViewAnimationOptions(), animations: {() -> Void in 94 | target.button.transform = CGAffineTransformMakeScale(1, 1) 95 | target.button.backgroundColor = target.origin_color 96 | } 97 | ,completion: {(finished: Bool) -> Void in 98 | } 99 | ) 100 | } 101 | } 102 | //ボタンを元の位置に戻す。 103 | uncollect() 104 | collect_state = false 105 | self.showsMenu = !self.showsMenu//★ハンバーガー継承の場合 106 | } 107 | 108 | //ドラッグ移動 109 | override public func touchesMoved(touches: Set, withEvent event: UIEvent?) { 110 | // タッチイベントを取得. 111 | let aTouch = touches.first 112 | // 移動した先の座標を取得. 113 | let location = aTouch!.locationInView(view_controller.view) 114 | 115 | for target in targets { 116 | if(target.button.frame.contains(location)){ 117 | //ドラッグ中のボタン 118 | UIView.animateWithDuration(0.3, 119 | animations: {() -> Void in 120 | target.button.transform = CGAffineTransformMakeScale(1.3, 1.3); 121 | target.button.backgroundColor = self.BUTTON_COLOR 122 | }) 123 | target.button.layer.zPosition = 1 124 | }else{ 125 | //それ以外ののボタン 126 | UIView.animateWithDuration(0.3, 127 | animations: {() -> Void in 128 | target.button.transform = CGAffineTransformMakeScale(1, 1); 129 | target.button.backgroundColor = target.origin_color 130 | }) 131 | target.button.layer.zPosition = 0 132 | } 133 | } 134 | 135 | } 136 | 137 | 138 | //コレクトボタン近くにターゲットボタンを集める 139 | func collect(){ 140 | //ボタンの元の情報記録 141 | for target in targets { 142 | target.origin_point.x = target.button.layer.position.x 143 | target.origin_point.y = target.button.layer.position.y 144 | target.origin_zpoint = target.button.layer.zPosition 145 | if let color = target.button.backgroundColor { 146 | target.origin_color = color 147 | }else{ 148 | target.origin_color = UIColor.clearColor() 149 | } 150 | } 151 | //ボタン移動 152 | var i = 0 153 | for target in targets { 154 | UIView.animateWithDuration(0.8, 155 | animations: {() -> Void in 156 | target.button.layer.position.x = self.layer.position.x + self.NEAR_DISTANCE*CGFloat(cos(self.locateangle(i))) 157 | target.button.layer.position.y = self.layer.position.y + self.NEAR_DISTANCE*CGFloat(sin(self.locateangle(i))) 158 | }) 159 | i += 1 160 | } 161 | } 162 | 163 | //ボタンを元の座標に戻す 164 | func uncollect(){ 165 | for target in targets { 166 | UIView.animateWithDuration(0.8, 167 | animations: {() -> Void in 168 | target.button.layer.position = target.origin_point 169 | }) 170 | target.button.layer.zPosition = target.origin_zpoint 171 | } 172 | } 173 | 174 | //配置する方向の決定 175 | func locateangle(i:Int) -> Double{ 176 | var direction:Double = 0 177 | if(LOCATE_TYPE == locate_name.All){ 178 | direction = 2*M_PI/Double(targets.count)*Double(i) 179 | }else{ 180 | if(targets.count != 1){ 181 | direction = 2*M_PI/Double(targets.count-1)*Double(i) 182 | }else{ 183 | direction = 2*M_PI/Double(targets.count+1)*Double(i+1) 184 | } 185 | } 186 | //配置タイプによって処理 187 | switch LOCATE_TYPE { 188 | case locate_name.Up ://Up 189 | direction = direction/2 + M_PI 190 | case locate_name.Left://Left 191 | direction = direction/2 + M_PI/2 192 | case locate_name.Right://Right 193 | direction = direction/2 + M_PI*1.5 194 | if(direction > M_PI*2){ 195 | direction -= M_PI*2 196 | } 197 | case locate_name.Down://Down 198 | direction = direction/2 199 | case locate_name.UpLeft://UpLeft 200 | direction = direction/4 + M_PI 201 | case locate_name.UpRight://UpRight 202 | direction = direction/4 + M_PI*1.5 203 | case locate_name.DownLeft://DownLeft 204 | direction = direction/4 + M_PI/2 205 | case locate_name.DownRight://DownRight 206 | direction = direction/4 207 | default: 208 | break 209 | } 210 | return direction 211 | } 212 | } 213 | 214 | class TargetButton { 215 | 216 | var button:UIButton //ボタン本体 217 | var origin_point:CGPoint //元の座標 218 | var origin_color:UIColor //元の背景色 219 | var origin_zpoint:CGFloat //元のZ座標 220 | var action_events:[UIControlEvents]//起こすタッチアクション 221 | 222 | init(button _button:UIButton, action_event _action_event:[UIControlEvents]){ 223 | button = _button 224 | origin_point = _button.layer.position 225 | origin_zpoint = _button.layer.zPosition 226 | if let color = _button.backgroundColor { 227 | origin_color = color 228 | }else{ 229 | origin_color = UIColor.clearColor() 230 | } 231 | action_events = _action_event 232 | } 233 | 234 | } -------------------------------------------------------------------------------- /Souce/Humberger.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Hamburger.swift 3 | // Hamburger Button 4 | // 5 | // Created by Robert Böhnke on 02/07/14. 6 | // Copyright (c) 2014 Robert Böhnke. All rights reserved. 7 | // 8 | 9 | import CoreGraphics 10 | import QuartzCore 11 | import UIKit 12 | 13 | public class HamburgerButton : UIButton { 14 | 15 | let shortStroke: CGPath = { 16 | let path = CGPathCreateMutable() 17 | CGPathMoveToPoint(path, nil, 2, 2) 18 | CGPathAddLineToPoint(path, nil, 28, 2) 19 | 20 | return path 21 | }() 22 | 23 | let outline: CGPath = { 24 | let path = CGPathCreateMutable() 25 | CGPathMoveToPoint(path, nil, 10, 27) 26 | CGPathAddCurveToPoint(path, nil, 12.00, 27.00, 28.02, 27.00, 40, 27) 27 | CGPathAddCurveToPoint(path, nil, 55.92, 27.00, 50.47, 2.00, 27, 2) 28 | CGPathAddCurveToPoint(path, nil, 13.16, 2.00, 2.00, 13.16, 2, 27) 29 | CGPathAddCurveToPoint(path, nil, 2.00, 40.84, 13.16, 52.00, 27, 52) 30 | CGPathAddCurveToPoint(path, nil, 40.84, 52.00, 52.00, 40.84, 52, 27) 31 | CGPathAddCurveToPoint(path, nil, 52.00, 13.16, 42.39, 2.00, 27, 2) 32 | CGPathAddCurveToPoint(path, nil, 13.16, 2.00, 2.00, 13.16, 2, 27) 33 | 34 | return path 35 | }() 36 | 37 | let menuStrokeStart: CGFloat = 0.325 38 | let menuStrokeEnd: CGFloat = 0.9 39 | 40 | let hamburgerStrokeStart: CGFloat = 0.028 41 | let hamburgerStrokeEnd: CGFloat = 0.111 42 | 43 | required public init?(coder aDecoder: NSCoder) { 44 | super.init(coder: aDecoder) 45 | } 46 | 47 | init(frame: CGRect, color:UIColor) { 48 | super.init(frame: frame) 49 | 50 | self.top.path = shortStroke 51 | self.middle.path = outline 52 | self.bottom.path = shortStroke 53 | 54 | for layer in [ self.top, self.middle, self.bottom ] { 55 | layer.fillColor = nil 56 | layer.strokeColor = color.CGColor 57 | layer.lineWidth = 4 58 | layer.miterLimit = 4 59 | layer.lineCap = kCALineCapRound 60 | layer.masksToBounds = true 61 | 62 | let strokingPath = CGPathCreateCopyByStrokingPath(layer.path, nil, 4, .Round, .Miter, 4) 63 | 64 | layer.bounds = CGPathGetPathBoundingBox(strokingPath) 65 | 66 | layer.actions = [ 67 | "strokeStart": NSNull(), 68 | "strokeEnd": NSNull(), 69 | "transform": NSNull() 70 | ] 71 | 72 | self.layer.addSublayer(layer) 73 | } 74 | 75 | self.top.anchorPoint = CGPointMake(28.0 / 30.0, 0.5) 76 | self.top.position = CGPointMake(40, 18) 77 | 78 | self.middle.position = CGPointMake(27, 27) 79 | self.middle.strokeStart = hamburgerStrokeStart 80 | self.middle.strokeEnd = hamburgerStrokeEnd 81 | 82 | self.bottom.anchorPoint = CGPointMake(28.0 / 30.0, 0.5) 83 | self.bottom.position = CGPointMake(40, 36) 84 | } 85 | 86 | var showsMenu: Bool = false { 87 | didSet { 88 | let strokeStart = CABasicAnimation(keyPath: "strokeStart") 89 | let strokeEnd = CABasicAnimation(keyPath: "strokeEnd") 90 | 91 | if self.showsMenu { 92 | strokeStart.toValue = menuStrokeStart 93 | strokeStart.duration = 0.5 94 | strokeStart.timingFunction = CAMediaTimingFunction(controlPoints: 0.25, -0.4, 0.5, 1) 95 | 96 | strokeEnd.toValue = menuStrokeEnd 97 | strokeEnd.duration = 0.6 98 | strokeEnd.timingFunction = CAMediaTimingFunction(controlPoints: 0.25, -0.4, 0.5, 1) 99 | } else { 100 | strokeStart.toValue = hamburgerStrokeStart 101 | strokeStart.duration = 0.5 102 | strokeStart.timingFunction = CAMediaTimingFunction(controlPoints: 0.25, 0, 0.5, 1.2) 103 | strokeStart.beginTime = CACurrentMediaTime() + 0.1 104 | strokeStart.fillMode = kCAFillModeBackwards 105 | 106 | strokeEnd.toValue = hamburgerStrokeEnd 107 | strokeEnd.duration = 0.6 108 | strokeEnd.timingFunction = CAMediaTimingFunction(controlPoints: 0.25, 0.3, 0.5, 0.9) 109 | } 110 | 111 | self.middle.ocb_applyAnimation(strokeStart) 112 | self.middle.ocb_applyAnimation(strokeEnd) 113 | 114 | let topTransform = CABasicAnimation(keyPath: "transform") 115 | topTransform.timingFunction = CAMediaTimingFunction(controlPoints: 0.5, -0.8, 0.5, 1.85) 116 | topTransform.duration = 0.4 117 | topTransform.fillMode = kCAFillModeBackwards 118 | 119 | let bottomTransform = topTransform.copy() as! CABasicAnimation 120 | 121 | if self.showsMenu { 122 | let translation = CATransform3DMakeTranslation(-4, 0, 0) 123 | 124 | topTransform.toValue = NSValue(CATransform3D: CATransform3DRotate(translation, -0.7853975, 0, 0, 1)) 125 | topTransform.beginTime = CACurrentMediaTime() + 0.25 126 | 127 | bottomTransform.toValue = NSValue(CATransform3D: CATransform3DRotate(translation, 0.7853975, 0, 0, 1)) 128 | bottomTransform.beginTime = CACurrentMediaTime() + 0.25 129 | } else { 130 | topTransform.toValue = NSValue(CATransform3D: CATransform3DIdentity) 131 | topTransform.beginTime = CACurrentMediaTime() + 0.05 132 | 133 | bottomTransform.toValue = NSValue(CATransform3D: CATransform3DIdentity) 134 | bottomTransform.beginTime = CACurrentMediaTime() + 0.05 135 | } 136 | 137 | self.top.ocb_applyAnimation(topTransform) 138 | self.bottom.ocb_applyAnimation(bottomTransform) 139 | } 140 | } 141 | 142 | var top: CAShapeLayer! = CAShapeLayer() 143 | var bottom: CAShapeLayer! = CAShapeLayer() 144 | var middle: CAShapeLayer! = CAShapeLayer() 145 | } 146 | 147 | extension CALayer { 148 | func ocb_applyAnimation(animation: CABasicAnimation) { 149 | let copy = animation.copy() as! CABasicAnimation 150 | 151 | if copy.fromValue == nil { 152 | copy.fromValue = self.presentationLayer()!.valueForKeyPath(copy.keyPath!) 153 | } 154 | 155 | self.addAnimation(copy, forKey: copy.keyPath) 156 | self.setValue(copy.toValue, forKeyPath:copy.keyPath!) 157 | } 158 | } --------------------------------------------------------------------------------