├── .gitignore ├── MultiplatformSidebar.xcodeproj └── project.pbxproj ├── Preview.png ├── README.md ├── Shared ├── AppSidebarNavigation.swift ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── ContentView.swift ├── MultiplatformSidebarApp.swift └── SmoothieFavoriteButton.swift ├── iOS ├── AppTabNavigation.swift └── Info.plist └── macOS ├── Info.plist └── macOS.entitlements /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/xcode,macos 3 | 4 | ### macOS ### 5 | # General 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | 10 | # Icon must end with two \r 11 | Icon 12 | 13 | # Thumbnails 14 | ._* 15 | 16 | # Files that might appear in the root of a volume 17 | .DocumentRevisions-V100 18 | .fseventsd 19 | .Spotlight-V100 20 | .TemporaryItems 21 | .Trashes 22 | .VolumeIcon.icns 23 | .com.apple.timemachine.donotpresent 24 | 25 | # Directories potentially created on remote AFP share 26 | .AppleDB 27 | .AppleDesktop 28 | Network Trash Folder 29 | Temporary Items 30 | .apdisk 31 | 32 | ### Xcode ### 33 | # Xcode 34 | # 35 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 36 | 37 | ## User settings 38 | xcuserdata/ 39 | 40 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 41 | *.xcscmblueprint 42 | *.xccheckout 43 | 44 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 45 | build/ 46 | DerivedData/ 47 | *.moved-aside 48 | *.pbxuser 49 | !default.pbxuser 50 | *.mode1v3 51 | !default.mode1v3 52 | *.mode2v3 53 | !default.mode2v3 54 | *.perspectivev3 55 | !default.perspectivev3 56 | 57 | ### Xcode Patch ### 58 | *.xcodeproj/* 59 | !*.xcodeproj/project.pbxproj 60 | !*.xcodeproj/xcshareddata/ 61 | !*.xcworkspace/contents.xcworkspacedata 62 | /*.gcno 63 | 64 | 65 | # End of https://www.gitignore.io/api/xcode,macos -------------------------------------------------------------------------------- /MultiplatformSidebar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B12F487125E68B44008B18CF /* MultiplatformSidebarApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F485E25E68B43008B18CF /* MultiplatformSidebarApp.swift */; }; 11 | B12F487225E68B44008B18CF /* MultiplatformSidebarApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F485E25E68B43008B18CF /* MultiplatformSidebarApp.swift */; }; 12 | B12F487325E68B44008B18CF /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F485F25E68B43008B18CF /* ContentView.swift */; }; 13 | B12F487425E68B44008B18CF /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F485F25E68B43008B18CF /* ContentView.swift */; }; 14 | B12F487525E68B44008B18CF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B12F486025E68B44008B18CF /* Assets.xcassets */; }; 15 | B12F487625E68B44008B18CF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B12F486025E68B44008B18CF /* Assets.xcassets */; }; 16 | B12F488225E68C10008B18CF /* AppTabNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F488125E68C10008B18CF /* AppTabNavigation.swift */; }; 17 | B12F488625E68C26008B18CF /* AppSidebarNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F488525E68C26008B18CF /* AppSidebarNavigation.swift */; }; 18 | B12F488725E68C26008B18CF /* AppSidebarNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F488525E68C26008B18CF /* AppSidebarNavigation.swift */; }; 19 | B12F488B25E68C9C008B18CF /* SmoothieFavoriteButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F488A25E68C9C008B18CF /* SmoothieFavoriteButton.swift */; }; 20 | B12F488C25E68C9C008B18CF /* SmoothieFavoriteButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12F488A25E68C9C008B18CF /* SmoothieFavoriteButton.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | B12F485E25E68B43008B18CF /* MultiplatformSidebarApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiplatformSidebarApp.swift; sourceTree = ""; }; 25 | B12F485F25E68B43008B18CF /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 26 | B12F486025E68B44008B18CF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | B12F486525E68B44008B18CF /* MultiplatformSidebar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultiplatformSidebar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | B12F486825E68B44008B18CF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | B12F486D25E68B44008B18CF /* MultiplatformSidebar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultiplatformSidebar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | B12F486F25E68B44008B18CF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | B12F487025E68B44008B18CF /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = ""; }; 32 | B12F488125E68C10008B18CF /* AppTabNavigation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppTabNavigation.swift; sourceTree = ""; }; 33 | B12F488525E68C26008B18CF /* AppSidebarNavigation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppSidebarNavigation.swift; sourceTree = ""; }; 34 | B12F488A25E68C9C008B18CF /* SmoothieFavoriteButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SmoothieFavoriteButton.swift; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | B12F486225E68B44008B18CF /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | B12F486A25E68B44008B18CF /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | B12F485825E68B43008B18CF = { 56 | isa = PBXGroup; 57 | children = ( 58 | B12F485D25E68B43008B18CF /* Shared */, 59 | B12F486725E68B44008B18CF /* iOS */, 60 | B12F486E25E68B44008B18CF /* macOS */, 61 | B12F486625E68B44008B18CF /* Products */, 62 | ); 63 | sourceTree = ""; 64 | }; 65 | B12F485D25E68B43008B18CF /* Shared */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | B12F485E25E68B43008B18CF /* MultiplatformSidebarApp.swift */, 69 | B12F485F25E68B43008B18CF /* ContentView.swift */, 70 | B12F488525E68C26008B18CF /* AppSidebarNavigation.swift */, 71 | B12F488A25E68C9C008B18CF /* SmoothieFavoriteButton.swift */, 72 | B12F486025E68B44008B18CF /* Assets.xcassets */, 73 | ); 74 | path = Shared; 75 | sourceTree = ""; 76 | }; 77 | B12F486625E68B44008B18CF /* Products */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | B12F486525E68B44008B18CF /* MultiplatformSidebar.app */, 81 | B12F486D25E68B44008B18CF /* MultiplatformSidebar.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | B12F486725E68B44008B18CF /* iOS */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | B12F486825E68B44008B18CF /* Info.plist */, 90 | B12F488125E68C10008B18CF /* AppTabNavigation.swift */, 91 | ); 92 | path = iOS; 93 | sourceTree = ""; 94 | }; 95 | B12F486E25E68B44008B18CF /* macOS */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | B12F486F25E68B44008B18CF /* Info.plist */, 99 | B12F487025E68B44008B18CF /* macOS.entitlements */, 100 | ); 101 | path = macOS; 102 | sourceTree = ""; 103 | }; 104 | /* End PBXGroup section */ 105 | 106 | /* Begin PBXNativeTarget section */ 107 | B12F486425E68B44008B18CF /* MultiplatformSidebar (iOS) */ = { 108 | isa = PBXNativeTarget; 109 | buildConfigurationList = B12F487925E68B44008B18CF /* Build configuration list for PBXNativeTarget "MultiplatformSidebar (iOS)" */; 110 | buildPhases = ( 111 | B12F486125E68B44008B18CF /* Sources */, 112 | B12F486225E68B44008B18CF /* Frameworks */, 113 | B12F486325E68B44008B18CF /* Resources */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = "MultiplatformSidebar (iOS)"; 120 | productName = "MultiplatformSidebar (iOS)"; 121 | productReference = B12F486525E68B44008B18CF /* MultiplatformSidebar.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | B12F486C25E68B44008B18CF /* MultiplatformSidebar (macOS) */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = B12F487C25E68B44008B18CF /* Build configuration list for PBXNativeTarget "MultiplatformSidebar (macOS)" */; 127 | buildPhases = ( 128 | B12F486925E68B44008B18CF /* Sources */, 129 | B12F486A25E68B44008B18CF /* Frameworks */, 130 | B12F486B25E68B44008B18CF /* Resources */, 131 | ); 132 | buildRules = ( 133 | ); 134 | dependencies = ( 135 | ); 136 | name = "MultiplatformSidebar (macOS)"; 137 | productName = "MultiplatformSidebar (macOS)"; 138 | productReference = B12F486D25E68B44008B18CF /* MultiplatformSidebar.app */; 139 | productType = "com.apple.product-type.application"; 140 | }; 141 | /* End PBXNativeTarget section */ 142 | 143 | /* Begin PBXProject section */ 144 | B12F485925E68B43008B18CF /* Project object */ = { 145 | isa = PBXProject; 146 | attributes = { 147 | LastSwiftUpdateCheck = 1230; 148 | LastUpgradeCheck = 1230; 149 | TargetAttributes = { 150 | B12F486425E68B44008B18CF = { 151 | CreatedOnToolsVersion = 12.3; 152 | }; 153 | B12F486C25E68B44008B18CF = { 154 | CreatedOnToolsVersion = 12.3; 155 | }; 156 | }; 157 | }; 158 | buildConfigurationList = B12F485C25E68B43008B18CF /* Build configuration list for PBXProject "MultiplatformSidebar" */; 159 | compatibilityVersion = "Xcode 9.3"; 160 | developmentRegion = en; 161 | hasScannedForEncodings = 0; 162 | knownRegions = ( 163 | en, 164 | Base, 165 | ); 166 | mainGroup = B12F485825E68B43008B18CF; 167 | productRefGroup = B12F486625E68B44008B18CF /* Products */; 168 | projectDirPath = ""; 169 | projectRoot = ""; 170 | targets = ( 171 | B12F486425E68B44008B18CF /* MultiplatformSidebar (iOS) */, 172 | B12F486C25E68B44008B18CF /* MultiplatformSidebar (macOS) */, 173 | ); 174 | }; 175 | /* End PBXProject section */ 176 | 177 | /* Begin PBXResourcesBuildPhase section */ 178 | B12F486325E68B44008B18CF /* Resources */ = { 179 | isa = PBXResourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | B12F487525E68B44008B18CF /* Assets.xcassets in Resources */, 183 | ); 184 | runOnlyForDeploymentPostprocessing = 0; 185 | }; 186 | B12F486B25E68B44008B18CF /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | B12F487625E68B44008B18CF /* Assets.xcassets in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXSourcesBuildPhase section */ 197 | B12F486125E68B44008B18CF /* Sources */ = { 198 | isa = PBXSourcesBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | B12F488625E68C26008B18CF /* AppSidebarNavigation.swift in Sources */, 202 | B12F487325E68B44008B18CF /* ContentView.swift in Sources */, 203 | B12F488B25E68C9C008B18CF /* SmoothieFavoriteButton.swift in Sources */, 204 | B12F487125E68B44008B18CF /* MultiplatformSidebarApp.swift in Sources */, 205 | B12F488225E68C10008B18CF /* AppTabNavigation.swift in Sources */, 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | }; 209 | B12F486925E68B44008B18CF /* Sources */ = { 210 | isa = PBXSourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | B12F487425E68B44008B18CF /* ContentView.swift in Sources */, 214 | B12F487225E68B44008B18CF /* MultiplatformSidebarApp.swift in Sources */, 215 | B12F488725E68C26008B18CF /* AppSidebarNavigation.swift in Sources */, 216 | B12F488C25E68C9C008B18CF /* SmoothieFavoriteButton.swift in Sources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXSourcesBuildPhase section */ 221 | 222 | /* Begin XCBuildConfiguration section */ 223 | B12F487725E68B44008B18CF /* Debug */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_ANALYZER_NONNULL = YES; 228 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 229 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 230 | CLANG_CXX_LIBRARY = "libc++"; 231 | CLANG_ENABLE_MODULES = YES; 232 | CLANG_ENABLE_OBJC_ARC = YES; 233 | CLANG_ENABLE_OBJC_WEAK = YES; 234 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 235 | CLANG_WARN_BOOL_CONVERSION = YES; 236 | CLANG_WARN_COMMA = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 239 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 240 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 241 | CLANG_WARN_EMPTY_BODY = YES; 242 | CLANG_WARN_ENUM_CONVERSION = YES; 243 | CLANG_WARN_INFINITE_RECURSION = YES; 244 | CLANG_WARN_INT_CONVERSION = YES; 245 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 246 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 247 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 248 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 249 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 250 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 251 | CLANG_WARN_STRICT_PROTOTYPES = YES; 252 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 253 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 254 | CLANG_WARN_UNREACHABLE_CODE = YES; 255 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 256 | COPY_PHASE_STRIP = NO; 257 | DEBUG_INFORMATION_FORMAT = dwarf; 258 | ENABLE_STRICT_OBJC_MSGSEND = YES; 259 | ENABLE_TESTABILITY = YES; 260 | GCC_C_LANGUAGE_STANDARD = gnu11; 261 | GCC_DYNAMIC_NO_PIC = NO; 262 | GCC_NO_COMMON_BLOCKS = YES; 263 | GCC_OPTIMIZATION_LEVEL = 0; 264 | GCC_PREPROCESSOR_DEFINITIONS = ( 265 | "DEBUG=1", 266 | "$(inherited)", 267 | ); 268 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 269 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 270 | GCC_WARN_UNDECLARED_SELECTOR = YES; 271 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 272 | GCC_WARN_UNUSED_FUNCTION = YES; 273 | GCC_WARN_UNUSED_VARIABLE = YES; 274 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 275 | MTL_FAST_MATH = YES; 276 | ONLY_ACTIVE_ARCH = YES; 277 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 278 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 279 | }; 280 | name = Debug; 281 | }; 282 | B12F487825E68B44008B18CF /* Release */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ALWAYS_SEARCH_USER_PATHS = NO; 286 | CLANG_ANALYZER_NONNULL = YES; 287 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 288 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 289 | CLANG_CXX_LIBRARY = "libc++"; 290 | CLANG_ENABLE_MODULES = YES; 291 | CLANG_ENABLE_OBJC_ARC = YES; 292 | CLANG_ENABLE_OBJC_WEAK = YES; 293 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 294 | CLANG_WARN_BOOL_CONVERSION = YES; 295 | CLANG_WARN_COMMA = YES; 296 | CLANG_WARN_CONSTANT_CONVERSION = YES; 297 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 300 | CLANG_WARN_EMPTY_BODY = YES; 301 | CLANG_WARN_ENUM_CONVERSION = YES; 302 | CLANG_WARN_INFINITE_RECURSION = YES; 303 | CLANG_WARN_INT_CONVERSION = YES; 304 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 305 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 306 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 307 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 308 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 309 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 310 | CLANG_WARN_STRICT_PROTOTYPES = YES; 311 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 312 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 313 | CLANG_WARN_UNREACHABLE_CODE = YES; 314 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 315 | COPY_PHASE_STRIP = NO; 316 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 317 | ENABLE_NS_ASSERTIONS = NO; 318 | ENABLE_STRICT_OBJC_MSGSEND = YES; 319 | GCC_C_LANGUAGE_STANDARD = gnu11; 320 | GCC_NO_COMMON_BLOCKS = YES; 321 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 322 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 323 | GCC_WARN_UNDECLARED_SELECTOR = YES; 324 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 325 | GCC_WARN_UNUSED_FUNCTION = YES; 326 | GCC_WARN_UNUSED_VARIABLE = YES; 327 | MTL_ENABLE_DEBUG_INFO = NO; 328 | MTL_FAST_MATH = YES; 329 | SWIFT_COMPILATION_MODE = wholemodule; 330 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 331 | }; 332 | name = Release; 333 | }; 334 | B12F487A25E68B44008B18CF /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 338 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 339 | CODE_SIGN_STYLE = Automatic; 340 | DEVELOPMENT_TEAM = ""; 341 | ENABLE_PREVIEWS = YES; 342 | INFOPLIST_FILE = iOS/Info.plist; 343 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 344 | LD_RUNPATH_SEARCH_PATHS = ( 345 | "$(inherited)", 346 | "@executable_path/Frameworks", 347 | ); 348 | PRODUCT_BUNDLE_IDENTIFIER = br.com.marcosatanaka.MultiplatformSidebar; 349 | PRODUCT_NAME = MultiplatformSidebar; 350 | SDKROOT = iphoneos; 351 | SWIFT_VERSION = 5.0; 352 | TARGETED_DEVICE_FAMILY = "1,2"; 353 | }; 354 | name = Debug; 355 | }; 356 | B12F487B25E68B44008B18CF /* Release */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 360 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 361 | CODE_SIGN_STYLE = Automatic; 362 | DEVELOPMENT_TEAM = ""; 363 | ENABLE_PREVIEWS = YES; 364 | INFOPLIST_FILE = iOS/Info.plist; 365 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 366 | LD_RUNPATH_SEARCH_PATHS = ( 367 | "$(inherited)", 368 | "@executable_path/Frameworks", 369 | ); 370 | PRODUCT_BUNDLE_IDENTIFIER = br.com.marcosatanaka.MultiplatformSidebar; 371 | PRODUCT_NAME = MultiplatformSidebar; 372 | SDKROOT = iphoneos; 373 | SWIFT_VERSION = 5.0; 374 | TARGETED_DEVICE_FAMILY = "1,2"; 375 | VALIDATE_PRODUCT = YES; 376 | }; 377 | name = Release; 378 | }; 379 | B12F487D25E68B44008B18CF /* Debug */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 383 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 384 | CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements; 385 | CODE_SIGN_STYLE = Automatic; 386 | COMBINE_HIDPI_IMAGES = YES; 387 | DEVELOPMENT_TEAM = ""; 388 | ENABLE_HARDENED_RUNTIME = YES; 389 | ENABLE_PREVIEWS = YES; 390 | INFOPLIST_FILE = macOS/Info.plist; 391 | LD_RUNPATH_SEARCH_PATHS = ( 392 | "$(inherited)", 393 | "@executable_path/../Frameworks", 394 | ); 395 | MACOSX_DEPLOYMENT_TARGET = 11.0; 396 | PRODUCT_BUNDLE_IDENTIFIER = br.com.marcosatanaka.MultiplatformSidebar; 397 | PRODUCT_NAME = MultiplatformSidebar; 398 | SDKROOT = macosx; 399 | SWIFT_VERSION = 5.0; 400 | }; 401 | name = Debug; 402 | }; 403 | B12F487E25E68B44008B18CF /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 407 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 408 | CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements; 409 | CODE_SIGN_STYLE = Automatic; 410 | COMBINE_HIDPI_IMAGES = YES; 411 | DEVELOPMENT_TEAM = ""; 412 | ENABLE_HARDENED_RUNTIME = YES; 413 | ENABLE_PREVIEWS = YES; 414 | INFOPLIST_FILE = macOS/Info.plist; 415 | LD_RUNPATH_SEARCH_PATHS = ( 416 | "$(inherited)", 417 | "@executable_path/../Frameworks", 418 | ); 419 | MACOSX_DEPLOYMENT_TARGET = 11.0; 420 | PRODUCT_BUNDLE_IDENTIFIER = br.com.marcosatanaka.MultiplatformSidebar; 421 | PRODUCT_NAME = MultiplatformSidebar; 422 | SDKROOT = macosx; 423 | SWIFT_VERSION = 5.0; 424 | }; 425 | name = Release; 426 | }; 427 | /* End XCBuildConfiguration section */ 428 | 429 | /* Begin XCConfigurationList section */ 430 | B12F485C25E68B43008B18CF /* Build configuration list for PBXProject "MultiplatformSidebar" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | B12F487725E68B44008B18CF /* Debug */, 434 | B12F487825E68B44008B18CF /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | defaultConfigurationName = Release; 438 | }; 439 | B12F487925E68B44008B18CF /* Build configuration list for PBXNativeTarget "MultiplatformSidebar (iOS)" */ = { 440 | isa = XCConfigurationList; 441 | buildConfigurations = ( 442 | B12F487A25E68B44008B18CF /* Debug */, 443 | B12F487B25E68B44008B18CF /* Release */, 444 | ); 445 | defaultConfigurationIsVisible = 0; 446 | defaultConfigurationName = Release; 447 | }; 448 | B12F487C25E68B44008B18CF /* Build configuration list for PBXNativeTarget "MultiplatformSidebar (macOS)" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | B12F487D25E68B44008B18CF /* Debug */, 452 | B12F487E25E68B44008B18CF /* Release */, 453 | ); 454 | defaultConfigurationIsVisible = 0; 455 | defaultConfigurationName = Release; 456 | }; 457 | /* End XCConfigurationList section */ 458 | }; 459 | rootObject = B12F485925E68B43008B18CF /* Project object */; 460 | } 461 | -------------------------------------------------------------------------------- /Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosatanaka/multiplatform-sidebar-swiftui/c23355886015df71c700ca7d99db26cfafb61acd/Preview.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Multiplatform Sidebar SwiftUI 2 | 3 | This is a sample project demonstrating how to implement the new Sidebar UI for a multiplatform app (iOS, iPadOS, macOS) built with SwiftUI. 4 | 5 | ![Preview.png](Preview.png) 6 | 7 | ## Documentation links 8 | 9 | - [Human Interface Guidelines for the Sidebar](https://developer.apple.com/design/human-interface-guidelines/ios/bars/sidebars/) 10 | - [Fruta: Building a Feature-Rich App with SwiftUI](https://developer.apple.com/documentation/swiftui/fruta_building_a_feature-rich_app_with_swiftui) 11 | 12 | ## WWDC20 videos 13 | 14 | - [Design for iPad](https://developer.apple.com/videos/play/wwdc2020/10206/) 15 | - [What's new in SwiftUI](https://developer.apple.com/videos/play/wwdc2020/10041/) 16 | - [Stacks, Grids, and Outlines in SwiftUI](https://developer.apple.com/videos/play/wwdc2020/10031/) 17 | -------------------------------------------------------------------------------- /Shared/AppSidebarNavigation.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct AppSidebarNavigation: View { 4 | 5 | enum NavigationItem { 6 | case listenNow 7 | case browse 8 | case radio 9 | case search 10 | case artists 11 | case recentlyAdded 12 | case albums 13 | case songs 14 | } 15 | 16 | @State private var selection: NavigationItem? = .listenNow 17 | 18 | var sidebar: some View { 19 | List(selection: $selection) { 20 | NavigationLink(destination: Text("Listen Now"), tag: NavigationItem.listenNow, selection: $selection) { 21 | Label("Listen Now", systemImage: "play.circle") 22 | } 23 | .tag(NavigationItem.listenNow) 24 | 25 | NavigationLink(destination: Text("Browse"), tag: NavigationItem.browse, selection: $selection) { 26 | Label("Browse", systemImage: "square.grid.2x2") 27 | } 28 | .tag(NavigationItem.browse) 29 | 30 | NavigationLink(destination: Text("Radio"), tag: NavigationItem.radio, selection: $selection) { 31 | Label("Radio", systemImage: "dot.radiowaves.left.and.right") 32 | } 33 | .tag(NavigationItem.radio) 34 | 35 | NavigationLink(destination: Text("Search"), tag: NavigationItem.search, selection: $selection) { 36 | Label("Search", systemImage: "magnifyingglass") 37 | } 38 | .tag(NavigationItem.search) 39 | 40 | Section(header: Text("Library")) { 41 | NavigationLink(destination: Text("Recently Added"), tag: NavigationItem.recentlyAdded, selection: $selection) { 42 | Label("Recently Added", systemImage: "clock") 43 | } 44 | .tag(NavigationItem.recentlyAdded) 45 | 46 | NavigationLink(destination: Text("Artists"), tag: NavigationItem.artists, selection: $selection) { 47 | Label("Artists", systemImage: "music.mic") 48 | } 49 | .tag(NavigationItem.artists) 50 | 51 | NavigationLink(destination: Text("Albums"), tag: NavigationItem.albums, selection: $selection) { 52 | Label("Albums", systemImage: "square.stack") 53 | } 54 | .tag(NavigationItem.albums) 55 | 56 | NavigationLink(destination: Text("Songs"), tag: NavigationItem.songs, selection: $selection) { 57 | Label("Songs", systemImage: "music.note") 58 | } 59 | .tag(NavigationItem.songs) 60 | } 61 | } 62 | .listStyle(SidebarListStyle()) 63 | .navigationTitle("Music") 64 | } 65 | 66 | var body: some View { 67 | NavigationView { 68 | sidebar 69 | 70 | Text("Select an item") 71 | .foregroundColor(.secondary) 72 | .toolbar { 73 | AddButton() 74 | .disabled(true) 75 | } 76 | } 77 | } 78 | } 79 | 80 | struct AppSidebarNavigation_Previews: PreviewProvider { 81 | static var previews: some View { 82 | AppSidebarNavigation() 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Shared/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0x44", 9 | "green" : "0x3C", 10 | "red" : "0xFC" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Shared/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 | "idiom" : "mac", 95 | "scale" : "1x", 96 | "size" : "16x16" 97 | }, 98 | { 99 | "idiom" : "mac", 100 | "scale" : "2x", 101 | "size" : "16x16" 102 | }, 103 | { 104 | "idiom" : "mac", 105 | "scale" : "1x", 106 | "size" : "32x32" 107 | }, 108 | { 109 | "idiom" : "mac", 110 | "scale" : "2x", 111 | "size" : "32x32" 112 | }, 113 | { 114 | "idiom" : "mac", 115 | "scale" : "1x", 116 | "size" : "128x128" 117 | }, 118 | { 119 | "idiom" : "mac", 120 | "scale" : "2x", 121 | "size" : "128x128" 122 | }, 123 | { 124 | "idiom" : "mac", 125 | "scale" : "1x", 126 | "size" : "256x256" 127 | }, 128 | { 129 | "idiom" : "mac", 130 | "scale" : "2x", 131 | "size" : "256x256" 132 | }, 133 | { 134 | "idiom" : "mac", 135 | "scale" : "1x", 136 | "size" : "512x512" 137 | }, 138 | { 139 | "idiom" : "mac", 140 | "scale" : "2x", 141 | "size" : "512x512" 142 | } 143 | ], 144 | "info" : { 145 | "author" : "xcode", 146 | "version" : 1 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Shared/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Shared/ContentView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct ContentView: View { 4 | #if os(iOS) 5 | @Environment(\.horizontalSizeClass) private var horizontalSizeClass 6 | #endif 7 | 8 | var body: some View { 9 | #if os(iOS) 10 | if horizontalSizeClass == .compact { 11 | AppTabNavigation() 12 | } else { 13 | AppSidebarNavigation() 14 | } 15 | #else 16 | AppSidebarNavigation() 17 | #endif 18 | } 19 | } 20 | 21 | struct ContentView_Previews: PreviewProvider { 22 | static var previews: some View { 23 | ContentView() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Shared/MultiplatformSidebarApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | @main 4 | struct MultiplatformSidebarApp: App { 5 | var body: some Scene { 6 | WindowGroup { 7 | ContentView() 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Shared/SmoothieFavoriteButton.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct AddButton: View { 4 | var body: some View { 5 | Button(action: onAddTap) { 6 | Label("Add", systemImage: "plus.circle") 7 | } 8 | .accessibility(label: Text("Add")) 9 | } 10 | 11 | func onAddTap() { 12 | } 13 | } 14 | 15 | struct AddButton_Previews: PreviewProvider { 16 | static var previews: some View { 17 | AddButton() 18 | .padding() 19 | .previewLayout(.sizeThatFits) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/AppTabNavigation.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct AppTabNavigation: View { 4 | 5 | enum Tab { 6 | case listenNow 7 | case browse 8 | case radio 9 | case library 10 | case search 11 | } 12 | 13 | @State private var selection: Tab = .listenNow 14 | 15 | var body: some View { 16 | TabView(selection: $selection) { 17 | NavigationView { 18 | Text("Listen Now") 19 | } 20 | .tabItem { 21 | Label("Listen Now", systemImage: "play.circle") 22 | } 23 | .tag(Tab.listenNow) 24 | 25 | NavigationView { 26 | Text("Browse") 27 | } 28 | .tabItem { 29 | Label("Browse", systemImage: "square.grid.2x2") 30 | } 31 | .tag(Tab.browse) 32 | 33 | NavigationView { 34 | Text("Radio") 35 | } 36 | .tabItem { 37 | Label("Radio", systemImage: "dot.radiowaves.left.and.right") 38 | } 39 | .tag(Tab.radio) 40 | 41 | NavigationView { 42 | Text("Library") 43 | } 44 | .tabItem { 45 | Label("Library", systemImage: "square.stack") 46 | } 47 | .tag(Tab.library) 48 | 49 | NavigationView { 50 | Text("Search") 51 | } 52 | .tabItem { 53 | Label("Search", systemImage: "magnifyingglass") 54 | } 55 | .tag(Tab.search) 56 | } 57 | } 58 | } 59 | 60 | struct AppTabNavigation_Previews: PreviewProvider { 61 | static var previews: some View { 62 | AppTabNavigation() 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /iOS/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 | -------------------------------------------------------------------------------- /macOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | 26 | 27 | -------------------------------------------------------------------------------- /macOS/macOS.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | --------------------------------------------------------------------------------