├── README.md ├── SwipeUp.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── philipdavis.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── SwipeUp ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── ContentView.swift ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json └── SwipeUpApp.swift /README.md: -------------------------------------------------------------------------------- 1 | # swiftui-vertical-paging-example 2 | Credit to Gary Tokmen for this bit of Geometry Reader code: https://blog.prototypr.io/how-to-vertical-paging-in-swiftui-f0e4afa739ba 3 | 4 | https://user-images.githubusercontent.com/3452573/140370435-b4c30105-8381-45fa-9c56-389448009624.mp4 5 | -------------------------------------------------------------------------------- /SwipeUp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 48CA967E273396EA003C3F3F /* SwipeUpApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CA967D273396EA003C3F3F /* SwipeUpApp.swift */; }; 11 | 48CA9680273396EA003C3F3F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CA967F273396EA003C3F3F /* ContentView.swift */; }; 12 | 48CA9682273396EC003C3F3F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 48CA9681273396EC003C3F3F /* Assets.xcassets */; }; 13 | 48CA9685273396EC003C3F3F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 48CA9684273396EC003C3F3F /* Preview Assets.xcassets */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 48CA967A273396EA003C3F3F /* SwipeUp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwipeUp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | 48CA967D273396EA003C3F3F /* SwipeUpApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeUpApp.swift; sourceTree = ""; }; 19 | 48CA967F273396EA003C3F3F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 20 | 48CA9681273396EC003C3F3F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 21 | 48CA9684273396EC003C3F3F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 22 | /* End PBXFileReference section */ 23 | 24 | /* Begin PBXFrameworksBuildPhase section */ 25 | 48CA9677273396E9003C3F3F /* Frameworks */ = { 26 | isa = PBXFrameworksBuildPhase; 27 | buildActionMask = 2147483647; 28 | files = ( 29 | ); 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXFrameworksBuildPhase section */ 33 | 34 | /* Begin PBXGroup section */ 35 | 48CA9671273396E9003C3F3F = { 36 | isa = PBXGroup; 37 | children = ( 38 | 48CA967C273396EA003C3F3F /* SwipeUp */, 39 | 48CA967B273396EA003C3F3F /* Products */, 40 | ); 41 | sourceTree = ""; 42 | }; 43 | 48CA967B273396EA003C3F3F /* Products */ = { 44 | isa = PBXGroup; 45 | children = ( 46 | 48CA967A273396EA003C3F3F /* SwipeUp.app */, 47 | ); 48 | name = Products; 49 | sourceTree = ""; 50 | }; 51 | 48CA967C273396EA003C3F3F /* SwipeUp */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | 48CA967D273396EA003C3F3F /* SwipeUpApp.swift */, 55 | 48CA967F273396EA003C3F3F /* ContentView.swift */, 56 | 48CA9681273396EC003C3F3F /* Assets.xcassets */, 57 | 48CA9683273396EC003C3F3F /* Preview Content */, 58 | ); 59 | path = SwipeUp; 60 | sourceTree = ""; 61 | }; 62 | 48CA9683273396EC003C3F3F /* Preview Content */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 48CA9684273396EC003C3F3F /* Preview Assets.xcassets */, 66 | ); 67 | path = "Preview Content"; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 48CA9679273396E9003C3F3F /* SwipeUp */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 48CA9688273396EC003C3F3F /* Build configuration list for PBXNativeTarget "SwipeUp" */; 76 | buildPhases = ( 77 | 48CA9676273396E9003C3F3F /* Sources */, 78 | 48CA9677273396E9003C3F3F /* Frameworks */, 79 | 48CA9678273396E9003C3F3F /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = SwipeUp; 86 | productName = SwipeUp; 87 | productReference = 48CA967A273396EA003C3F3F /* SwipeUp.app */; 88 | productType = "com.apple.product-type.application"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 48CA9672273396E9003C3F3F /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | BuildIndependentTargetsInParallel = 1; 97 | LastSwiftUpdateCheck = 1300; 98 | LastUpgradeCheck = 1300; 99 | TargetAttributes = { 100 | 48CA9679273396E9003C3F3F = { 101 | CreatedOnToolsVersion = 13.0; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = 48CA9675273396E9003C3F3F /* Build configuration list for PBXProject "SwipeUp" */; 106 | compatibilityVersion = "Xcode 13.0"; 107 | developmentRegion = en; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | Base, 112 | ); 113 | mainGroup = 48CA9671273396E9003C3F3F; 114 | productRefGroup = 48CA967B273396EA003C3F3F /* Products */; 115 | projectDirPath = ""; 116 | projectRoot = ""; 117 | targets = ( 118 | 48CA9679273396E9003C3F3F /* SwipeUp */, 119 | ); 120 | }; 121 | /* End PBXProject section */ 122 | 123 | /* Begin PBXResourcesBuildPhase section */ 124 | 48CA9678273396E9003C3F3F /* Resources */ = { 125 | isa = PBXResourcesBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | 48CA9685273396EC003C3F3F /* Preview Assets.xcassets in Resources */, 129 | 48CA9682273396EC003C3F3F /* Assets.xcassets in Resources */, 130 | ); 131 | runOnlyForDeploymentPostprocessing = 0; 132 | }; 133 | /* End PBXResourcesBuildPhase section */ 134 | 135 | /* Begin PBXSourcesBuildPhase section */ 136 | 48CA9676273396E9003C3F3F /* Sources */ = { 137 | isa = PBXSourcesBuildPhase; 138 | buildActionMask = 2147483647; 139 | files = ( 140 | 48CA9680273396EA003C3F3F /* ContentView.swift in Sources */, 141 | 48CA967E273396EA003C3F3F /* SwipeUpApp.swift in Sources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXSourcesBuildPhase section */ 146 | 147 | /* Begin XCBuildConfiguration section */ 148 | 48CA9686273396EC003C3F3F /* Debug */ = { 149 | isa = XCBuildConfiguration; 150 | buildSettings = { 151 | ALWAYS_SEARCH_USER_PATHS = NO; 152 | CLANG_ANALYZER_NONNULL = YES; 153 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 154 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 155 | CLANG_CXX_LIBRARY = "libc++"; 156 | CLANG_ENABLE_MODULES = YES; 157 | CLANG_ENABLE_OBJC_ARC = YES; 158 | CLANG_ENABLE_OBJC_WEAK = YES; 159 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 160 | CLANG_WARN_BOOL_CONVERSION = YES; 161 | CLANG_WARN_COMMA = YES; 162 | CLANG_WARN_CONSTANT_CONVERSION = YES; 163 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 164 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 165 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 166 | CLANG_WARN_EMPTY_BODY = YES; 167 | CLANG_WARN_ENUM_CONVERSION = YES; 168 | CLANG_WARN_INFINITE_RECURSION = YES; 169 | CLANG_WARN_INT_CONVERSION = YES; 170 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 171 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 172 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 173 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 174 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 175 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 176 | CLANG_WARN_STRICT_PROTOTYPES = YES; 177 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 178 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 179 | CLANG_WARN_UNREACHABLE_CODE = YES; 180 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 181 | COPY_PHASE_STRIP = NO; 182 | DEBUG_INFORMATION_FORMAT = dwarf; 183 | ENABLE_STRICT_OBJC_MSGSEND = YES; 184 | ENABLE_TESTABILITY = YES; 185 | GCC_C_LANGUAGE_STANDARD = gnu11; 186 | GCC_DYNAMIC_NO_PIC = NO; 187 | GCC_NO_COMMON_BLOCKS = YES; 188 | GCC_OPTIMIZATION_LEVEL = 0; 189 | GCC_PREPROCESSOR_DEFINITIONS = ( 190 | "DEBUG=1", 191 | "$(inherited)", 192 | ); 193 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 194 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 195 | GCC_WARN_UNDECLARED_SELECTOR = YES; 196 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 197 | GCC_WARN_UNUSED_FUNCTION = YES; 198 | GCC_WARN_UNUSED_VARIABLE = YES; 199 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 200 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 201 | MTL_FAST_MATH = YES; 202 | ONLY_ACTIVE_ARCH = YES; 203 | SDKROOT = iphoneos; 204 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 205 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 206 | }; 207 | name = Debug; 208 | }; 209 | 48CA9687273396EC003C3F3F /* Release */ = { 210 | isa = XCBuildConfiguration; 211 | buildSettings = { 212 | ALWAYS_SEARCH_USER_PATHS = NO; 213 | CLANG_ANALYZER_NONNULL = YES; 214 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 215 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 216 | CLANG_CXX_LIBRARY = "libc++"; 217 | CLANG_ENABLE_MODULES = YES; 218 | CLANG_ENABLE_OBJC_ARC = YES; 219 | CLANG_ENABLE_OBJC_WEAK = YES; 220 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 221 | CLANG_WARN_BOOL_CONVERSION = YES; 222 | CLANG_WARN_COMMA = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 225 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 226 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 227 | CLANG_WARN_EMPTY_BODY = YES; 228 | CLANG_WARN_ENUM_CONVERSION = YES; 229 | CLANG_WARN_INFINITE_RECURSION = YES; 230 | CLANG_WARN_INT_CONVERSION = YES; 231 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 232 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 233 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 234 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 235 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 236 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 237 | CLANG_WARN_STRICT_PROTOTYPES = YES; 238 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 239 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 240 | CLANG_WARN_UNREACHABLE_CODE = YES; 241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 242 | COPY_PHASE_STRIP = NO; 243 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 244 | ENABLE_NS_ASSERTIONS = NO; 245 | ENABLE_STRICT_OBJC_MSGSEND = YES; 246 | GCC_C_LANGUAGE_STANDARD = gnu11; 247 | GCC_NO_COMMON_BLOCKS = YES; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 250 | GCC_WARN_UNDECLARED_SELECTOR = YES; 251 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 252 | GCC_WARN_UNUSED_FUNCTION = YES; 253 | GCC_WARN_UNUSED_VARIABLE = YES; 254 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 255 | MTL_ENABLE_DEBUG_INFO = NO; 256 | MTL_FAST_MATH = YES; 257 | SDKROOT = iphoneos; 258 | SWIFT_COMPILATION_MODE = wholemodule; 259 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 260 | VALIDATE_PRODUCT = YES; 261 | }; 262 | name = Release; 263 | }; 264 | 48CA9689273396EC003C3F3F /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 268 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 269 | CODE_SIGN_STYLE = Automatic; 270 | CURRENT_PROJECT_VERSION = 1; 271 | DEVELOPMENT_ASSET_PATHS = "\"SwipeUp/Preview Content\""; 272 | DEVELOPMENT_TEAM = 78369ZC29J; 273 | ENABLE_PREVIEWS = YES; 274 | GENERATE_INFOPLIST_FILE = YES; 275 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 276 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 277 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 278 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 279 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 280 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 281 | LD_RUNPATH_SEARCH_PATHS = ( 282 | "$(inherited)", 283 | "@executable_path/Frameworks", 284 | ); 285 | MARKETING_VERSION = 1.0; 286 | PRODUCT_BUNDLE_IDENTIFIER = com.philipcdavis.SwipeUp; 287 | PRODUCT_NAME = "$(TARGET_NAME)"; 288 | SWIFT_EMIT_LOC_STRINGS = YES; 289 | SWIFT_VERSION = 5.0; 290 | TARGETED_DEVICE_FAMILY = "1,2"; 291 | }; 292 | name = Debug; 293 | }; 294 | 48CA968A273396EC003C3F3F /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 299 | CODE_SIGN_STYLE = Automatic; 300 | CURRENT_PROJECT_VERSION = 1; 301 | DEVELOPMENT_ASSET_PATHS = "\"SwipeUp/Preview Content\""; 302 | DEVELOPMENT_TEAM = 78369ZC29J; 303 | ENABLE_PREVIEWS = YES; 304 | GENERATE_INFOPLIST_FILE = YES; 305 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 306 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 307 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 308 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 309 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 310 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 311 | LD_RUNPATH_SEARCH_PATHS = ( 312 | "$(inherited)", 313 | "@executable_path/Frameworks", 314 | ); 315 | MARKETING_VERSION = 1.0; 316 | PRODUCT_BUNDLE_IDENTIFIER = com.philipcdavis.SwipeUp; 317 | PRODUCT_NAME = "$(TARGET_NAME)"; 318 | SWIFT_EMIT_LOC_STRINGS = YES; 319 | SWIFT_VERSION = 5.0; 320 | TARGETED_DEVICE_FAMILY = "1,2"; 321 | }; 322 | name = Release; 323 | }; 324 | /* End XCBuildConfiguration section */ 325 | 326 | /* Begin XCConfigurationList section */ 327 | 48CA9675273396E9003C3F3F /* Build configuration list for PBXProject "SwipeUp" */ = { 328 | isa = XCConfigurationList; 329 | buildConfigurations = ( 330 | 48CA9686273396EC003C3F3F /* Debug */, 331 | 48CA9687273396EC003C3F3F /* Release */, 332 | ); 333 | defaultConfigurationIsVisible = 0; 334 | defaultConfigurationName = Release; 335 | }; 336 | 48CA9688273396EC003C3F3F /* Build configuration list for PBXNativeTarget "SwipeUp" */ = { 337 | isa = XCConfigurationList; 338 | buildConfigurations = ( 339 | 48CA9689273396EC003C3F3F /* Debug */, 340 | 48CA968A273396EC003C3F3F /* Release */, 341 | ); 342 | defaultConfigurationIsVisible = 0; 343 | defaultConfigurationName = Release; 344 | }; 345 | /* End XCConfigurationList section */ 346 | }; 347 | rootObject = 48CA9672273396E9003C3F3F /* Project object */; 348 | } 349 | -------------------------------------------------------------------------------- /SwipeUp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwipeUp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SwipeUp.xcodeproj/xcuserdata/philipdavis.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SwipeUp.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SwipeUp/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 | -------------------------------------------------------------------------------- /SwipeUp/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 | -------------------------------------------------------------------------------- /SwipeUp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SwipeUp/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SwipeUp 4 | // 5 | // Created by Philip Davis on 11/3/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | let images: [String] = [ 12 | "https://images.unsplash.com/photo-1515266591878-f93e32bc5937?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1287&q=80", 13 | "https://images.unsplash.com/photo-1520663302610-fb61c8b64766?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1470&q=80", 14 | "https://images.unsplash.com/photo-1610847033737-0c62d8d14534?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1472&q=80", 15 | "https://images.unsplash.com/photo-1550439694-0cc5e82d1179?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1470&q=80", 16 | "https://images.unsplash.com/photo-1485550409059-9afb054cada4?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1365&q=80", 17 | "https://images.unsplash.com/photo-1635297383087-8842f98f908a?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1286&q=80", 18 | "https://images.unsplash.com/photo-1501975558162-0be7b8ca95ea?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1287&q=80", 19 | ] 20 | 21 | var body: some View { 22 | ZStack { 23 | // Credit to Gary Tokmen for this bit of Geometry Reader code: https://blog.prototypr.io/how-to-vertical-paging-in-swiftui-f0e4afa739ba 24 | 25 | GeometryReader { proxy in 26 | TabView { 27 | ForEach(images, id: \.self) { image in 28 | AsyncImage(url: URL(string: image)) { image in 29 | image.resizable() 30 | .scaledToFill() 31 | } placeholder: { 32 | ProgressView() 33 | } 34 | } 35 | .rotationEffect(.degrees(-90)) // Rotate content 36 | .frame( 37 | width: proxy.size.width, 38 | height: proxy.size.height 39 | ) 40 | } 41 | .frame( 42 | width: proxy.size.height, // Height & width swap 43 | height: proxy.size.width 44 | ) 45 | .rotationEffect(.degrees(90), anchor: .topLeading) // Rotate TabView 46 | .offset(x: proxy.size.width) // Offset back into screens bounds 47 | .tabViewStyle( 48 | PageTabViewStyle(indexDisplayMode: .never) 49 | ) 50 | } 51 | VStack { 52 | Spacer() 53 | TabBar() 54 | }.padding(40) 55 | }.statusBar(hidden: true) 56 | .ignoresSafeArea() 57 | } 58 | } 59 | 60 | struct ContentView_Previews: PreviewProvider { 61 | static var previews: some View { 62 | ContentView() 63 | } 64 | } 65 | 66 | 67 | struct TabBar: View { 68 | var body: some View { 69 | HStack(spacing: 32) { 70 | TabBarIcon(icon: "photo.on.rectangle.angled", isActive: true) 71 | TabBarIcon(icon: "person.crop.circle") 72 | } 73 | .padding(EdgeInsets(top: 14, leading: 30, bottom: 16, trailing: 30)) 74 | .background(.thinMaterial) 75 | .cornerRadius(100) 76 | .shadow(color: Color.black.opacity(0.3), radius: 16, x: 0, y: 16) 77 | .shadow(color: Color.black.opacity(0.2), radius: 4, x: 0, y: 1) 78 | } 79 | } 80 | 81 | struct TabBarIcon: View { 82 | let icon: String 83 | var isActive: Bool? = false 84 | 85 | var body: some View { 86 | HStack { 87 | Image(systemName: icon) 88 | .foregroundColor(isActive! ? .primary : .secondary) 89 | .font(.system(size: 24)) 90 | 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /SwipeUp/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SwipeUp/SwipeUpApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwipeUpApp.swift 3 | // SwipeUp 4 | // 5 | // Created by Philip Davis on 11/3/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct SwipeUpApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | --------------------------------------------------------------------------------