├── .DS_Store ├── .gitignore ├── GooeyTabbar.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── GooeyTabbar ├── .DS_Store ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Classes │ ├── AnimatedButton.swift │ └── TabbarMenu.swift ├── Info.plist ├── ViewController.swift └── placeholder.jpg ├── GooeyTabbarTests ├── GooeyTabbarTests.swift └── Info.plist ├── GooeyTabbarUITests ├── GooeyTabbarUITests.swift └── Info.plist ├── LICENSE ├── README.md ├── gooeyTabbar.gif └── gooeyTabbar_Temple.gif /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/GooeyTabbar/4b200e1281ff9d5a2b0e1a6c08e11faf48d17efc/.DS_Store -------------------------------------------------------------------------------- /.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 | 28 | # Carthage 29 | # 30 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 31 | # Carthage/Checkouts 32 | 33 | Carthage/Build 34 | -------------------------------------------------------------------------------- /GooeyTabbar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5FC1B6D21F0B5E5B0074BF92 /* placeholder.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 5FC1B6D11F0B5E5B0074BF92 /* placeholder.jpg */; }; 11 | 94E12C1F1BF97E8F00DA2010 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E12C1E1BF97E8F00DA2010 /* AppDelegate.swift */; }; 12 | 94E12C211BF97E8F00DA2010 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E12C201BF97E8F00DA2010 /* ViewController.swift */; }; 13 | 94E12C241BF97E8F00DA2010 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94E12C221BF97E8F00DA2010 /* Main.storyboard */; }; 14 | 94E12C261BF97E8F00DA2010 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 94E12C251BF97E8F00DA2010 /* Assets.xcassets */; }; 15 | 94E12C291BF97E8F00DA2010 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94E12C271BF97E8F00DA2010 /* LaunchScreen.storyboard */; }; 16 | 94E12C341BF97E8F00DA2010 /* GooeyTabbarTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E12C331BF97E8F00DA2010 /* GooeyTabbarTests.swift */; }; 17 | 94E12C3F1BF97E8F00DA2010 /* GooeyTabbarUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E12C3E1BF97E8F00DA2010 /* GooeyTabbarUITests.swift */; }; 18 | 94E12C4D1BF9A8E500DA2010 /* TabbarMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E12C4C1BF9A8E500DA2010 /* TabbarMenu.swift */; }; 19 | 94E12C4F1BF9FBA000DA2010 /* AnimatedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E12C4E1BF9FBA000DA2010 /* AnimatedButton.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 94E12C301BF97E8F00DA2010 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 94E12C131BF97E8F00DA2010 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 94E12C1A1BF97E8F00DA2010; 28 | remoteInfo = GooeyTabbar; 29 | }; 30 | 94E12C3B1BF97E8F00DA2010 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 94E12C131BF97E8F00DA2010 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 94E12C1A1BF97E8F00DA2010; 35 | remoteInfo = GooeyTabbar; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 5FC1B6D11F0B5E5B0074BF92 /* placeholder.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = placeholder.jpg; sourceTree = ""; }; 41 | 94E12C1B1BF97E8F00DA2010 /* GooeyTabbar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GooeyTabbar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 94E12C1E1BF97E8F00DA2010 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 43 | 94E12C201BF97E8F00DA2010 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 44 | 94E12C231BF97E8F00DA2010 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 94E12C251BF97E8F00DA2010 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 94E12C281BF97E8F00DA2010 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 94E12C2A1BF97E8F00DA2010 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 94E12C2F1BF97E8F00DA2010 /* GooeyTabbarTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GooeyTabbarTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 94E12C331BF97E8F00DA2010 /* GooeyTabbarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GooeyTabbarTests.swift; sourceTree = ""; }; 50 | 94E12C351BF97E8F00DA2010 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 94E12C3A1BF97E8F00DA2010 /* GooeyTabbarUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GooeyTabbarUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 94E12C3E1BF97E8F00DA2010 /* GooeyTabbarUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GooeyTabbarUITests.swift; sourceTree = ""; }; 53 | 94E12C401BF97E8F00DA2010 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 94E12C4C1BF9A8E500DA2010 /* TabbarMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TabbarMenu.swift; path = Classes/TabbarMenu.swift; sourceTree = ""; }; 55 | 94E12C4E1BF9FBA000DA2010 /* AnimatedButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AnimatedButton.swift; path = Classes/AnimatedButton.swift; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 94E12C181BF97E8F00DA2010 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | 94E12C2C1BF97E8F00DA2010 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 94E12C371BF97E8F00DA2010 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 94E12C121BF97E8F00DA2010 = { 84 | isa = PBXGroup; 85 | children = ( 86 | 94E12C1D1BF97E8F00DA2010 /* GooeyTabbar */, 87 | 94E12C321BF97E8F00DA2010 /* GooeyTabbarTests */, 88 | 94E12C3D1BF97E8F00DA2010 /* GooeyTabbarUITests */, 89 | 94E12C1C1BF97E8F00DA2010 /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 94E12C1C1BF97E8F00DA2010 /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 94E12C1B1BF97E8F00DA2010 /* GooeyTabbar.app */, 97 | 94E12C2F1BF97E8F00DA2010 /* GooeyTabbarTests.xctest */, 98 | 94E12C3A1BF97E8F00DA2010 /* GooeyTabbarUITests.xctest */, 99 | ); 100 | name = Products; 101 | sourceTree = ""; 102 | }; 103 | 94E12C1D1BF97E8F00DA2010 /* GooeyTabbar */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 5FC1B6D11F0B5E5B0074BF92 /* placeholder.jpg */, 107 | 94E12C1E1BF97E8F00DA2010 /* AppDelegate.swift */, 108 | 94E12C201BF97E8F00DA2010 /* ViewController.swift */, 109 | 94E12C4C1BF9A8E500DA2010 /* TabbarMenu.swift */, 110 | 94E12C4E1BF9FBA000DA2010 /* AnimatedButton.swift */, 111 | 94E12C221BF97E8F00DA2010 /* Main.storyboard */, 112 | 94E12C251BF97E8F00DA2010 /* Assets.xcassets */, 113 | 94E12C271BF97E8F00DA2010 /* LaunchScreen.storyboard */, 114 | 94E12C2A1BF97E8F00DA2010 /* Info.plist */, 115 | ); 116 | path = GooeyTabbar; 117 | sourceTree = ""; 118 | }; 119 | 94E12C321BF97E8F00DA2010 /* GooeyTabbarTests */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 94E12C331BF97E8F00DA2010 /* GooeyTabbarTests.swift */, 123 | 94E12C351BF97E8F00DA2010 /* Info.plist */, 124 | ); 125 | path = GooeyTabbarTests; 126 | sourceTree = ""; 127 | }; 128 | 94E12C3D1BF97E8F00DA2010 /* GooeyTabbarUITests */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 94E12C3E1BF97E8F00DA2010 /* GooeyTabbarUITests.swift */, 132 | 94E12C401BF97E8F00DA2010 /* Info.plist */, 133 | ); 134 | path = GooeyTabbarUITests; 135 | sourceTree = ""; 136 | }; 137 | /* End PBXGroup section */ 138 | 139 | /* Begin PBXNativeTarget section */ 140 | 94E12C1A1BF97E8F00DA2010 /* GooeyTabbar */ = { 141 | isa = PBXNativeTarget; 142 | buildConfigurationList = 94E12C431BF97E8F00DA2010 /* Build configuration list for PBXNativeTarget "GooeyTabbar" */; 143 | buildPhases = ( 144 | 94E12C171BF97E8F00DA2010 /* Sources */, 145 | 94E12C181BF97E8F00DA2010 /* Frameworks */, 146 | 94E12C191BF97E8F00DA2010 /* Resources */, 147 | ); 148 | buildRules = ( 149 | ); 150 | dependencies = ( 151 | ); 152 | name = GooeyTabbar; 153 | productName = GooeyTabbar; 154 | productReference = 94E12C1B1BF97E8F00DA2010 /* GooeyTabbar.app */; 155 | productType = "com.apple.product-type.application"; 156 | }; 157 | 94E12C2E1BF97E8F00DA2010 /* GooeyTabbarTests */ = { 158 | isa = PBXNativeTarget; 159 | buildConfigurationList = 94E12C461BF97E8F00DA2010 /* Build configuration list for PBXNativeTarget "GooeyTabbarTests" */; 160 | buildPhases = ( 161 | 94E12C2B1BF97E8F00DA2010 /* Sources */, 162 | 94E12C2C1BF97E8F00DA2010 /* Frameworks */, 163 | 94E12C2D1BF97E8F00DA2010 /* Resources */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | 94E12C311BF97E8F00DA2010 /* PBXTargetDependency */, 169 | ); 170 | name = GooeyTabbarTests; 171 | productName = GooeyTabbarTests; 172 | productReference = 94E12C2F1BF97E8F00DA2010 /* GooeyTabbarTests.xctest */; 173 | productType = "com.apple.product-type.bundle.unit-test"; 174 | }; 175 | 94E12C391BF97E8F00DA2010 /* GooeyTabbarUITests */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 94E12C491BF97E8F00DA2010 /* Build configuration list for PBXNativeTarget "GooeyTabbarUITests" */; 178 | buildPhases = ( 179 | 94E12C361BF97E8F00DA2010 /* Sources */, 180 | 94E12C371BF97E8F00DA2010 /* Frameworks */, 181 | 94E12C381BF97E8F00DA2010 /* Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | 94E12C3C1BF97E8F00DA2010 /* PBXTargetDependency */, 187 | ); 188 | name = GooeyTabbarUITests; 189 | productName = GooeyTabbarUITests; 190 | productReference = 94E12C3A1BF97E8F00DA2010 /* GooeyTabbarUITests.xctest */; 191 | productType = "com.apple.product-type.bundle.ui-testing"; 192 | }; 193 | /* End PBXNativeTarget section */ 194 | 195 | /* Begin PBXProject section */ 196 | 94E12C131BF97E8F00DA2010 /* Project object */ = { 197 | isa = PBXProject; 198 | attributes = { 199 | LastSwiftUpdateCheck = 0710; 200 | LastUpgradeCheck = 0710; 201 | ORGANIZATIONNAME = KittenYang; 202 | TargetAttributes = { 203 | 94E12C1A1BF97E8F00DA2010 = { 204 | CreatedOnToolsVersion = 7.1.1; 205 | LastSwiftMigration = 0810; 206 | }; 207 | 94E12C2E1BF97E8F00DA2010 = { 208 | CreatedOnToolsVersion = 7.1.1; 209 | LastSwiftMigration = 0810; 210 | TestTargetID = 94E12C1A1BF97E8F00DA2010; 211 | }; 212 | 94E12C391BF97E8F00DA2010 = { 213 | CreatedOnToolsVersion = 7.1.1; 214 | LastSwiftMigration = 0810; 215 | TestTargetID = 94E12C1A1BF97E8F00DA2010; 216 | }; 217 | }; 218 | }; 219 | buildConfigurationList = 94E12C161BF97E8F00DA2010 /* Build configuration list for PBXProject "GooeyTabbar" */; 220 | compatibilityVersion = "Xcode 3.2"; 221 | developmentRegion = English; 222 | hasScannedForEncodings = 0; 223 | knownRegions = ( 224 | en, 225 | Base, 226 | ); 227 | mainGroup = 94E12C121BF97E8F00DA2010; 228 | productRefGroup = 94E12C1C1BF97E8F00DA2010 /* Products */; 229 | projectDirPath = ""; 230 | projectRoot = ""; 231 | targets = ( 232 | 94E12C1A1BF97E8F00DA2010 /* GooeyTabbar */, 233 | 94E12C2E1BF97E8F00DA2010 /* GooeyTabbarTests */, 234 | 94E12C391BF97E8F00DA2010 /* GooeyTabbarUITests */, 235 | ); 236 | }; 237 | /* End PBXProject section */ 238 | 239 | /* Begin PBXResourcesBuildPhase section */ 240 | 94E12C191BF97E8F00DA2010 /* Resources */ = { 241 | isa = PBXResourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | 94E12C291BF97E8F00DA2010 /* LaunchScreen.storyboard in Resources */, 245 | 5FC1B6D21F0B5E5B0074BF92 /* placeholder.jpg in Resources */, 246 | 94E12C261BF97E8F00DA2010 /* Assets.xcassets in Resources */, 247 | 94E12C241BF97E8F00DA2010 /* Main.storyboard in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | 94E12C2D1BF97E8F00DA2010 /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | 94E12C381BF97E8F00DA2010 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXResourcesBuildPhase section */ 266 | 267 | /* Begin PBXSourcesBuildPhase section */ 268 | 94E12C171BF97E8F00DA2010 /* Sources */ = { 269 | isa = PBXSourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | 94E12C211BF97E8F00DA2010 /* ViewController.swift in Sources */, 273 | 94E12C1F1BF97E8F00DA2010 /* AppDelegate.swift in Sources */, 274 | 94E12C4F1BF9FBA000DA2010 /* AnimatedButton.swift in Sources */, 275 | 94E12C4D1BF9A8E500DA2010 /* TabbarMenu.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 94E12C2B1BF97E8F00DA2010 /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 94E12C341BF97E8F00DA2010 /* GooeyTabbarTests.swift in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | 94E12C361BF97E8F00DA2010 /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 94E12C3F1BF97E8F00DA2010 /* GooeyTabbarUITests.swift in Sources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | /* End PBXSourcesBuildPhase section */ 296 | 297 | /* Begin PBXTargetDependency section */ 298 | 94E12C311BF97E8F00DA2010 /* PBXTargetDependency */ = { 299 | isa = PBXTargetDependency; 300 | target = 94E12C1A1BF97E8F00DA2010 /* GooeyTabbar */; 301 | targetProxy = 94E12C301BF97E8F00DA2010 /* PBXContainerItemProxy */; 302 | }; 303 | 94E12C3C1BF97E8F00DA2010 /* PBXTargetDependency */ = { 304 | isa = PBXTargetDependency; 305 | target = 94E12C1A1BF97E8F00DA2010 /* GooeyTabbar */; 306 | targetProxy = 94E12C3B1BF97E8F00DA2010 /* PBXContainerItemProxy */; 307 | }; 308 | /* End PBXTargetDependency section */ 309 | 310 | /* Begin PBXVariantGroup section */ 311 | 94E12C221BF97E8F00DA2010 /* Main.storyboard */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | 94E12C231BF97E8F00DA2010 /* Base */, 315 | ); 316 | name = Main.storyboard; 317 | sourceTree = ""; 318 | }; 319 | 94E12C271BF97E8F00DA2010 /* LaunchScreen.storyboard */ = { 320 | isa = PBXVariantGroup; 321 | children = ( 322 | 94E12C281BF97E8F00DA2010 /* Base */, 323 | ); 324 | name = LaunchScreen.storyboard; 325 | sourceTree = ""; 326 | }; 327 | /* End PBXVariantGroup section */ 328 | 329 | /* Begin XCBuildConfiguration section */ 330 | 94E12C411BF97E8F00DA2010 /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = dwarf; 350 | ENABLE_STRICT_OBJC_MSGSEND = YES; 351 | ENABLE_TESTABILITY = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_DYNAMIC_NO_PIC = NO; 354 | GCC_NO_COMMON_BLOCKS = YES; 355 | GCC_OPTIMIZATION_LEVEL = 0; 356 | GCC_PREPROCESSOR_DEFINITIONS = ( 357 | "DEBUG=1", 358 | "$(inherited)", 359 | ); 360 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 361 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 362 | GCC_WARN_UNDECLARED_SELECTOR = YES; 363 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 364 | GCC_WARN_UNUSED_FUNCTION = YES; 365 | GCC_WARN_UNUSED_VARIABLE = YES; 366 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 367 | MTL_ENABLE_DEBUG_INFO = YES; 368 | ONLY_ACTIVE_ARCH = YES; 369 | SDKROOT = iphoneos; 370 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 371 | TARGETED_DEVICE_FAMILY = "1,2"; 372 | }; 373 | name = Debug; 374 | }; 375 | 94E12C421BF97E8F00DA2010 /* Release */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | ALWAYS_SEARCH_USER_PATHS = NO; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BOOL_CONVERSION = YES; 384 | CLANG_WARN_CONSTANT_CONVERSION = YES; 385 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 386 | CLANG_WARN_EMPTY_BODY = YES; 387 | CLANG_WARN_ENUM_CONVERSION = YES; 388 | CLANG_WARN_INT_CONVERSION = YES; 389 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 390 | CLANG_WARN_UNREACHABLE_CODE = YES; 391 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 392 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 393 | COPY_PHASE_STRIP = NO; 394 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 395 | ENABLE_NS_ASSERTIONS = NO; 396 | ENABLE_STRICT_OBJC_MSGSEND = YES; 397 | GCC_C_LANGUAGE_STANDARD = gnu99; 398 | GCC_NO_COMMON_BLOCKS = YES; 399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 401 | GCC_WARN_UNDECLARED_SELECTOR = YES; 402 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 403 | GCC_WARN_UNUSED_FUNCTION = YES; 404 | GCC_WARN_UNUSED_VARIABLE = YES; 405 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 406 | MTL_ENABLE_DEBUG_INFO = NO; 407 | SDKROOT = iphoneos; 408 | TARGETED_DEVICE_FAMILY = "1,2"; 409 | VALIDATE_PRODUCT = YES; 410 | }; 411 | name = Release; 412 | }; 413 | 94E12C441BF97E8F00DA2010 /* Debug */ = { 414 | isa = XCBuildConfiguration; 415 | buildSettings = { 416 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 417 | INFOPLIST_FILE = GooeyTabbar/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 419 | PRODUCT_BUNDLE_IDENTIFIER = com.kittenyang.GooeyTabbar; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | SWIFT_VERSION = 3.0; 422 | }; 423 | name = Debug; 424 | }; 425 | 94E12C451BF97E8F00DA2010 /* Release */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 429 | INFOPLIST_FILE = GooeyTabbar/Info.plist; 430 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 431 | PRODUCT_BUNDLE_IDENTIFIER = com.kittenyang.GooeyTabbar; 432 | PRODUCT_NAME = "$(TARGET_NAME)"; 433 | SWIFT_VERSION = 3.0; 434 | }; 435 | name = Release; 436 | }; 437 | 94E12C471BF97E8F00DA2010 /* Debug */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | BUNDLE_LOADER = "$(TEST_HOST)"; 441 | INFOPLIST_FILE = GooeyTabbarTests/Info.plist; 442 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 443 | PRODUCT_BUNDLE_IDENTIFIER = com.kittenyang.GooeyTabbarTests; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | SWIFT_VERSION = 3.0; 446 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GooeyTabbar.app/GooeyTabbar"; 447 | }; 448 | name = Debug; 449 | }; 450 | 94E12C481BF97E8F00DA2010 /* Release */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | BUNDLE_LOADER = "$(TEST_HOST)"; 454 | INFOPLIST_FILE = GooeyTabbarTests/Info.plist; 455 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 456 | PRODUCT_BUNDLE_IDENTIFIER = com.kittenyang.GooeyTabbarTests; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | SWIFT_VERSION = 3.0; 459 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GooeyTabbar.app/GooeyTabbar"; 460 | }; 461 | name = Release; 462 | }; 463 | 94E12C4A1BF97E8F00DA2010 /* Debug */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | INFOPLIST_FILE = GooeyTabbarUITests/Info.plist; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 468 | PRODUCT_BUNDLE_IDENTIFIER = com.kittenyang.GooeyTabbarUITests; 469 | PRODUCT_NAME = "$(TARGET_NAME)"; 470 | SWIFT_VERSION = 3.0; 471 | TEST_TARGET_NAME = GooeyTabbar; 472 | USES_XCTRUNNER = YES; 473 | }; 474 | name = Debug; 475 | }; 476 | 94E12C4B1BF97E8F00DA2010 /* Release */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | INFOPLIST_FILE = GooeyTabbarUITests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = com.kittenyang.GooeyTabbarUITests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | SWIFT_VERSION = 3.0; 484 | TEST_TARGET_NAME = GooeyTabbar; 485 | USES_XCTRUNNER = YES; 486 | }; 487 | name = Release; 488 | }; 489 | /* End XCBuildConfiguration section */ 490 | 491 | /* Begin XCConfigurationList section */ 492 | 94E12C161BF97E8F00DA2010 /* Build configuration list for PBXProject "GooeyTabbar" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 94E12C411BF97E8F00DA2010 /* Debug */, 496 | 94E12C421BF97E8F00DA2010 /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | 94E12C431BF97E8F00DA2010 /* Build configuration list for PBXNativeTarget "GooeyTabbar" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | 94E12C441BF97E8F00DA2010 /* Debug */, 505 | 94E12C451BF97E8F00DA2010 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | 94E12C461BF97E8F00DA2010 /* Build configuration list for PBXNativeTarget "GooeyTabbarTests" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | 94E12C471BF97E8F00DA2010 /* Debug */, 514 | 94E12C481BF97E8F00DA2010 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | 94E12C491BF97E8F00DA2010 /* Build configuration list for PBXNativeTarget "GooeyTabbarUITests" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | 94E12C4A1BF97E8F00DA2010 /* Debug */, 523 | 94E12C4B1BF97E8F00DA2010 /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | defaultConfigurationName = Release; 527 | }; 528 | /* End XCConfigurationList section */ 529 | }; 530 | rootObject = 94E12C131BF97E8F00DA2010 /* Project object */; 531 | } 532 | -------------------------------------------------------------------------------- /GooeyTabbar.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GooeyTabbar/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/GooeyTabbar/4b200e1281ff9d5a2b0e1a6c08e11faf48d17efc/GooeyTabbar/.DS_Store -------------------------------------------------------------------------------- /GooeyTabbar/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // GooeyTabbar 4 | // 5 | // Created by KittenYang on 11/16/15. 6 | // Copyright © 2015 KittenYang. 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: [UIApplicationLaunchOptionsKey: Any]?) -> 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 | -------------------------------------------------------------------------------- /GooeyTabbar/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /GooeyTabbar/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 | -------------------------------------------------------------------------------- /GooeyTabbar/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GooeyTabbar/Classes/AnimatedButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnimatedButton.swift 3 | // GooeyTabbar 4 | // 5 | // Created by KittenYang on 11/16/15. 6 | // Copyright © 2015 KittenYang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AnimatedButton: UIButton { 12 | /// 按钮的回调 13 | var didTapped : ((_ button:UIButton)->())? 14 | 15 | fileprivate var firstLine : CALayer! 16 | 17 | fileprivate var secondLine : CALayer! 18 | 19 | /// 是否正在动画中 20 | var animating : Bool = false 21 | 22 | /// 是否打开 23 | var opened : Bool = false 24 | 25 | override init(frame: CGRect) { 26 | super.init(frame: frame) 27 | setUpLines() 28 | } 29 | 30 | 31 | required init?(coder aDecoder: NSCoder) { 32 | fatalError("init(coder:) has not been implemented") 33 | } 34 | 35 | fileprivate func setUpLines() { 36 | firstLine = CALayer() 37 | firstLine.position = CGPoint(x: self.frame.width / 2, y: self.frame.height / 2 - 5) 38 | firstLine.bounds = CGRect(x: 0, y: 0, width: self.frame.width/2, height: 3) 39 | setLineSetting(firstLine) 40 | self.layer.addSublayer(firstLine) 41 | 42 | secondLine = CALayer() 43 | secondLine.position = CGPoint(x: self.frame.width / 2, y: self.frame.height / 2 + 5) 44 | secondLine.bounds = CGRect(x: 0, y: 0, width: self.frame.width/2, height: 3) 45 | setLineSetting(secondLine) 46 | self.layer.addSublayer(secondLine) 47 | 48 | self.addTarget(self, action: #selector(AnimatedButton.animate(_:)), for: .touchUpInside) 49 | } 50 | 51 | 52 | fileprivate func setLineSetting(_ line:CALayer) { 53 | line.backgroundColor = UIColor.white.cgColor 54 | line.cornerRadius = line.frame.height / 2 55 | } 56 | 57 | func switchToOpenMode() { 58 | if !self.opened { 59 | animation() 60 | } 61 | } 62 | 63 | func switchToCloseMode() { 64 | if self.opened { 65 | animation() 66 | } 67 | } 68 | 69 | @objc fileprivate func animate(_ button: UIButton) { 70 | animation() 71 | didTapped?(self) 72 | } 73 | 74 | fileprivate func animation() { 75 | animating = true 76 | if !opened { 77 | opened = true 78 | let moveUp = CABasicAnimation(keyPath: "transform.translation.y") 79 | moveUp.duration = 0.3 80 | moveUp.delegate = self 81 | moveUp.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) 82 | moveUp.toValue = -5.0 83 | moveUp.fillMode = kCAFillModeForwards 84 | moveUp.isRemovedOnCompletion = false 85 | secondLine.add(moveUp, forKey: "moveUp_2") 86 | 87 | let moveDown = CABasicAnimation(keyPath: "transform.translation.y") 88 | moveDown.duration = 0.3 89 | moveDown.delegate = self 90 | moveDown.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) 91 | moveDown.toValue = 5.0 92 | moveDown.fillMode = kCAFillModeForwards 93 | moveDown.isRemovedOnCompletion = false 94 | firstLine.add(moveDown, forKey: "moveDown_1") 95 | 96 | } else { 97 | opened = false 98 | 99 | let rotation_second = CAKeyframeAnimation(keyPath: "transform.rotation.z") 100 | rotation_second.duration = 0.3 101 | rotation_second.values = [45 * (CGFloat.pi/180),70 * (CGFloat.pi/180),0] 102 | rotation_second.keyTimes = [0.0,0.4,1.0] 103 | rotation_second.fillMode = kCAFillModeForwards 104 | rotation_second.isRemovedOnCompletion = false 105 | rotation_second.delegate = self 106 | secondLine.add(rotation_second, forKey: "rotation_second_close") 107 | 108 | let rotation_first = CAKeyframeAnimation(keyPath: "transform.rotation.z") 109 | rotation_first.duration = 0.4 110 | rotation_first.values = [135 * (CGFloat.pi/180),170 * (CGFloat.pi/180),0] 111 | rotation_first.keyTimes = [0.0,0.4,1.0] 112 | rotation_first.fillMode = kCAFillModeForwards 113 | rotation_first.isRemovedOnCompletion = false 114 | rotation_first.delegate = self 115 | firstLine.add(rotation_first, forKey: "rotation_first_close") 116 | } 117 | } 118 | 119 | } 120 | 121 | 122 | extension AnimatedButton: CAAnimationDelegate { 123 | 124 | func animationDidStart(_ anim: CAAnimation) { 125 | 126 | } 127 | 128 | func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 129 | if anim == secondLine.animation(forKey: "moveUp_2") { 130 | let rotation_second = CAKeyframeAnimation(keyPath: "transform.rotation.z") 131 | rotation_second.duration = 0.5 132 | rotation_second.values = [0,70 * (CGFloat.pi/180),45 * (CGFloat.pi/180)] 133 | rotation_second.keyTimes = [0.0,0.6,1.0] 134 | rotation_second.fillMode = kCAFillModeForwards 135 | rotation_second.isRemovedOnCompletion = false 136 | secondLine.add(rotation_second, forKey: "rotation_second_open") 137 | }else if anim == firstLine.animation(forKey: "moveDown_1") { 138 | let rotation_first = CAKeyframeAnimation(keyPath: "transform.rotation.z") 139 | rotation_first.duration = 0.6 140 | rotation_first.values = [0,170 * (CGFloat.pi/180),135 * (CGFloat.pi/180)] 141 | rotation_first.keyTimes = [0.0,0.6,1.0] 142 | rotation_first.fillMode = kCAFillModeForwards 143 | rotation_first.isRemovedOnCompletion = false 144 | rotation_first.delegate = self 145 | firstLine.add(rotation_first, forKey: "rotation_first_open") 146 | }else if anim == secondLine.animation(forKey: "rotation_second_close") { 147 | let moveUp = CABasicAnimation(keyPath: "transform.translation.y") 148 | moveUp.duration = 0.2 149 | moveUp.delegate = self 150 | moveUp.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) 151 | moveUp.toValue = 0.0 152 | moveUp.fillMode = kCAFillModeForwards 153 | moveUp.isRemovedOnCompletion = false 154 | secondLine.add(moveUp, forKey: "moveDown_2") 155 | }else if anim == firstLine.animation(forKey: "rotation_first_close") { 156 | let moveDown = CABasicAnimation(keyPath: "transform.translation.y") 157 | moveDown.duration = 0.2 158 | moveDown.delegate = self 159 | moveDown.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) 160 | moveDown.toValue = 0.0 161 | moveDown.fillMode = kCAFillModeForwards 162 | moveDown.isRemovedOnCompletion = false 163 | firstLine.add(moveDown, forKey: "moveUp_1") 164 | } 165 | 166 | if anim == firstLine.animation(forKey: "rotation_first_open") || anim == firstLine.animation(forKey: "moveUp_1"){ 167 | animating = false 168 | } 169 | } 170 | 171 | } 172 | -------------------------------------------------------------------------------- /GooeyTabbar/Classes/TabbarMenu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TabbarMenu.swift 3 | // GooeyTabbar 4 | // 5 | // Created by KittenYang on 11/16/15. 6 | // Copyright © 2015 KittenYang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | enum MenuTextureType { 12 | case withColor(color: UIColor) 13 | case withBlur(blurStyle: UIBlurEffectStyle) 14 | } 15 | 16 | class TabbarMenu: UIView { 17 | 18 | /// 是否打开 19 | var opened : Bool = false 20 | 21 | fileprivate var normalRect : UIView! 22 | fileprivate var springRect : UIView! 23 | fileprivate var keyWindow : UIWindow! 24 | fileprivate weak var backDimmingView: UIVisualEffectView! 25 | fileprivate var displayLink : CADisplayLink! 26 | fileprivate var animationCount : Int = 0 27 | fileprivate var diff : CGFloat = 0 28 | fileprivate var terminalFrame : CGRect? 29 | fileprivate var initialFrame : CGRect? 30 | fileprivate var animateButton : AnimatedButton? 31 | fileprivate var bouncyMask: CAShapeLayer? 32 | fileprivate var textureType: MenuTextureType = .withColor(color: UIColor(colorLiteralRed: 50/255.0, green: 58/255.0, blue: 68/255.0, alpha: 1.0)) 33 | 34 | var topSpace : CGFloat = 64.0 //留白 35 | fileprivate var tabbarheight : CGFloat = 0.0 //tabbar高度 36 | 37 | init(texture: MenuTextureType, tabbarHeight : CGFloat, toTop: CGFloat) 38 | { 39 | textureType = texture 40 | topSpace = toTop 41 | tabbarheight = tabbarHeight 42 | terminalFrame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height) 43 | initialFrame = CGRect(x: 0, y: UIScreen.main.bounds.height - tabbarHeight - topSpace, width: terminalFrame!.width, height: terminalFrame!.height) 44 | super.init(frame: initialFrame!) 45 | setUpViews() 46 | } 47 | 48 | required init?(coder aDecoder: NSCoder) { 49 | fatalError("init(coder:) has not been implemented") 50 | } 51 | 52 | fileprivate func updateMask() { 53 | let path = UIBezierPath() 54 | path.move(to: CGPoint(x: 0, y: self.frame.height)) 55 | path.addLine(to: CGPoint(x: self.frame.width, y: self.frame.height)) 56 | path.addLine(to: CGPoint(x: self.frame.width, y: topSpace)) 57 | path.addQuadCurve(to: CGPoint(x: 0, y: topSpace), controlPoint: CGPoint(x: self.frame.width/2, y: topSpace-diff)) 58 | path.close() 59 | 60 | bouncyMask?.path = path.cgPath 61 | } 62 | 63 | fileprivate func setUpViews() 64 | { 65 | keyWindow = UIApplication.shared.keyWindow 66 | 67 | let dimmingView = UIVisualEffectView(effect: UIBlurEffect(style: .light)) 68 | dimmingView.frame = self.bounds 69 | dimmingView.alpha = 0.0 70 | keyWindow.addSubview(dimmingView) 71 | backDimmingView = dimmingView 72 | 73 | switch textureType { 74 | case .withBlur(let blurStyle): 75 | self.backgroundColor = UIColor.clear 76 | let backgroundBlurView = UIVisualEffectView(effect: UIBlurEffect(style: blurStyle)) 77 | backgroundBlurView.frame = self.bounds 78 | addSubview(backgroundBlurView) 79 | var dimmingStyle: UIBlurEffectStyle 80 | switch blurStyle { 81 | case .dark: 82 | dimmingStyle = .light 83 | default: 84 | dimmingStyle = .dark 85 | } 86 | backDimmingView.effect = UIBlurEffect(style: dimmingStyle) 87 | case .withColor(let color): 88 | self.backgroundColor = color 89 | } 90 | 91 | bouncyMask = CAShapeLayer() 92 | bouncyMask?.frame = bounds 93 | layer.mask = bouncyMask 94 | updateMask() 95 | keyWindow.addSubview(self) 96 | 97 | normalRect = UIView(frame: CGRect(x: 0, y: UIScreen.main.bounds.size.height - 30 - 50, width: 30, height: 30)) 98 | normalRect.backgroundColor = UIColor.blue 99 | normalRect.isHidden = true 100 | keyWindow.addSubview(normalRect) 101 | 102 | springRect = UIView(frame: CGRect(x: UIScreen.main.bounds.size.width/2 - 30/2, y: normalRect.frame.origin.y, width: 30, height: 30)) 103 | springRect.backgroundColor = UIColor.yellow 104 | springRect.isHidden = true 105 | keyWindow.addSubview(springRect) 106 | 107 | animateButton = AnimatedButton(frame: CGRect(x: 0, y: topSpace + max(5, (tabbarheight - 30)/2), width: 50, height: 30)) 108 | self.addSubview(animateButton!) 109 | animateButton!.didTapped = { [weak self] (button) -> () in 110 | if let strongSelf = self { 111 | strongSelf.triggerAction() 112 | } 113 | } 114 | 115 | } 116 | 117 | func triggerAction() 118 | { 119 | /** 120 | * 展开 121 | */ 122 | if !opened { 123 | animateButton!.switchToOpenMode() 124 | opened = true 125 | animationWillBegin() 126 | UIView.animate(withDuration: 0.3, delay: 0.0, options: .curveEaseOut, animations: { () -> Void in 127 | self.springRect.center = CGPoint(x: self.springRect.center.x, y: self.springRect.center.y - 40) 128 | }) { (finish) -> Void in 129 | UIView.animate(withDuration: 0.3, delay: 0.0, options: .curveEaseOut, animations: { () -> Void in 130 | self.normalRect.center = CGPoint(x: self.normalRect.center.x, y: 100) 131 | self.backDimmingView.alpha = 1.0 132 | }, completion: nil) 133 | 134 | UIView.animate(withDuration: 1.0, delay: 0.0, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.0, options: .curveEaseOut, animations: { () -> Void in 135 | self.springRect.center = CGPoint(x: self.springRect.center.x, y: 100) 136 | }, completion: { (finish) -> Void in 137 | self.animationDidDone() 138 | }) 139 | } 140 | UIView.animate(withDuration: 0.3, delay: 0.14, options: .curveEaseOut, animations: { () -> Void in 141 | self.frame = self.terminalFrame! 142 | }, completion: nil) 143 | 144 | }else{ 145 | /** 146 | * 收缩 147 | */ 148 | animateButton!.switchToCloseMode() 149 | opened = false 150 | animationWillBegin() 151 | UIView.animate(withDuration: 0.3, delay: 0.0, options: .curveEaseOut, animations: { () -> Void in 152 | self.frame = self.initialFrame! 153 | }, completion: nil) 154 | 155 | UIView.animate(withDuration: 0.3, delay: 0.0, options: .curveEaseOut, animations: { () -> Void in 156 | self.normalRect.center = CGPoint(x: self.normalRect.center.x, y: UIScreen.main.bounds.size.height - 30 - 50) 157 | self.backDimmingView.alpha = 0.0 158 | }, completion: { (finished) in 159 | self.backDimmingView.removeFromSuperview() 160 | }) 161 | 162 | UIView.animate(withDuration: 0.25, delay:0.0, options: .curveEaseOut, animations: { () -> Void in 163 | self.springRect.center = CGPoint(x: self.springRect.center.x, y: UIScreen.main.bounds.size.height - 30 - 50 + 10) 164 | }, completion: { (finish) -> Void in 165 | UIView.animate(withDuration: 0.2, delay: 0.0, options: .curveEaseOut, animations: { () -> Void in 166 | self.springRect.center = CGPoint(x: self.springRect.center.x, y: UIScreen.main.bounds.size.height - 30 - 50 - 40) 167 | }, completion: { (finish) -> Void in 168 | UIView.animate(withDuration: 0.2, delay: 0.0, options: .curveEaseOut, animations: { () -> Void in 169 | self.springRect.center = CGPoint(x: self.springRect.center.x, y: UIScreen.main.bounds.size.height - 30 - 50) 170 | }, completion: { (finish) -> Void in 171 | self.animationDidDone() 172 | // self.removeFromSuperview() 173 | }) 174 | }) 175 | }) 176 | } 177 | } 178 | 179 | 180 | @objc fileprivate func update(_ displayLink: CADisplayLink) 181 | { 182 | let normalRectLayer = normalRect.layer.presentation() 183 | let springRectLayer = springRect.layer.presentation() 184 | 185 | let normalRectFrame = (normalRectLayer!.value(forKey: "frame")! as AnyObject).cgRectValue 186 | let springRectFrame = (springRectLayer!.value(forKey: "frame")! as AnyObject).cgRectValue 187 | 188 | diff = (normalRectFrame?.origin.y)! - (springRectFrame?.origin.y)! 189 | print("=====\(diff)") 190 | 191 | updateMask() 192 | } 193 | 194 | fileprivate func animationWillBegin() 195 | { 196 | if displayLink == nil 197 | { 198 | self.displayLink = CADisplayLink(target: self, selector: #selector(TabbarMenu.update(_:))) 199 | self.displayLink.add(to: RunLoop.main, forMode: RunLoopMode.defaultRunLoopMode) 200 | } 201 | animationCount += 1 202 | } 203 | 204 | fileprivate func animationDidDone() 205 | { 206 | animationCount -= 1 207 | if animationCount == 0 208 | { 209 | displayLink.invalidate() 210 | displayLink = nil 211 | } 212 | } 213 | 214 | 215 | } 216 | -------------------------------------------------------------------------------- /GooeyTabbar/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /GooeyTabbar/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // GooeyTabbar 4 | // 5 | // Created by KittenYang on 11/16/15. 6 | // Copyright © 2015 KittenYang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | var menu : TabbarMenu! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | } 18 | 19 | override func viewDidAppear(_ animated: Bool) { 20 | menu = TabbarMenu(texture: .withBlur(blurStyle: .dark) ,tabbarHeight: 40.0, toTop: 200) 21 | } 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /GooeyTabbar/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/GooeyTabbar/4b200e1281ff9d5a2b0e1a6c08e11faf48d17efc/GooeyTabbar/placeholder.jpg -------------------------------------------------------------------------------- /GooeyTabbarTests/GooeyTabbarTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GooeyTabbarTests.swift 3 | // GooeyTabbarTests 4 | // 5 | // Created by KittenYang on 11/16/15. 6 | // Copyright © 2015 KittenYang. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import GooeyTabbar 11 | 12 | class GooeyTabbarTests: 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.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /GooeyTabbarTests/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 | -------------------------------------------------------------------------------- /GooeyTabbarUITests/GooeyTabbarUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GooeyTabbarUITests.swift 3 | // GooeyTabbarUITests 4 | // 5 | // Created by KittenYang on 11/16/15. 6 | // Copyright © 2015 KittenYang. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class GooeyTabbarUITests: 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 | -------------------------------------------------------------------------------- /GooeyTabbarUITests/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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Qitao Yang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GooeyTabbar 2 | A gooey effect tabbar 3 | 4 | Dribbble version: 5 | 6 | ![](gooeyTabbar_Temple.gif) 7 | 8 | Code version: 9 | 10 | ![](gooeyTabbar.gif) 11 | 12 | 13 | -------------------------------------------------------------------------------- /gooeyTabbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/GooeyTabbar/4b200e1281ff9d5a2b0e1a6c08e11faf48d17efc/gooeyTabbar.gif -------------------------------------------------------------------------------- /gooeyTabbar_Temple.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KittenYang/GooeyTabbar/4b200e1281ff9d5a2b0e1a6c08e11faf48d17efc/gooeyTabbar_Temple.gif --------------------------------------------------------------------------------