├── DGFloldableTabbarControl.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── dip.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── apple.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ └── xcschememanagement.plist │ └── dip.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── DGFloldableTabbarControl ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-57x57@1x.png │ │ ├── Icon-App-57x57@2x.png │ │ ├── Icon-App-60x60@2x.png │ │ └── Icon-App-60x60@3x.png │ ├── Contents.json │ └── ios │ │ ├── Contents.json │ │ ├── bar.imageset │ │ ├── Contents.json │ │ └── bar.png │ │ ├── category.imageset │ │ ├── Contents.json │ │ ├── category.png │ │ ├── category@2x.png │ │ └── category@3x.png │ │ ├── filter.imageset │ │ ├── Contents.json │ │ ├── filter.png │ │ ├── filter@2x.png │ │ └── filter@3x.png │ │ ├── hand.imageset │ │ ├── Contents.json │ │ ├── hand.png │ │ ├── hand@2x.png │ │ └── hand@3x.png │ │ ├── home.imageset │ │ ├── Contents.json │ │ ├── home.png │ │ ├── home@2x.png │ │ └── home@3x.png │ │ ├── my_collection.imageset │ │ ├── Contents.json │ │ ├── my_collection.png │ │ ├── my_collection@2x.png │ │ └── my_collection@3x.png │ │ ├── my_collection_black.imageset │ │ ├── Contents.json │ │ ├── my_collection_black.png │ │ ├── my_collection_black@2x.png │ │ └── my_collection_black@3x.png │ │ ├── my_collection_grey.imageset │ │ ├── Contents.json │ │ ├── my_collection_grey.png │ │ ├── my_collection_grey@2x.png │ │ └── my_collection_grey@3x.png │ │ ├── scroll.imageset │ │ ├── Contents.json │ │ ├── scroll.png │ │ ├── scroll@2x.png │ │ └── scroll@3x.png │ │ └── signout.imageset │ │ ├── Contents.json │ │ ├── signout.png │ │ ├── signout@2x.png │ │ └── signout@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CellCollectionViewCell.swift ├── ContainerVC.swift ├── DGFoldableTabbarControl │ ├── DGFloldableTabbarControl.swift │ └── TabItem.swift ├── Info.plist └── ListVC.swift └── README.md /DGFloldableTabbarControl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1873DD831F5EC74A007D2B40 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1873DD821F5EC74A007D2B40 /* AppDelegate.swift */; }; 11 | 1873DD881F5EC74A007D2B40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1873DD861F5EC74A007D2B40 /* Main.storyboard */; }; 12 | 1873DD8A1F5EC74B007D2B40 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1873DD891F5EC74B007D2B40 /* Assets.xcassets */; }; 13 | 1873DD8D1F5EC74B007D2B40 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1873DD8B1F5EC74B007D2B40 /* LaunchScreen.storyboard */; }; 14 | 1873DD9A1F5EC87F007D2B40 /* ContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1873DD941F5EC87F007D2B40 /* ContainerVC.swift */; }; 15 | 1873DD9B1F5EC87F007D2B40 /* CellCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1873DD951F5EC87F007D2B40 /* CellCollectionViewCell.swift */; }; 16 | 1873DD9C1F5EC87F007D2B40 /* DGFloldableTabbarControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1873DD971F5EC87F007D2B40 /* DGFloldableTabbarControl.swift */; }; 17 | 1873DD9E1F5EC87F007D2B40 /* TabItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1873DD991F5EC87F007D2B40 /* TabItem.swift */; }; 18 | 1873DDA01F5EC901007D2B40 /* ListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1873DD9F1F5EC900007D2B40 /* ListVC.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 1873DD7F1F5EC74A007D2B40 /* DGFloldableTabbarControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DGFloldableTabbarControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 1873DD821F5EC74A007D2B40 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 24 | 1873DD871F5EC74A007D2B40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 25 | 1873DD891F5EC74B007D2B40 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 26 | 1873DD8C1F5EC74B007D2B40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 27 | 1873DD8E1F5EC74B007D2B40 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 1873DD941F5EC87F007D2B40 /* ContainerVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerVC.swift; sourceTree = ""; }; 29 | 1873DD951F5EC87F007D2B40 /* CellCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CellCollectionViewCell.swift; sourceTree = ""; }; 30 | 1873DD971F5EC87F007D2B40 /* DGFloldableTabbarControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DGFloldableTabbarControl.swift; sourceTree = ""; }; 31 | 1873DD991F5EC87F007D2B40 /* TabItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabItem.swift; sourceTree = ""; }; 32 | 1873DD9F1F5EC900007D2B40 /* ListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListVC.swift; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 1873DD7C1F5EC74A007D2B40 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 1873DD761F5EC74A007D2B40 = { 47 | isa = PBXGroup; 48 | children = ( 49 | 1873DD811F5EC74A007D2B40 /* DGFloldableTabbarControl */, 50 | 1873DD801F5EC74A007D2B40 /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | 1873DD801F5EC74A007D2B40 /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 1873DD7F1F5EC74A007D2B40 /* DGFloldableTabbarControl.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | 1873DD811F5EC74A007D2B40 /* DGFloldableTabbarControl */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 1873DD961F5EC87F007D2B40 /* DGFoldableTabbarControl */, 66 | 1873DD951F5EC87F007D2B40 /* CellCollectionViewCell.swift */, 67 | 1873DD941F5EC87F007D2B40 /* ContainerVC.swift */, 68 | 1873DD9F1F5EC900007D2B40 /* ListVC.swift */, 69 | 1873DD821F5EC74A007D2B40 /* AppDelegate.swift */, 70 | 1873DD861F5EC74A007D2B40 /* Main.storyboard */, 71 | 1873DD891F5EC74B007D2B40 /* Assets.xcassets */, 72 | 1873DD8B1F5EC74B007D2B40 /* LaunchScreen.storyboard */, 73 | 1873DD8E1F5EC74B007D2B40 /* Info.plist */, 74 | ); 75 | path = DGFloldableTabbarControl; 76 | sourceTree = ""; 77 | }; 78 | 1873DD961F5EC87F007D2B40 /* DGFoldableTabbarControl */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 1873DD971F5EC87F007D2B40 /* DGFloldableTabbarControl.swift */, 82 | 1873DD991F5EC87F007D2B40 /* TabItem.swift */, 83 | ); 84 | path = DGFoldableTabbarControl; 85 | sourceTree = ""; 86 | }; 87 | /* End PBXGroup section */ 88 | 89 | /* Begin PBXNativeTarget section */ 90 | 1873DD7E1F5EC74A007D2B40 /* DGFloldableTabbarControl */ = { 91 | isa = PBXNativeTarget; 92 | buildConfigurationList = 1873DD911F5EC74B007D2B40 /* Build configuration list for PBXNativeTarget "DGFloldableTabbarControl" */; 93 | buildPhases = ( 94 | 1873DD7B1F5EC74A007D2B40 /* Sources */, 95 | 1873DD7C1F5EC74A007D2B40 /* Frameworks */, 96 | 1873DD7D1F5EC74A007D2B40 /* Resources */, 97 | ); 98 | buildRules = ( 99 | ); 100 | dependencies = ( 101 | ); 102 | name = DGFloldableTabbarControl; 103 | productName = DGFloldableTabbarControl; 104 | productReference = 1873DD7F1F5EC74A007D2B40 /* DGFloldableTabbarControl.app */; 105 | productType = "com.apple.product-type.application"; 106 | }; 107 | /* End PBXNativeTarget section */ 108 | 109 | /* Begin PBXProject section */ 110 | 1873DD771F5EC74A007D2B40 /* Project object */ = { 111 | isa = PBXProject; 112 | attributes = { 113 | LastSwiftUpdateCheck = 0900; 114 | LastUpgradeCheck = 0930; 115 | ORGANIZATIONNAME = dip; 116 | TargetAttributes = { 117 | 1873DD7E1F5EC74A007D2B40 = { 118 | CreatedOnToolsVersion = 9.0; 119 | }; 120 | }; 121 | }; 122 | buildConfigurationList = 1873DD7A1F5EC74A007D2B40 /* Build configuration list for PBXProject "DGFloldableTabbarControl" */; 123 | compatibilityVersion = "Xcode 8.0"; 124 | developmentRegion = en; 125 | hasScannedForEncodings = 0; 126 | knownRegions = ( 127 | en, 128 | Base, 129 | ); 130 | mainGroup = 1873DD761F5EC74A007D2B40; 131 | productRefGroup = 1873DD801F5EC74A007D2B40 /* Products */; 132 | projectDirPath = ""; 133 | projectRoot = ""; 134 | targets = ( 135 | 1873DD7E1F5EC74A007D2B40 /* DGFloldableTabbarControl */, 136 | ); 137 | }; 138 | /* End PBXProject section */ 139 | 140 | /* Begin PBXResourcesBuildPhase section */ 141 | 1873DD7D1F5EC74A007D2B40 /* Resources */ = { 142 | isa = PBXResourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | 1873DD8D1F5EC74B007D2B40 /* LaunchScreen.storyboard in Resources */, 146 | 1873DD8A1F5EC74B007D2B40 /* Assets.xcassets in Resources */, 147 | 1873DD881F5EC74A007D2B40 /* Main.storyboard in Resources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXResourcesBuildPhase section */ 152 | 153 | /* Begin PBXSourcesBuildPhase section */ 154 | 1873DD7B1F5EC74A007D2B40 /* Sources */ = { 155 | isa = PBXSourcesBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 1873DDA01F5EC901007D2B40 /* ListVC.swift in Sources */, 159 | 1873DD9B1F5EC87F007D2B40 /* CellCollectionViewCell.swift in Sources */, 160 | 1873DD9A1F5EC87F007D2B40 /* ContainerVC.swift in Sources */, 161 | 1873DD9E1F5EC87F007D2B40 /* TabItem.swift in Sources */, 162 | 1873DD9C1F5EC87F007D2B40 /* DGFloldableTabbarControl.swift in Sources */, 163 | 1873DD831F5EC74A007D2B40 /* AppDelegate.swift in Sources */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXSourcesBuildPhase section */ 168 | 169 | /* Begin PBXVariantGroup section */ 170 | 1873DD861F5EC74A007D2B40 /* Main.storyboard */ = { 171 | isa = PBXVariantGroup; 172 | children = ( 173 | 1873DD871F5EC74A007D2B40 /* Base */, 174 | ); 175 | name = Main.storyboard; 176 | sourceTree = ""; 177 | }; 178 | 1873DD8B1F5EC74B007D2B40 /* LaunchScreen.storyboard */ = { 179 | isa = PBXVariantGroup; 180 | children = ( 181 | 1873DD8C1F5EC74B007D2B40 /* Base */, 182 | ); 183 | name = LaunchScreen.storyboard; 184 | sourceTree = ""; 185 | }; 186 | /* End PBXVariantGroup section */ 187 | 188 | /* Begin XCBuildConfiguration section */ 189 | 1873DD8F1F5EC74B007D2B40 /* Debug */ = { 190 | isa = XCBuildConfiguration; 191 | buildSettings = { 192 | ALWAYS_SEARCH_USER_PATHS = NO; 193 | CLANG_ANALYZER_NONNULL = YES; 194 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 195 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 196 | CLANG_CXX_LIBRARY = "libc++"; 197 | CLANG_ENABLE_MODULES = YES; 198 | CLANG_ENABLE_OBJC_ARC = YES; 199 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 200 | CLANG_WARN_BOOL_CONVERSION = YES; 201 | CLANG_WARN_COMMA = YES; 202 | CLANG_WARN_CONSTANT_CONVERSION = YES; 203 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 204 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 205 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 206 | CLANG_WARN_EMPTY_BODY = YES; 207 | CLANG_WARN_ENUM_CONVERSION = YES; 208 | CLANG_WARN_INFINITE_RECURSION = YES; 209 | CLANG_WARN_INT_CONVERSION = YES; 210 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 211 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 212 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 213 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 214 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 215 | CLANG_WARN_STRICT_PROTOTYPES = YES; 216 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 217 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 218 | CLANG_WARN_UNREACHABLE_CODE = YES; 219 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 220 | CODE_SIGN_IDENTITY = "iPhone Developer"; 221 | COPY_PHASE_STRIP = NO; 222 | DEBUG_INFORMATION_FORMAT = dwarf; 223 | ENABLE_STRICT_OBJC_MSGSEND = YES; 224 | ENABLE_TESTABILITY = YES; 225 | GCC_C_LANGUAGE_STANDARD = gnu11; 226 | GCC_DYNAMIC_NO_PIC = NO; 227 | GCC_NO_COMMON_BLOCKS = YES; 228 | GCC_OPTIMIZATION_LEVEL = 0; 229 | GCC_PREPROCESSOR_DEFINITIONS = ( 230 | "DEBUG=1", 231 | "$(inherited)", 232 | ); 233 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 234 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 235 | GCC_WARN_UNDECLARED_SELECTOR = YES; 236 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 237 | GCC_WARN_UNUSED_FUNCTION = YES; 238 | GCC_WARN_UNUSED_VARIABLE = YES; 239 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 240 | MTL_ENABLE_DEBUG_INFO = YES; 241 | ONLY_ACTIVE_ARCH = YES; 242 | SDKROOT = iphoneos; 243 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 244 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 245 | }; 246 | name = Debug; 247 | }; 248 | 1873DD901F5EC74B007D2B40 /* Release */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | ALWAYS_SEARCH_USER_PATHS = NO; 252 | CLANG_ANALYZER_NONNULL = YES; 253 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 254 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 255 | CLANG_CXX_LIBRARY = "libc++"; 256 | CLANG_ENABLE_MODULES = YES; 257 | CLANG_ENABLE_OBJC_ARC = YES; 258 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 259 | CLANG_WARN_BOOL_CONVERSION = YES; 260 | CLANG_WARN_COMMA = YES; 261 | CLANG_WARN_CONSTANT_CONVERSION = YES; 262 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 263 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 264 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 265 | CLANG_WARN_EMPTY_BODY = YES; 266 | CLANG_WARN_ENUM_CONVERSION = YES; 267 | CLANG_WARN_INFINITE_RECURSION = YES; 268 | CLANG_WARN_INT_CONVERSION = YES; 269 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 270 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 271 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 272 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 273 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 274 | CLANG_WARN_STRICT_PROTOTYPES = YES; 275 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 276 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 277 | CLANG_WARN_UNREACHABLE_CODE = YES; 278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 279 | CODE_SIGN_IDENTITY = "iPhone Developer"; 280 | COPY_PHASE_STRIP = NO; 281 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 282 | ENABLE_NS_ASSERTIONS = NO; 283 | ENABLE_STRICT_OBJC_MSGSEND = YES; 284 | GCC_C_LANGUAGE_STANDARD = gnu11; 285 | GCC_NO_COMMON_BLOCKS = YES; 286 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 287 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 288 | GCC_WARN_UNDECLARED_SELECTOR = YES; 289 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 290 | GCC_WARN_UNUSED_FUNCTION = YES; 291 | GCC_WARN_UNUSED_VARIABLE = YES; 292 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 293 | MTL_ENABLE_DEBUG_INFO = NO; 294 | SDKROOT = iphoneos; 295 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 296 | VALIDATE_PRODUCT = YES; 297 | }; 298 | name = Release; 299 | }; 300 | 1873DD921F5EC74B007D2B40 /* Debug */ = { 301 | isa = XCBuildConfiguration; 302 | buildSettings = { 303 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 304 | DEVELOPMENT_TEAM = 84CDCEHJJ8; 305 | INFOPLIST_FILE = DGFloldableTabbarControl/Info.plist; 306 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 307 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 308 | PRODUCT_BUNDLE_IDENTIFIER = dip.DGFloldableTabbarControl; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | SWIFT_VERSION = 4.0; 311 | TARGETED_DEVICE_FAMILY = "1,2"; 312 | }; 313 | name = Debug; 314 | }; 315 | 1873DD931F5EC74B007D2B40 /* Release */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 319 | DEVELOPMENT_TEAM = 84CDCEHJJ8; 320 | INFOPLIST_FILE = DGFloldableTabbarControl/Info.plist; 321 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 322 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 323 | PRODUCT_BUNDLE_IDENTIFIER = dip.DGFloldableTabbarControl; 324 | PRODUCT_NAME = "$(TARGET_NAME)"; 325 | SWIFT_VERSION = 4.0; 326 | TARGETED_DEVICE_FAMILY = "1,2"; 327 | }; 328 | name = Release; 329 | }; 330 | /* End XCBuildConfiguration section */ 331 | 332 | /* Begin XCConfigurationList section */ 333 | 1873DD7A1F5EC74A007D2B40 /* Build configuration list for PBXProject "DGFloldableTabbarControl" */ = { 334 | isa = XCConfigurationList; 335 | buildConfigurations = ( 336 | 1873DD8F1F5EC74B007D2B40 /* Debug */, 337 | 1873DD901F5EC74B007D2B40 /* Release */, 338 | ); 339 | defaultConfigurationIsVisible = 0; 340 | defaultConfigurationName = Release; 341 | }; 342 | 1873DD911F5EC74B007D2B40 /* Build configuration list for PBXNativeTarget "DGFloldableTabbarControl" */ = { 343 | isa = XCConfigurationList; 344 | buildConfigurations = ( 345 | 1873DD921F5EC74B007D2B40 /* Debug */, 346 | 1873DD931F5EC74B007D2B40 /* Release */, 347 | ); 348 | defaultConfigurationIsVisible = 0; 349 | defaultConfigurationName = Release; 350 | }; 351 | /* End XCConfigurationList section */ 352 | }; 353 | rootObject = 1873DD771F5EC74A007D2B40 /* Project object */; 354 | } 355 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl.xcodeproj/project.xcworkspace/xcuserdata/dip.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl.xcodeproj/project.xcworkspace/xcuserdata/dip.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DGFloldableTabbarControl.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DGFloldableTabbarControl.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl.xcodeproj/xcuserdata/dip.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl.xcodeproj/xcuserdata/dip.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DGFloldableTabbarControl.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Dip kasyap inspired from Vladislav Kovalyov 3 | // Copyright © Dip kasyap All rights reserved. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | 25 | @UIApplicationMain 26 | class AppDelegate: UIResponder, UIApplicationDelegate { 27 | 28 | var window: UIWindow? 29 | 30 | 31 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 32 | // Override point for customization after application launch. 33 | return true 34 | } 35 | 36 | func applicationWillResignActive(_ application: UIApplication) { 37 | // 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. 38 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 39 | } 40 | 41 | func applicationDidEnterBackground(_ application: UIApplication) { 42 | // 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. 43 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 44 | } 45 | 46 | func applicationWillEnterForeground(_ application: UIApplication) { 47 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 48 | } 49 | 50 | func applicationDidBecomeActive(_ application: UIApplication) { 51 | // 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. 52 | } 53 | 54 | func applicationWillTerminate(_ application: UIApplication) { 55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 56 | } 57 | 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "57x57", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-57x57@1x.png", 49 | "scale" : "1x" 50 | }, 51 | { 52 | "size" : "57x57", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-57x57@2x.png", 55 | "scale" : "2x" 56 | }, 57 | { 58 | "size" : "60x60", 59 | "idiom" : "iphone", 60 | "filename" : "Icon-App-60x60@2x.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "60x60", 65 | "idiom" : "iphone", 66 | "filename" : "Icon-App-60x60@3x.png", 67 | "scale" : "3x" 68 | }, 69 | { 70 | "idiom" : "ipad", 71 | "size" : "20x20", 72 | "scale" : "1x" 73 | }, 74 | { 75 | "idiom" : "ipad", 76 | "size" : "20x20", 77 | "scale" : "2x" 78 | }, 79 | { 80 | "idiom" : "ipad", 81 | "size" : "29x29", 82 | "scale" : "1x" 83 | }, 84 | { 85 | "idiom" : "ipad", 86 | "size" : "29x29", 87 | "scale" : "2x" 88 | }, 89 | { 90 | "idiom" : "ipad", 91 | "size" : "40x40", 92 | "scale" : "1x" 93 | }, 94 | { 95 | "idiom" : "ipad", 96 | "size" : "40x40", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "idiom" : "ipad", 101 | "size" : "76x76", 102 | "scale" : "1x" 103 | }, 104 | { 105 | "idiom" : "ipad", 106 | "size" : "76x76", 107 | "scale" : "2x" 108 | }, 109 | { 110 | "idiom" : "ipad", 111 | "size" : "83.5x83.5", 112 | "scale" : "2x" 113 | }, 114 | { 115 | "idiom" : "ios-marketing", 116 | "size" : "1024x1024", 117 | "scale" : "1x" 118 | } 119 | ], 120 | "info" : { 121 | "version" : 1, 122 | "author" : "xcode" 123 | } 124 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/bar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bar.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/bar.imageset/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/bar.imageset/bar.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/category.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "category.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "category@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "category@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/category.imageset/category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/category.imageset/category.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/category.imageset/category@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/category.imageset/category@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/category.imageset/category@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/category.imageset/category@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/filter.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "filter.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "filter@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "filter@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/filter.imageset/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/filter.imageset/filter.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/filter.imageset/filter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/filter.imageset/filter@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/filter.imageset/filter@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/filter.imageset/filter@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/hand.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "hand.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "hand@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "hand@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/hand.imageset/hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/hand.imageset/hand.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/hand.imageset/hand@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/hand.imageset/hand@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/hand.imageset/hand@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/hand.imageset/hand@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "home.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "home@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "home@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/home.imageset/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/home.imageset/home.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/home.imageset/home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/home.imageset/home@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/home.imageset/home@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/home.imageset/home@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "my_collection.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "my_collection@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "my_collection@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection.imageset/my_collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection.imageset/my_collection.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection.imageset/my_collection@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection.imageset/my_collection@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection.imageset/my_collection@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection.imageset/my_collection@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_black.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "my_collection_black.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "my_collection_black@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "my_collection_black@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_black.imageset/my_collection_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_black.imageset/my_collection_black.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_black.imageset/my_collection_black@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_black.imageset/my_collection_black@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_black.imageset/my_collection_black@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_black.imageset/my_collection_black@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_grey.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "my_collection_grey.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "my_collection_grey@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "my_collection_grey@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_grey.imageset/my_collection_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_grey.imageset/my_collection_grey.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_grey.imageset/my_collection_grey@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_grey.imageset/my_collection_grey@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_grey.imageset/my_collection_grey@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/my_collection_grey.imageset/my_collection_grey@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/scroll.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "scroll.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "scroll@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "scroll@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/scroll.imageset/scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/scroll.imageset/scroll.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/scroll.imageset/scroll@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/scroll.imageset/scroll@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/scroll.imageset/scroll@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/scroll.imageset/scroll@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/signout.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "signout.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "signout@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "signout@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/signout.imageset/signout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/signout.imageset/signout.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/signout.imageset/signout@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/signout.imageset/signout@2x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Assets.xcassets/ios/signout.imageset/signout@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dipkasyap/DGFloldableTabbarControl/49b7cfbac6addb3b2a3bbdef2fdc0fd0ef2975aa/DGFloldableTabbarControl/Assets.xcassets/ios/signout.imageset/signout@3x.png -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | KohinoorBangla-Semibold 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/CellCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Dip kasyap inspired from Vladislav Kovalyov 3 | // Copyright © Dip kasyap All rights reserved. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | 25 | class CellCollectionViewCell: UICollectionViewCell { 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/ContainerVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Dip kasyap inspired from Vladislav Kovalyov 3 | // Copyright © Dip kasyap All rights reserved. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | 25 | enum BarToHide:String { 26 | case top,bottom,both 27 | } 28 | 29 | class BarOptions { 30 | var title:String! 31 | var image:UIImage! 32 | init(_ title:String,image:String) { 33 | self.title = title 34 | self.image = UIImage(named:image) 35 | } 36 | } 37 | 38 | class ContainerVC: UIViewController { 39 | 40 | @IBOutlet weak var bottomBar: DGFloldableTabbarControl! 41 | @IBOutlet weak var topBar: UIView! 42 | 43 | override func viewDidLoad() { 44 | super.viewDidLoad() 45 | self.setUpTabBar() 46 | } 47 | 48 | override func viewDidLayoutSubviews() { 49 | self.bottomBar.cornerRadius = self.bottomBar.frame.size.height / 2 50 | } 51 | 52 | 53 | func setUpTabBar() { 54 | 55 | self.bottomBar.options = [ 56 | BarOptions("Home", image: "home"), 57 | BarOptions("List", image: "category"), 58 | BarOptions("Search", image: "filter"), 59 | BarOptions("Dashboard", image: "my_collection"), 60 | BarOptions("Logout", image: "signout") 61 | ] 62 | 63 | self.bottomBar.currentValue = self.bottomBar.options[0] 64 | self.bottomBar.currentIndex = 0 65 | self.bottomBar.buttonIcon = UIImage(named:"scroll") 66 | self.bottomBar.cornerRadius = self.bottomBar.frame.size.height / 2 67 | self.bottomBar.imageInsets = UIEdgeInsetsMake(12, 12, 12, 12) 68 | self.bottomBar.selectionColor = UIColor.black.withAlphaComponent(0.1) 69 | self.bottomBar.buttonBackgroundColor = UIColor(red: 0.243, green: 0.671, blue: 0.976, alpha: 1.00) 70 | self.bottomBar.expandedButtonBackgroundColor = self.bottomBar.buttonBackgroundColor 71 | 72 | self.bottomBar.optionSelectionBlock = { 73 | index in 74 | print("[---] Did select at index: \(index)") 75 | 76 | if let child = self.childViewControllers.first as? ListVC { 77 | child.collectionView.reloadData() 78 | } 79 | 80 | } 81 | } 82 | 83 | ///Method to handle Scroll behaviour 84 | func hideBar(_ hide:Bool, theBar bar:BarToHide) { 85 | 86 | switch bar { 87 | case .top: 88 | 89 | print("hide top bar") 90 | 91 | UIView.animate( 92 | withDuration: 0.3, 93 | delay: 0, 94 | usingSpringWithDamping: 0.9, 95 | initialSpringVelocity: 1, 96 | options: UIViewAnimationOptions.curveEaseIn, 97 | animations: { 98 | self.bottomBar.transform = hide ? CGAffineTransform(translationX: 0, y: 100) : CGAffineTransform.identity 99 | self.bottomBar.optionsView.transform = hide ? CGAffineTransform(translationX: 0, y: 100) : CGAffineTransform.identity 100 | 101 | }, completion:nil 102 | ) 103 | 104 | case .bottom: 105 | print("hide bottom bar") 106 | 107 | UIView.animate( 108 | withDuration: 0.3, 109 | delay: 0, 110 | usingSpringWithDamping: 0.9, 111 | initialSpringVelocity: 1, 112 | options: UIViewAnimationOptions.curveEaseIn, 113 | animations: { 114 | 115 | }, completion:nil 116 | ) 117 | 118 | default: 119 | print("hide both bar") 120 | 121 | } 122 | } 123 | } 124 | 125 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/DGFoldableTabbarControl/DGFloldableTabbarControl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Dip kasyap inspired from Vladislav Kovalyov 3 | // Copyright © Dip kasyap All rights reserved. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | 25 | typealias OptionSelectionBlock = (_ index: Int) -> Void 26 | 27 | @IBDesignable 28 | class DGFloldableTabbarControl: UIView { 29 | 30 | var barWidth = (UIApplication.shared.delegate as! AppDelegate).window!.frame.width * CGFloat(0.95) 31 | var backGorundColor = UIColor(red: 0.643, green: 0.114, blue: 0.271, alpha: 1.00) 32 | 33 | var options: [BarOptions]! { 34 | didSet { 35 | } 36 | } 37 | 38 | var textFont = UIFont.systemFont(ofSize: 22.0) 39 | 40 | var textColor = UIColor.white{ 41 | didSet { 42 | self.button.setTitleColor(self.textColor, for: .normal) 43 | } 44 | } 45 | 46 | var isExpanded = false 47 | 48 | var expandedTextColor = UIColor.white 49 | 50 | var autoHideOptions = true 51 | var animationDuration: TimeInterval = 0.275 52 | var minOptionSize: CGFloat = 60 53 | 54 | var imageInsets: UIEdgeInsets = UIEdgeInsetsMake(6, 6, 6, 6) { 55 | didSet { 56 | self.button.imageEdgeInsets = imageInsets 57 | } 58 | } 59 | 60 | var buttonBackgroundColor = UIColor(red: 0.643, green: 0.114, blue: 0.271, alpha: 1.00) { 61 | didSet { 62 | self.button.backgroundColor = buttonBackgroundColor 63 | } 64 | } 65 | 66 | var expandedButtonBackgroundColor = UIColor.red 67 | 68 | var selectionColor = UIColor.gray { 69 | didSet { 70 | self.button.setBackgroundImage(UIImage.imageWithColor(color: buttonBackgroundColor), for: .highlighted) 71 | } 72 | } 73 | 74 | var cornerRadius: CGFloat = 0{ 75 | didSet { 76 | self.button.layer.cornerRadius = cornerRadius 77 | self.optionsView.layer.cornerRadius = cornerRadius 78 | } 79 | } 80 | 81 | let arrowWidth:CGFloat = 80.0 82 | 83 | ///Default is 0 84 | var currentIndex: Int! = 0 85 | 86 | var currentValue: AnyObject! 87 | 88 | var optionSelectionBlock: OptionSelectionBlock? 89 | 90 | let btnArrow = UIButton() 91 | var button = UIButton() 92 | var optionsView = UIView() 93 | var stackView = UIStackView() 94 | 95 | var buttonIcon:UIImage? { 96 | didSet { 97 | self.button.setImage(buttonIcon, for: .normal) 98 | } 99 | } 100 | 101 | //MARK:- Init 102 | override init(frame: CGRect) { 103 | super.init(frame: frame) 104 | self.setupView() 105 | self.setupStackView() 106 | self.observeOrientation() 107 | } 108 | 109 | required init?(coder aDecoder: NSCoder) { 110 | super.init(coder: aDecoder) 111 | self.setupStackView() 112 | self.setupView() 113 | self.observeOrientation() 114 | } 115 | 116 | // MARK: - 117 | private func observeOrientation() { 118 | NotificationCenter.default.addObserver(self, selector: #selector(DGFloldableTabbarControl.rotated), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil) 119 | } 120 | 121 | @objc private func rotated() { 122 | 123 | if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) { 124 | print("landScape") 125 | barWidth = (UIApplication.shared.delegate as! AppDelegate).window!.frame.height * CGFloat(0.95) 126 | } 127 | if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) { 128 | print("portait") 129 | barWidth = (UIApplication.shared.delegate as! AppDelegate).window!.frame.width * CGFloat(0.95) 130 | } 131 | } 132 | 133 | 134 | // MARK: - View Setup 135 | override func draw(_ rect: CGRect) { 136 | super.draw(rect) 137 | self.configureOptions() 138 | } 139 | 140 | override func layoutSubviews() { 141 | super.layoutSubviews() 142 | self.button.frame = self.bounds 143 | self.optionsView.frame = self.bounds 144 | } 145 | 146 | override func updateConstraints() { 147 | super.updateConstraints() 148 | } 149 | 150 | override func layoutIfNeeded() { 151 | super.layoutIfNeeded() 152 | } 153 | 154 | 155 | 156 | private func setupStackView(){ 157 | self.stackView.axis = .horizontal 158 | self.stackView.alignment = .fill 159 | self.stackView.distribution = .fillEqually 160 | } 161 | 162 | 163 | private func setupView() { 164 | 165 | self.button.frame = self.bounds 166 | self.optionsView.frame = self.bounds 167 | self.button.titleLabel?.font = self.textFont 168 | self.button.layer.cornerRadius = self.cornerRadius 169 | self.button.backgroundColor = self.buttonBackgroundColor 170 | 171 | self.button.imageView?.contentMode = .scaleAspectFit 172 | self.button.imageEdgeInsets = self.imageInsets 173 | 174 | self.button.titleLabel?.textAlignment = .center 175 | self.button.setTitleColor(self.textColor, for: .normal) 176 | 177 | self.button.titleLabel?.adjustsFontSizeToFitWidth = true 178 | 179 | self.button.setBackgroundImage(UIImage.imageWithColor(color: buttonBackgroundColor), for: .normal) 180 | self.button.addTarget(self, action: #selector(DGFloldableTabbarControl.showOptions), for: .touchUpInside) 181 | 182 | self.addSubview(self.button) 183 | 184 | self.backgroundColor = UIColor.clear 185 | self.button.layer.masksToBounds = true 186 | self.optionsView.layer.masksToBounds = true 187 | } 188 | 189 | 190 | private func getWitdthOfItem(_ atIndex:Int)->CGFloat { 191 | // self.barWidth = self.optionsView.frame.width 192 | guard atIndex != self.options.count else { 193 | return arrowWidth 194 | } 195 | return (self.barWidth-arrowWidth)/CGFloat(options.count) 196 | } 197 | 198 | 199 | //Show tabar 200 | @objc private func configureOptions() { 201 | 202 | self.isExpanded = true 203 | 204 | // Create `optionsView` 205 | self.optionsView.frame = self.frame 206 | self.optionsView.backgroundColor = self.button.backgroundColor 207 | 208 | var desiredOrigin: CGFloat = 20 209 | 210 | self.superview?.addSubview(optionsView) 211 | self.optionsView.addSubview(stackView) 212 | 213 | var i = 0 214 | 215 | // Create buttons for each option 216 | for option in self.options { 217 | 218 | // Prepare frame 219 | let frame = CGRect(x:desiredOrigin, y:0, width:self.getWitdthOfItem(i), height:optionsView.frame.size.height) 220 | 221 | let button = TabItem(frame: frame) 222 | button.image = option.image 223 | button.title = option.title 224 | 225 | // Configure button 226 | button.backgroundColor = UIColor.clear 227 | button.setBackgroundImage(UIImage.imageWithColor(color: self.selectionColor), for: .selected) 228 | button.addTarget(self, action: #selector(DGFloldableTabbarControl.didSelect), for: .touchUpInside) 229 | button.layer.cornerRadius = self.cornerRadius 230 | button.layer.masksToBounds = true 231 | button.tag = i 232 | button.isSelected = i == currentIndex 233 | 234 | // Add button to 'optionView' 235 | self.stackView.addArrangedSubview(button) 236 | 237 | // Prepare frame and index for next button 238 | desiredOrigin += button.frame.size.width 239 | i += 1 240 | } 241 | 242 | let frame = CGRect(x:desiredOrigin, y:0, width:self.getWitdthOfItem(self.options.count), height:optionsView.frame.size.height) 243 | btnArrow.frame = frame 244 | btnArrow.setImage(self.buttonIcon, for: .normal) 245 | btnArrow.imageEdgeInsets = UIEdgeInsets(top: 6, left: 6, bottom: 6, right: 6) 246 | btnArrow.layer.addBorder(edge: .left, color: UIColor.white.withAlphaComponent(0.7), thickness: 1.0) 247 | btnArrow.addTarget(self, action: #selector(DGFloldableTabbarControl.onOptionButtonAction), for: .touchUpInside) 248 | btnArrow.tag = 128923 // random tag 249 | self.optionsView.addSubview(btnArrow) 250 | 251 | //initially showing options 252 | self.showOptions() 253 | 254 | } 255 | 256 | private func addConstraints() { 257 | self.superview?.addConstraintsWithFormat("H:|-20-[v0]-20-|", views: optionsView) 258 | self.superview?.addConstraintsWithFormat("V:[v0(\(self.frame.height))]-20-|", views: optionsView) 259 | self.optionsView.addConstraintsWithFormat("H:|[v0]-(\(self.arrowWidth))-|", views: stackView) 260 | self.optionsView.addConstraintsWithFormat("V:|[v0]|", views: stackView) 261 | self.optionsView.addConstraintsWithFormat("H:[v0(\(arrowWidth))]", views: btnArrow) 262 | self.optionsView.addConstraintsWithFormat("V:|[v0]|", views: btnArrow) 263 | self.btnArrow.leftAnchor.constraint(equalTo: 264 | stackView.rightAnchor 265 | ).isActive = true 266 | } 267 | 268 | @objc private func showOptions() { 269 | 270 | // Show 271 | self.superview?.addSubview(optionsView) 272 | self.optionsView.addSubview(stackView) 273 | 274 | //for view in self.optionsView.subviews 275 | for view in self.stackView.subviews { 276 | view.alpha = 1 277 | } 278 | 279 | self.addConstraints() 280 | 281 | UIView.animate(withDuration: self.animationDuration) { 282 | self.optionsView.backgroundColor = self.expandedButtonBackgroundColor 283 | self.optionsView.isHidden = false 284 | self.superview?.layoutIfNeeded() 285 | } 286 | } 287 | 288 | /** 289 | collaps tabbar 290 | - Parameter selectedIndex: Index of selected tab 291 | */ 292 | private func hideOptions(selectedIndex: Int = 0) { 293 | 294 | self.isExpanded = false 295 | //Hide 296 | UIView.animate(withDuration: self.animationDuration, animations: { 297 | self.optionsView.backgroundColor = self.buttonBackgroundColor 298 | self.optionsView.frame = self.frame 299 | }) { (completed) in 300 | UIView.animate(withDuration: self.animationDuration, animations: { 301 | self.optionsView.isHidden = true 302 | }) 303 | } 304 | } 305 | 306 | // MARK: - Actions 307 | //Selector of `self.button` 308 | @objc private func onButtonAction(sender: UIButton) { 309 | self.showOptions() 310 | } 311 | 312 | //Selector for each tab 313 | @objc private func didSelect(sender: UIButton) { 314 | 315 | //Update selected value 316 | self.currentValue = self.options[sender.tag] 317 | 318 | //Hide all options buttons except of selected one 319 | UIView.animate(withDuration: self.animationDuration / 2) { 320 | //for view in self.optionsView.subviews 321 | for view in self.stackView.subviews { 322 | (view as! TabItem).isSelected = view.tag == sender.tag 323 | } 324 | } 325 | 326 | // Perform completion block 327 | if let completionBlock = self.optionSelectionBlock { 328 | completionBlock(sender.tag) 329 | } 330 | } 331 | 332 | 333 | @objc private func onOptionButtonAction(sender: UIButton) { 334 | // Close options view if it is required 335 | if self.autoHideOptions{ 336 | UIView.animate(withDuration: self.animationDuration, animations: { 337 | sender.frame = CGRect(x:0, y:0, width:self.button.frame.size.width, height:self.button.frame.size.height) 338 | }) 339 | self.hideOptions(selectedIndex: sender.tag) 340 | } 341 | } 342 | } 343 | 344 | // MARK: - Utils 345 | extension UIImage { 346 | /** 347 | Create image from specific `UIColor` 348 | - Parameter color: Specific color 349 | - Returns: `UIImage` object filled by specific color 350 | */ 351 | class func imageWithColor(color: UIColor) -> UIImage { 352 | let size = CGSize(width: 64, height: 64) 353 | let rect = CGRect(x:0, y:0, width:size.width, height:size.height) 354 | UIGraphicsBeginImageContextWithOptions(size, false, 0) 355 | color.setFill() 356 | UIRectFill(rect) 357 | let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()! 358 | UIGraphicsEndImageContext() 359 | return image 360 | } 361 | } 362 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/DGFoldableTabbarControl/TabItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Dip kasyap inspired from Vladislav Kovalyov 3 | // Copyright © Dip kasyap All rights reserved. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | 25 | class TabItem: UIButton { 26 | 27 | @IBInspectable var image:UIImage? { 28 | didSet { 29 | if let imageView = imageVU { 30 | imageView.image = image 31 | } 32 | } 33 | } 34 | 35 | lazy var imageVU:UIImageView? = { 36 | 37 | let imageVU = UIImageView() 38 | return imageVU 39 | }() 40 | 41 | lazy var containerView:UIView? = { 42 | let imageVU = UIView() 43 | return imageVU 44 | }() 45 | 46 | 47 | @IBInspectable var title:String? { 48 | didSet { 49 | self.titleLbl.text = title 50 | } 51 | } 52 | 53 | var titleLbl: UILabel = { 54 | let lbl = UILabel() 55 | lbl.font = UIFont.systemFont(ofSize: 14) 56 | lbl.adjustsFontSizeToFitWidth = true 57 | lbl.textColor = UIColor.white 58 | lbl.textAlignment = .left 59 | return lbl 60 | }() 61 | 62 | let padding:CGFloat = 5 63 | var verticalPadding:CGFloat = 5 64 | var interItemPadding:CGFloat = 0 65 | 66 | var imageWidth:CGFloat = { 67 | var val:CGFloat = 20.0 68 | return val 69 | }() 70 | 71 | open var minimumScale: CGFloat = 0.95 72 | open var pressSpringDamping: CGFloat = 0.4 73 | open var releaseSpringDamping: CGFloat = 0.35 74 | open var pressSpringDuration = 0.4 75 | open var releaseSpringDuration = 0.5 76 | open var cornorRadious:CGFloat = 6.0 77 | 78 | //MARK:- Init 79 | convenience init (withImage image:UIImage , andTitle title:String?) { 80 | self.init() 81 | self.image = image 82 | self.title = title 83 | } 84 | 85 | override init(frame: CGRect) { 86 | super.init(frame: frame) 87 | setUp() 88 | } 89 | 90 | required init?(coder aDecoder: NSCoder) { 91 | super.init(coder: aDecoder) 92 | setUp() 93 | } 94 | 95 | //MARK:- setup 96 | func setUp() { 97 | //decoration 98 | self.addSubview(containerView!) 99 | self.containerView?.translatesAutoresizingMaskIntoConstraints = false 100 | self.containerView?.backgroundColor = .red 101 | self.containerView?.addSubview(imageVU!) 102 | self.containerView?.addSubview(titleLbl) 103 | //constraints 104 | manageConstraints() 105 | } 106 | 107 | private func manageConstraints() { 108 | //1. Centering 109 | self.imageVU?.centerYAnchor.constraint(equalTo: 110 | centerYAnchor 111 | ).isActive = true 112 | 113 | self.containerView?.centerYAnchor.constraint(equalTo: 114 | centerYAnchor 115 | ).isActive = true 116 | self.containerView?.centerXAnchor.constraint(equalTo: 117 | centerXAnchor 118 | ).isActive = true 119 | 120 | self.titleLbl.centerYAnchor.constraint(equalTo: 121 | centerYAnchor 122 | ).isActive = true 123 | 124 | //2. Size 125 | self.containerView!.addConstraintsWithFormat("H:[v0(\(imageWidth))]", views: imageVU!) 126 | self.containerView!.addConstraintsWithFormat("V:[v0(\(imageWidth))]", views: imageVU!) 127 | 128 | //3. Positioning 129 | self.containerView!.addConstraintsWithFormat("H:|[v0]-4-[v1]|", views: imageVU!,titleLbl) 130 | } 131 | 132 | //MARK:- Touch actions 133 | open override func touchesBegan(_ touches: Set, with event: UIEvent?) { 134 | super.touchesBegan(touches, with: event) 135 | 136 | UIView.animate(withDuration: self.pressSpringDuration, delay: 0, usingSpringWithDamping: self.pressSpringDamping, initialSpringVelocity: 0, options: [.curveLinear, .allowUserInteraction], animations: { () -> Void in 137 | self.transform = CGAffineTransform(scaleX: self.minimumScale, y: self.minimumScale) 138 | }, completion: nil) 139 | } 140 | 141 | open override func touchesEnded(_ touches: Set, with event: UIEvent?) { 142 | super.touchesEnded(touches, with: event) 143 | 144 | UIView.animate(withDuration: self.releaseSpringDuration, delay: 0, usingSpringWithDamping: self.releaseSpringDamping, initialSpringVelocity: 0, options: [.curveLinear, .allowUserInteraction], animations: { () -> Void in 145 | self.transform = CGAffineTransform.identity 146 | }, completion: nil) 147 | } 148 | 149 | open override func touchesMoved(_ touches: Set, with event: UIEvent?) { 150 | super.touchesEnded(touches, with: event) 151 | 152 | let location = touches.first!.location(in: self) 153 | if !self.bounds.contains(location) { 154 | UIView.animate(withDuration: self.releaseSpringDuration, delay: 0, usingSpringWithDamping: self.releaseSpringDamping, initialSpringVelocity: 0, options: [.curveLinear, .allowUserInteraction], animations: { () -> Void in 155 | self.transform = CGAffineTransform.identity 156 | }, completion: nil) 157 | } 158 | } 159 | 160 | open override func touchesCancelled(_ touches: Set, with event: UIEvent?) { 161 | super.touchesCancelled(touches, with: event) 162 | 163 | UIView.animate(withDuration: self.releaseSpringDuration, delay: 0, usingSpringWithDamping: self.releaseSpringDamping, initialSpringVelocity: 0, options: [.curveLinear, .allowUserInteraction], animations: { () -> Void in 164 | self.transform = CGAffineTransform.identity 165 | }, completion: nil) 166 | } 167 | } 168 | 169 | 170 | // MARK: - Utils 171 | extension UIView { 172 | func addConstraintsWithFormat(_ format: String, views: UIView...) { 173 | var viewsDictionary = [String: UIView]() 174 | for (index, view) in views.enumerated() { 175 | let key = "v\(index)" 176 | view.translatesAutoresizingMaskIntoConstraints = false 177 | viewsDictionary[key] = view 178 | } 179 | addConstraints(NSLayoutConstraint.constraints(withVisualFormat: format, options: NSLayoutFormatOptions(), metrics: nil, views: viewsDictionary)) 180 | } 181 | } 182 | 183 | 184 | extension CALayer { 185 | 186 | func addBorder(edge: UIRectEdge, color: UIColor, thickness: CGFloat) { 187 | 188 | let border = CALayer() 189 | 190 | switch edge { 191 | case UIRectEdge.top: 192 | border.frame = CGRect.init(x: 0, y: 0, width: frame.width, height: thickness) 193 | break 194 | case UIRectEdge.bottom: 195 | border.frame = CGRect.init(x: 0, y: frame.height - thickness, width: frame.width, height: thickness) 196 | break 197 | case UIRectEdge.left: 198 | border.frame = CGRect.init(x: 0, y: 0, width: thickness, height: frame.height) 199 | break 200 | case UIRectEdge.right: 201 | border.frame = CGRect.init(x: frame.width - thickness, y: 0, width: thickness, height: frame.height) 202 | break 203 | default: 204 | break 205 | } 206 | 207 | border.backgroundColor = color.cgColor; 208 | 209 | self.addSublayer(border) 210 | } 211 | } 212 | 213 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /DGFloldableTabbarControl/ListVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Dip kasyap inspired from Vladislav Kovalyov 3 | // Copyright © Dip kasyap All rights reserved. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | 25 | class ListVC: BaseVC,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout { 26 | 27 | let dx:CGFloat = 10 28 | let vMargin:CGFloat = 10 29 | @IBOutlet weak var collectionView: UICollectionView! 30 | 31 | override func viewDidLoad() { 32 | super.viewDidLoad() 33 | } 34 | 35 | func numberOfSections(in collectionView: UICollectionView) -> Int { 36 | return 1 37 | } 38 | 39 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 40 | return 50 41 | } 42 | 43 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 44 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as UICollectionViewCell 45 | cell.backgroundColor = UIColor.random.withAlphaComponent(0.5) 46 | return cell 47 | } 48 | 49 | 50 | //MARK: Collection view layout 51 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 52 | 53 | let height = (collectionView.frame.height - vMargin)/3 - dx 54 | let width:CGFloat = (collectionView.frame.width )/3 55 | 56 | return CGSize(width: width - (3*dx)/2, height: height) 57 | 58 | } 59 | 60 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { 61 | 62 | return UIEdgeInsets(top: dx, left: dx, bottom: dx, right: dx) 63 | } 64 | 65 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { 66 | return dx 67 | } 68 | 69 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { 70 | return dx 71 | } 72 | 73 | } 74 | 75 | class BaseVC:UIViewController,UIScrollViewDelegate { 76 | 77 | override func viewDidLoad() { 78 | super.viewDidLoad() 79 | } 80 | 81 | enum ScrollDirection { 82 | case up,down 83 | } 84 | 85 | func scrollViewDidScroll(_ scrollView: UIScrollView) { 86 | 87 | print("start scrolling........<<<<<<>>>>>>") 88 | 89 | guard let _ = self.parent as? ContainerVC else { 90 | print("NO Parent exist") 91 | 92 | return 93 | } 94 | 95 | let direction:ScrollDirection = scrollView.panGestureRecognizer.translation(in: scrollView.superview).y > 0 ? .up : .down 96 | print(direction) 97 | 98 | if direction == .up { 99 | self.hideBar(false, theBar: .top) 100 | self.hideBar(true, theBar: .bottom) 101 | } else { 102 | self.hideBar(true, theBar: .top) 103 | self.hideBar(false, theBar: .bottom) 104 | } 105 | } 106 | 107 | func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { 108 | print("Stopped scrolling.....!!!!!!!!") 109 | self.hideBar(false, theBar: .top) 110 | self.hideBar(false, theBar: .bottom) 111 | } 112 | 113 | func hideBar(_ hide:Bool, theBar bar:BarToHide) { 114 | 115 | guard let parent = self.parent as? ContainerVC else { 116 | print("NO Parent exist") 117 | return 118 | } 119 | parent.hideBar(hide, theBar: bar) 120 | } 121 | } 122 | 123 | 124 | extension CGFloat { 125 | static func random() -> CGFloat { 126 | return CGFloat(arc4random()) / CGFloat(UInt32.max) 127 | } 128 | } 129 | 130 | extension UIColor { 131 | static var random: UIColor { 132 | return UIColor(red: .random(), green: .random(), blue: .random(), alpha: 1.0) 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | 6 |

