├── .DS_Store ├── .gitattributes └── CustomTabBarInSwiftUI ├── .DS_Store ├── CustomTabBar.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── andreasschultz.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── andreasschultz.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── CustomTabBar ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json ├── DarkPurple.colorset │ └── Contents.json ├── TabBarBackground.colorset │ └── Contents.json └── TabBarHighlight.colorset │ └── Contents.json ├── ContentView.swift ├── CustomTabBarApp.swift ├── Info.plist ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json └── ViewRouter.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BLCKBIRDS/CustomTabBarInSwiftUI/2d41a358255f626aa1cbff30011f31ca3801eeb5/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BLCKBIRDS/CustomTabBarInSwiftUI/2d41a358255f626aa1cbff30011f31ca3801eeb5/CustomTabBarInSwiftUI/.DS_Store -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 45A107AC254B129200F326EB /* ViewRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45A107AB254B129200F326EB /* ViewRouter.swift */; }; 11 | 45FD0AF92548C6CB00F4C892 /* CustomTabBarApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45FD0AF82548C6CB00F4C892 /* CustomTabBarApp.swift */; }; 12 | 45FD0AFB2548C6CB00F4C892 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45FD0AFA2548C6CB00F4C892 /* ContentView.swift */; }; 13 | 45FD0AFD2548C6CC00F4C892 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 45FD0AFC2548C6CC00F4C892 /* Assets.xcassets */; }; 14 | 45FD0B002548C6CC00F4C892 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 45FD0AFF2548C6CC00F4C892 /* Preview Assets.xcassets */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 45A107AB254B129200F326EB /* ViewRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewRouter.swift; sourceTree = ""; }; 19 | 45FD0AF52548C6CB00F4C892 /* CustomTabBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomTabBar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 45FD0AF82548C6CB00F4C892 /* CustomTabBarApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTabBarApp.swift; sourceTree = ""; }; 21 | 45FD0AFA2548C6CB00F4C892 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 22 | 45FD0AFC2548C6CC00F4C892 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 23 | 45FD0AFF2548C6CC00F4C892 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 24 | 45FD0B012548C6CC00F4C892 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | 45FD0AF22548C6CB00F4C892 /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | ); 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXFrameworksBuildPhase section */ 36 | 37 | /* Begin PBXGroup section */ 38 | 45FD0AEC2548C6CB00F4C892 = { 39 | isa = PBXGroup; 40 | children = ( 41 | 45FD0AF72548C6CB00F4C892 /* CustomTabBar */, 42 | 45FD0AF62548C6CB00F4C892 /* Products */, 43 | ); 44 | sourceTree = ""; 45 | }; 46 | 45FD0AF62548C6CB00F4C892 /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 45FD0AF52548C6CB00F4C892 /* CustomTabBar.app */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 45FD0AF72548C6CB00F4C892 /* CustomTabBar */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 45FD0AF82548C6CB00F4C892 /* CustomTabBarApp.swift */, 58 | 45FD0AFA2548C6CB00F4C892 /* ContentView.swift */, 59 | 45A107AB254B129200F326EB /* ViewRouter.swift */, 60 | 45FD0AFC2548C6CC00F4C892 /* Assets.xcassets */, 61 | 45FD0B012548C6CC00F4C892 /* Info.plist */, 62 | 45FD0AFE2548C6CC00F4C892 /* Preview Content */, 63 | ); 64 | path = CustomTabBar; 65 | sourceTree = ""; 66 | }; 67 | 45FD0AFE2548C6CC00F4C892 /* Preview Content */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 45FD0AFF2548C6CC00F4C892 /* Preview Assets.xcassets */, 71 | ); 72 | path = "Preview Content"; 73 | sourceTree = ""; 74 | }; 75 | /* End PBXGroup section */ 76 | 77 | /* Begin PBXNativeTarget section */ 78 | 45FD0AF42548C6CB00F4C892 /* CustomTabBar */ = { 79 | isa = PBXNativeTarget; 80 | buildConfigurationList = 45FD0B042548C6CC00F4C892 /* Build configuration list for PBXNativeTarget "CustomTabBar" */; 81 | buildPhases = ( 82 | 45FD0AF12548C6CB00F4C892 /* Sources */, 83 | 45FD0AF22548C6CB00F4C892 /* Frameworks */, 84 | 45FD0AF32548C6CB00F4C892 /* Resources */, 85 | ); 86 | buildRules = ( 87 | ); 88 | dependencies = ( 89 | ); 90 | name = CustomTabBar; 91 | productName = CustomTabBar; 92 | productReference = 45FD0AF52548C6CB00F4C892 /* CustomTabBar.app */; 93 | productType = "com.apple.product-type.application"; 94 | }; 95 | /* End PBXNativeTarget section */ 96 | 97 | /* Begin PBXProject section */ 98 | 45FD0AED2548C6CB00F4C892 /* Project object */ = { 99 | isa = PBXProject; 100 | attributes = { 101 | LastSwiftUpdateCheck = 1210; 102 | LastUpgradeCheck = 1210; 103 | TargetAttributes = { 104 | 45FD0AF42548C6CB00F4C892 = { 105 | CreatedOnToolsVersion = 12.1; 106 | }; 107 | }; 108 | }; 109 | buildConfigurationList = 45FD0AF02548C6CB00F4C892 /* Build configuration list for PBXProject "CustomTabBar" */; 110 | compatibilityVersion = "Xcode 9.3"; 111 | developmentRegion = en; 112 | hasScannedForEncodings = 0; 113 | knownRegions = ( 114 | en, 115 | Base, 116 | ); 117 | mainGroup = 45FD0AEC2548C6CB00F4C892; 118 | productRefGroup = 45FD0AF62548C6CB00F4C892 /* Products */; 119 | projectDirPath = ""; 120 | projectRoot = ""; 121 | targets = ( 122 | 45FD0AF42548C6CB00F4C892 /* CustomTabBar */, 123 | ); 124 | }; 125 | /* End PBXProject section */ 126 | 127 | /* Begin PBXResourcesBuildPhase section */ 128 | 45FD0AF32548C6CB00F4C892 /* Resources */ = { 129 | isa = PBXResourcesBuildPhase; 130 | buildActionMask = 2147483647; 131 | files = ( 132 | 45FD0B002548C6CC00F4C892 /* Preview Assets.xcassets in Resources */, 133 | 45FD0AFD2548C6CC00F4C892 /* Assets.xcassets in Resources */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXResourcesBuildPhase section */ 138 | 139 | /* Begin PBXSourcesBuildPhase section */ 140 | 45FD0AF12548C6CB00F4C892 /* Sources */ = { 141 | isa = PBXSourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 45A107AC254B129200F326EB /* ViewRouter.swift in Sources */, 145 | 45FD0AFB2548C6CB00F4C892 /* ContentView.swift in Sources */, 146 | 45FD0AF92548C6CB00F4C892 /* CustomTabBarApp.swift in Sources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXSourcesBuildPhase section */ 151 | 152 | /* Begin XCBuildConfiguration section */ 153 | 45FD0B022548C6CC00F4C892 /* Debug */ = { 154 | isa = XCBuildConfiguration; 155 | buildSettings = { 156 | ALWAYS_SEARCH_USER_PATHS = NO; 157 | CLANG_ANALYZER_NONNULL = YES; 158 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 159 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 160 | CLANG_CXX_LIBRARY = "libc++"; 161 | CLANG_ENABLE_MODULES = YES; 162 | CLANG_ENABLE_OBJC_ARC = YES; 163 | CLANG_ENABLE_OBJC_WEAK = YES; 164 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 165 | CLANG_WARN_BOOL_CONVERSION = YES; 166 | CLANG_WARN_COMMA = YES; 167 | CLANG_WARN_CONSTANT_CONVERSION = YES; 168 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 169 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 170 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 171 | CLANG_WARN_EMPTY_BODY = YES; 172 | CLANG_WARN_ENUM_CONVERSION = YES; 173 | CLANG_WARN_INFINITE_RECURSION = YES; 174 | CLANG_WARN_INT_CONVERSION = YES; 175 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 176 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 177 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 178 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 179 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 180 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 181 | CLANG_WARN_STRICT_PROTOTYPES = YES; 182 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 183 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 184 | CLANG_WARN_UNREACHABLE_CODE = YES; 185 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 186 | COPY_PHASE_STRIP = NO; 187 | DEBUG_INFORMATION_FORMAT = dwarf; 188 | ENABLE_STRICT_OBJC_MSGSEND = YES; 189 | ENABLE_TESTABILITY = YES; 190 | GCC_C_LANGUAGE_STANDARD = gnu11; 191 | GCC_DYNAMIC_NO_PIC = NO; 192 | GCC_NO_COMMON_BLOCKS = YES; 193 | GCC_OPTIMIZATION_LEVEL = 0; 194 | GCC_PREPROCESSOR_DEFINITIONS = ( 195 | "DEBUG=1", 196 | "$(inherited)", 197 | ); 198 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 199 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 200 | GCC_WARN_UNDECLARED_SELECTOR = YES; 201 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 202 | GCC_WARN_UNUSED_FUNCTION = YES; 203 | GCC_WARN_UNUSED_VARIABLE = YES; 204 | IPHONEOS_DEPLOYMENT_TARGET = 14.1; 205 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 206 | MTL_FAST_MATH = YES; 207 | ONLY_ACTIVE_ARCH = YES; 208 | SDKROOT = iphoneos; 209 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 210 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 211 | }; 212 | name = Debug; 213 | }; 214 | 45FD0B032548C6CC00F4C892 /* Release */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | ALWAYS_SEARCH_USER_PATHS = NO; 218 | CLANG_ANALYZER_NONNULL = YES; 219 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 221 | CLANG_CXX_LIBRARY = "libc++"; 222 | CLANG_ENABLE_MODULES = YES; 223 | CLANG_ENABLE_OBJC_ARC = YES; 224 | CLANG_ENABLE_OBJC_WEAK = YES; 225 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 226 | CLANG_WARN_BOOL_CONVERSION = YES; 227 | CLANG_WARN_COMMA = YES; 228 | CLANG_WARN_CONSTANT_CONVERSION = YES; 229 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 230 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 231 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 232 | CLANG_WARN_EMPTY_BODY = YES; 233 | CLANG_WARN_ENUM_CONVERSION = YES; 234 | CLANG_WARN_INFINITE_RECURSION = YES; 235 | CLANG_WARN_INT_CONVERSION = YES; 236 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 237 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 238 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 239 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 240 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 241 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 242 | CLANG_WARN_STRICT_PROTOTYPES = YES; 243 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 244 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 245 | CLANG_WARN_UNREACHABLE_CODE = YES; 246 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 247 | COPY_PHASE_STRIP = NO; 248 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 249 | ENABLE_NS_ASSERTIONS = NO; 250 | ENABLE_STRICT_OBJC_MSGSEND = YES; 251 | GCC_C_LANGUAGE_STANDARD = gnu11; 252 | GCC_NO_COMMON_BLOCKS = YES; 253 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 254 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 255 | GCC_WARN_UNDECLARED_SELECTOR = YES; 256 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 257 | GCC_WARN_UNUSED_FUNCTION = YES; 258 | GCC_WARN_UNUSED_VARIABLE = YES; 259 | IPHONEOS_DEPLOYMENT_TARGET = 14.1; 260 | MTL_ENABLE_DEBUG_INFO = NO; 261 | MTL_FAST_MATH = YES; 262 | SDKROOT = iphoneos; 263 | SWIFT_COMPILATION_MODE = wholemodule; 264 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 265 | VALIDATE_PRODUCT = YES; 266 | }; 267 | name = Release; 268 | }; 269 | 45FD0B052548C6CC00F4C892 /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 273 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 274 | CODE_SIGN_STYLE = Automatic; 275 | DEVELOPMENT_ASSET_PATHS = "\"CustomTabBar/Preview Content\""; 276 | DEVELOPMENT_TEAM = Q5Q99Q7248; 277 | ENABLE_PREVIEWS = YES; 278 | INFOPLIST_FILE = CustomTabBar/Info.plist; 279 | IPHONEOS_DEPLOYMENT_TARGET = 14.1; 280 | LD_RUNPATH_SEARCH_PATHS = ( 281 | "$(inherited)", 282 | "@executable_path/Frameworks", 283 | ); 284 | PRODUCT_BUNDLE_IDENTIFIER = com.BLCKBIRDS.CustomTabBar; 285 | PRODUCT_NAME = "$(TARGET_NAME)"; 286 | SWIFT_VERSION = 5.0; 287 | TARGETED_DEVICE_FAMILY = "1,2"; 288 | }; 289 | name = Debug; 290 | }; 291 | 45FD0B062548C6CC00F4C892 /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 296 | CODE_SIGN_STYLE = Automatic; 297 | DEVELOPMENT_ASSET_PATHS = "\"CustomTabBar/Preview Content\""; 298 | DEVELOPMENT_TEAM = Q5Q99Q7248; 299 | ENABLE_PREVIEWS = YES; 300 | INFOPLIST_FILE = CustomTabBar/Info.plist; 301 | IPHONEOS_DEPLOYMENT_TARGET = 14.1; 302 | LD_RUNPATH_SEARCH_PATHS = ( 303 | "$(inherited)", 304 | "@executable_path/Frameworks", 305 | ); 306 | PRODUCT_BUNDLE_IDENTIFIER = com.BLCKBIRDS.CustomTabBar; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | SWIFT_VERSION = 5.0; 309 | TARGETED_DEVICE_FAMILY = "1,2"; 310 | }; 311 | name = Release; 312 | }; 313 | /* End XCBuildConfiguration section */ 314 | 315 | /* Begin XCConfigurationList section */ 316 | 45FD0AF02548C6CB00F4C892 /* Build configuration list for PBXProject "CustomTabBar" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | 45FD0B022548C6CC00F4C892 /* Debug */, 320 | 45FD0B032548C6CC00F4C892 /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | 45FD0B042548C6CC00F4C892 /* Build configuration list for PBXNativeTarget "CustomTabBar" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | 45FD0B052548C6CC00F4C892 /* Debug */, 329 | 45FD0B062548C6CC00F4C892 /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | /* End XCConfigurationList section */ 335 | }; 336 | rootObject = 45FD0AED2548C6CB00F4C892 /* Project object */; 337 | } 338 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar.xcodeproj/project.xcworkspace/xcuserdata/andreasschultz.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BLCKBIRDS/CustomTabBarInSwiftUI/2d41a358255f626aa1cbff30011f31ca3801eeb5/CustomTabBarInSwiftUI/CustomTabBar.xcodeproj/project.xcworkspace/xcuserdata/andreasschultz.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar.xcodeproj/xcuserdata/andreasschultz.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CustomTabBar.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/Assets.xcassets/DarkPurple.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.457", 9 | "green" : "0.184", 10 | "red" : "0.331" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/Assets.xcassets/TabBarBackground.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.961", 9 | "green" : "0.951", 10 | "red" : "0.956" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.102", 27 | "green" : "0.101", 28 | "red" : "0.102" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/Assets.xcassets/TabBarHighlight.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.075", 9 | "green" : "0.074", 10 | "red" : "0.074" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.930", 27 | "green" : "0.921", 28 | "red" : "0.925" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // CustomTabBar 4 | // 5 | // Created by BLCKBIRDS 6 | // Visit BLCKBIRDS.COM FOR MORE TUTORIALS 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | 12 | @StateObject var viewRouter: ViewRouter 13 | 14 | @State var showPopUp = false 15 | 16 | var body: some View { 17 | GeometryReader { geometry in 18 | VStack { 19 | Spacer() 20 | switch viewRouter.currentPage { 21 | case .home: 22 | Text("Home") 23 | case .liked: 24 | Text("Liked") 25 | case .records: 26 | Text("Records") 27 | case .user: 28 | Text("User") 29 | } 30 | Spacer() 31 | ZStack { 32 | if showPopUp { 33 | PlusMenu(widthAndHeight: geometry.size.width/7) 34 | .offset(y: -geometry.size.height/6) 35 | } 36 | HStack { 37 | TabBarIcon(viewRouter: viewRouter, assignedPage: .home, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "homekit", tabName: "Home") 38 | TabBarIcon(viewRouter: viewRouter, assignedPage: .liked, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "heart", tabName: "Liked") 39 | ZStack { 40 | Circle() 41 | .foregroundColor(.white) 42 | .frame(width: geometry.size.width/7, height: geometry.size.width/7) 43 | .shadow(radius: 4) 44 | Image(systemName: "plus.circle.fill") 45 | .resizable() 46 | .aspectRatio(contentMode: .fit) 47 | .frame(width: geometry.size.width/7-6 , height: geometry.size.width/7-6) 48 | .foregroundColor(Color("DarkPurple")) 49 | .rotationEffect(Angle(degrees: showPopUp ? 90 : 0)) 50 | } 51 | .offset(y: -geometry.size.height/8/2) 52 | .onTapGesture { 53 | withAnimation { 54 | showPopUp.toggle() 55 | } 56 | } 57 | TabBarIcon(viewRouter: viewRouter, assignedPage: .records, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "waveform", tabName: "Records") 58 | TabBarIcon(viewRouter: viewRouter, assignedPage: .user, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "person.crop.circle", tabName: "Account") 59 | } 60 | .frame(width: geometry.size.width, height: geometry.size.height/8) 61 | .background(Color("TabBarBackground").shadow(radius: 2)) 62 | } 63 | } 64 | .edgesIgnoringSafeArea(.bottom) 65 | } 66 | } 67 | } 68 | 69 | struct ContentView_Previews: PreviewProvider { 70 | static var previews: some View { 71 | ContentView(viewRouter: ViewRouter()) 72 | .preferredColorScheme(.light) 73 | } 74 | } 75 | 76 | struct PlusMenu: View { 77 | 78 | let widthAndHeight: CGFloat 79 | 80 | var body: some View { 81 | HStack(spacing: 50) { 82 | ZStack { 83 | Circle() 84 | .foregroundColor(Color("DarkPurple")) 85 | .frame(width: widthAndHeight, height: widthAndHeight) 86 | Image(systemName: "record.circle") 87 | .resizable() 88 | .aspectRatio(contentMode: .fit) 89 | .padding(15) 90 | .frame(width: widthAndHeight, height: widthAndHeight) 91 | .foregroundColor(.white) 92 | } 93 | ZStack { 94 | Circle() 95 | .foregroundColor(Color("DarkPurple")) 96 | .frame(width: widthAndHeight, height: widthAndHeight) 97 | Image(systemName: "folder") 98 | .resizable() 99 | .aspectRatio(contentMode: .fit) 100 | .padding(15) 101 | .frame(width: widthAndHeight, height: widthAndHeight) 102 | .foregroundColor(.white) 103 | } 104 | } 105 | .transition(.scale) 106 | } 107 | } 108 | 109 | struct TabBarIcon: View { 110 | 111 | @StateObject var viewRouter: ViewRouter 112 | let assignedPage: Page 113 | 114 | let width, height: CGFloat 115 | let systemIconName, tabName: String 116 | 117 | var body: some View { 118 | VStack { 119 | Image(systemName: systemIconName) 120 | .resizable() 121 | .aspectRatio(contentMode: .fit) 122 | .frame(width: width, height: height) 123 | .padding(.top, 10) 124 | Text(tabName) 125 | .font(.footnote) 126 | Spacer() 127 | } 128 | .padding(.horizontal, -4) 129 | .onTapGesture { 130 | viewRouter.currentPage = assignedPage 131 | } 132 | .foregroundColor(viewRouter.currentPage == assignedPage ? Color("TabBarHighlight") : .gray) 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/CustomTabBarApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomTabBarApp.swift 3 | // CustomTabBar 4 | // 5 | // Created by BLCKBIRDS 6 | // Visit BLCKBIRDS.COM FOR MORE TUTORIALS 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct CustomTabBarApp: App { 12 | 13 | @StateObject var viewRouter = ViewRouter() 14 | 15 | var body: some Scene { 16 | WindowGroup { 17 | ContentView(viewRouter: viewRouter) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/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 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | 28 | UIApplicationSupportsIndirectInputEvents 29 | 30 | UILaunchScreen 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CustomTabBarInSwiftUI/CustomTabBar/ViewRouter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewRouter.swift 3 | // CustomTabBar 4 | // 5 | // Created by BLCKBIRDS 6 | // Visit BLCKBIRDS.COM FOR MORE TUTORIALS 7 | 8 | import SwiftUI 9 | 10 | class ViewRouter: ObservableObject { 11 | 12 | @Published var currentPage: Page = .home 13 | 14 | } 15 | 16 | 17 | enum Page { 18 | case home 19 | case liked 20 | case records 21 | case user 22 | } 23 | --------------------------------------------------------------------------------