7 | 8 | 9 | # DGFloldableTabbarControl 10 | 11 | An elegant foldable tabbar control. (iPad) 12 | 13 | 14 | ![record](https://user-images.githubusercontent.com/12591229/30094896-d494a3a6-92ee-11e7-9e46-7da82fd5c60c.gif) 15 | 16 | 17 | # Usage 18 | 1. Drag and drop DGFoldableTabbarControl folder from demo to your project. 19 | 2. Place a View on your storyboard and assign DGFloldableTabbarControl class. 20 | 3. Drag outlet of that View on your controller. 21 | 22 | @IBOutlet weak var bottomBar: DGFloldableTabbarControl! 23 | 24 | 4. Customize your tabbar as following 25 | 26 | self.bottomBar.options = [BarOptions("Home", image: "home"),BarOptions("List", image: "category"),BarOptions("Search", image: "filter"),BarOptions("Dashboard", image: "my_collection"),BarOptions("Logout", image: "signout")] 27 | self.bottomBar.currentValue = self.bottomBar.options[0] 28 | self.bottomBar.currentIndex = 0 29 | self.bottomBar.buttonIcon = UIImage(named:"scroll") 30 | self.bottomBar.cornerRadius = self.bottomBar.frame.size.height / 2 31 | self.bottomBar.imageInsets = UIEdgeInsetsMake(12, 12, 12, 12) 32 | self.bottomBar.selectionColor = UIColor.black.withAlphaComponent(0.1) //UIColor(red: 75.0/256.0, green: 178.0/256.0, blue: 174.0/256.0, alpha: 1.0) 33 | self.bottomBar.buttonBackgroundColor = UIColor(red: 0.243, green: 0.671, blue: 0.976, alpha: 1.00) //UIColor(red: 0.643, green: 0.114, blue: 0.271, alpha: 1.00) 34 | self.bottomBar.expandedButtonBackgroundColor = self.bottomBar.buttonBackgroundColor 35 | 36 | self.bottomBar.optionSelectionBlock = { 37 | index in 38 | print("[---] Did select at index: \(index)") 39 | } 40 | 41 | 42 | 43 | 44 | # Licence 45 | 46 | The MIT License (MIT) Copyright (c) 2014 Dip Kasyap (Dpd Ghimire) (pr0gramm3r8hai) 47 | 48 | email:- dpd.ghimire@gmail.com github : https://github.com/dipkasyap/DGFloldableTabbarControl 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE DGLocalization 53 | --------------------------------------------------------------------------------