├── ParallaxCarousel.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── zelynasillas.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── ParallaxCarousel ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Chicago.imageset │ │ ├── Chicago.jpg │ │ └── Contents.json │ ├── Contents.json │ ├── NYC.imageset │ │ ├── Contents.json │ │ └── NYC.jpeg │ ├── SF.imageset │ │ ├── Contents.json │ │ └── SF.jpeg │ └── Seattle.imageset │ │ ├── Contents.json │ │ └── Seattle.jpeg ├── ContentView.swift ├── Location.swift ├── ParallaxCarouselApp.swift └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json └── README.md /ParallaxCarousel.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CED1FFE32AAD10C00059D83C /* ParallaxCarouselApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = CED1FFE22AAD10C00059D83C /* ParallaxCarouselApp.swift */; }; 11 | CED1FFE52AAD10C00059D83C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CED1FFE42AAD10C00059D83C /* ContentView.swift */; }; 12 | CED1FFE72AAD10C50059D83C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CED1FFE62AAD10C50059D83C /* Assets.xcassets */; }; 13 | CED1FFEA2AAD10C50059D83C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CED1FFE92AAD10C50059D83C /* Preview Assets.xcassets */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | CED1FFDF2AAD10C00059D83C /* ParallaxCarousel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ParallaxCarousel.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | CED1FFE22AAD10C00059D83C /* ParallaxCarouselApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParallaxCarouselApp.swift; sourceTree = ""; }; 19 | CED1FFE42AAD10C00059D83C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 20 | CED1FFE62AAD10C50059D83C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 21 | CED1FFE92AAD10C50059D83C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 22 | /* End PBXFileReference section */ 23 | 24 | /* Begin PBXFrameworksBuildPhase section */ 25 | CED1FFDC2AAD10C00059D83C /* Frameworks */ = { 26 | isa = PBXFrameworksBuildPhase; 27 | buildActionMask = 2147483647; 28 | files = ( 29 | ); 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXFrameworksBuildPhase section */ 33 | 34 | /* Begin PBXGroup section */ 35 | CED1FFD62AAD10C00059D83C = { 36 | isa = PBXGroup; 37 | children = ( 38 | CED1FFE12AAD10C00059D83C /* ParallaxCarousel */, 39 | CED1FFE02AAD10C00059D83C /* Products */, 40 | ); 41 | sourceTree = ""; 42 | }; 43 | CED1FFE02AAD10C00059D83C /* Products */ = { 44 | isa = PBXGroup; 45 | children = ( 46 | CED1FFDF2AAD10C00059D83C /* ParallaxCarousel.app */, 47 | ); 48 | name = Products; 49 | sourceTree = ""; 50 | }; 51 | CED1FFE12AAD10C00059D83C /* ParallaxCarousel */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | CED1FFE22AAD10C00059D83C /* ParallaxCarouselApp.swift */, 55 | CED1FFE42AAD10C00059D83C /* ContentView.swift */, 56 | CED1FFE62AAD10C50059D83C /* Assets.xcassets */, 57 | CED1FFE82AAD10C50059D83C /* Preview Content */, 58 | ); 59 | path = ParallaxCarousel; 60 | sourceTree = ""; 61 | }; 62 | CED1FFE82AAD10C50059D83C /* Preview Content */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | CED1FFE92AAD10C50059D83C /* Preview Assets.xcassets */, 66 | ); 67 | path = "Preview Content"; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | CED1FFDE2AAD10C00059D83C /* ParallaxCarousel */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = CED1FFED2AAD10C50059D83C /* Build configuration list for PBXNativeTarget "ParallaxCarousel" */; 76 | buildPhases = ( 77 | CED1FFDB2AAD10C00059D83C /* Sources */, 78 | CED1FFDC2AAD10C00059D83C /* Frameworks */, 79 | CED1FFDD2AAD10C00059D83C /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = ParallaxCarousel; 86 | productName = ParallaxCarousel; 87 | productReference = CED1FFDF2AAD10C00059D83C /* ParallaxCarousel.app */; 88 | productType = "com.apple.product-type.application"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | CED1FFD72AAD10C00059D83C /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | BuildIndependentTargetsInParallel = 1; 97 | LastSwiftUpdateCheck = 1500; 98 | LastUpgradeCheck = 1500; 99 | TargetAttributes = { 100 | CED1FFDE2AAD10C00059D83C = { 101 | CreatedOnToolsVersion = 15.0; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = CED1FFDA2AAD10C00059D83C /* Build configuration list for PBXProject "ParallaxCarousel" */; 106 | compatibilityVersion = "Xcode 14.0"; 107 | developmentRegion = en; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | Base, 112 | ); 113 | mainGroup = CED1FFD62AAD10C00059D83C; 114 | productRefGroup = CED1FFE02AAD10C00059D83C /* Products */; 115 | projectDirPath = ""; 116 | projectRoot = ""; 117 | targets = ( 118 | CED1FFDE2AAD10C00059D83C /* ParallaxCarousel */, 119 | ); 120 | }; 121 | /* End PBXProject section */ 122 | 123 | /* Begin PBXResourcesBuildPhase section */ 124 | CED1FFDD2AAD10C00059D83C /* Resources */ = { 125 | isa = PBXResourcesBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | CED1FFEA2AAD10C50059D83C /* Preview Assets.xcassets in Resources */, 129 | CED1FFE72AAD10C50059D83C /* Assets.xcassets in Resources */, 130 | ); 131 | runOnlyForDeploymentPostprocessing = 0; 132 | }; 133 | /* End PBXResourcesBuildPhase section */ 134 | 135 | /* Begin PBXSourcesBuildPhase section */ 136 | CED1FFDB2AAD10C00059D83C /* Sources */ = { 137 | isa = PBXSourcesBuildPhase; 138 | buildActionMask = 2147483647; 139 | files = ( 140 | CED1FFE52AAD10C00059D83C /* ContentView.swift in Sources */, 141 | CED1FFE32AAD10C00059D83C /* ParallaxCarouselApp.swift in Sources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXSourcesBuildPhase section */ 146 | 147 | /* Begin XCBuildConfiguration section */ 148 | CED1FFEB2AAD10C50059D83C /* Debug */ = { 149 | isa = XCBuildConfiguration; 150 | buildSettings = { 151 | ALWAYS_SEARCH_USER_PATHS = NO; 152 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 153 | CLANG_ANALYZER_NONNULL = YES; 154 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 155 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 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 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 186 | GCC_C_LANGUAGE_STANDARD = gnu17; 187 | GCC_DYNAMIC_NO_PIC = NO; 188 | GCC_NO_COMMON_BLOCKS = YES; 189 | GCC_OPTIMIZATION_LEVEL = 0; 190 | GCC_PREPROCESSOR_DEFINITIONS = ( 191 | "DEBUG=1", 192 | "$(inherited)", 193 | ); 194 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 195 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 196 | GCC_WARN_UNDECLARED_SELECTOR = YES; 197 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 198 | GCC_WARN_UNUSED_FUNCTION = YES; 199 | GCC_WARN_UNUSED_VARIABLE = YES; 200 | IPHONEOS_DEPLOYMENT_TARGET = 17.0; 201 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 202 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 203 | MTL_FAST_MATH = YES; 204 | ONLY_ACTIVE_ARCH = YES; 205 | SDKROOT = iphoneos; 206 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 207 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 208 | }; 209 | name = Debug; 210 | }; 211 | CED1FFEC2AAD10C50059D83C /* Release */ = { 212 | isa = XCBuildConfiguration; 213 | buildSettings = { 214 | ALWAYS_SEARCH_USER_PATHS = NO; 215 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 216 | CLANG_ANALYZER_NONNULL = YES; 217 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 219 | CLANG_ENABLE_MODULES = YES; 220 | CLANG_ENABLE_OBJC_ARC = YES; 221 | CLANG_ENABLE_OBJC_WEAK = YES; 222 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 223 | CLANG_WARN_BOOL_CONVERSION = YES; 224 | CLANG_WARN_COMMA = YES; 225 | CLANG_WARN_CONSTANT_CONVERSION = YES; 226 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 227 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 228 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 229 | CLANG_WARN_EMPTY_BODY = YES; 230 | CLANG_WARN_ENUM_CONVERSION = YES; 231 | CLANG_WARN_INFINITE_RECURSION = YES; 232 | CLANG_WARN_INT_CONVERSION = YES; 233 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 234 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 235 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 236 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 237 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 238 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 239 | CLANG_WARN_STRICT_PROTOTYPES = YES; 240 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 241 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 242 | CLANG_WARN_UNREACHABLE_CODE = YES; 243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 | COPY_PHASE_STRIP = NO; 245 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 246 | ENABLE_NS_ASSERTIONS = NO; 247 | ENABLE_STRICT_OBJC_MSGSEND = YES; 248 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 249 | GCC_C_LANGUAGE_STANDARD = gnu17; 250 | GCC_NO_COMMON_BLOCKS = YES; 251 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 252 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 253 | GCC_WARN_UNDECLARED_SELECTOR = YES; 254 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 255 | GCC_WARN_UNUSED_FUNCTION = YES; 256 | GCC_WARN_UNUSED_VARIABLE = YES; 257 | IPHONEOS_DEPLOYMENT_TARGET = 17.0; 258 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 259 | MTL_ENABLE_DEBUG_INFO = NO; 260 | MTL_FAST_MATH = YES; 261 | SDKROOT = iphoneos; 262 | SWIFT_COMPILATION_MODE = wholemodule; 263 | VALIDATE_PRODUCT = YES; 264 | }; 265 | name = Release; 266 | }; 267 | CED1FFEE2AAD10C50059D83C /* Debug */ = { 268 | isa = XCBuildConfiguration; 269 | buildSettings = { 270 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 271 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 272 | CODE_SIGN_STYLE = Automatic; 273 | CURRENT_PROJECT_VERSION = 1; 274 | DEVELOPMENT_ASSET_PATHS = "\"ParallaxCarousel/Preview Content\""; 275 | DEVELOPMENT_TEAM = 8X2U77VR7B; 276 | ENABLE_PREVIEWS = YES; 277 | GENERATE_INFOPLIST_FILE = YES; 278 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 279 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 280 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 281 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 282 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 283 | LD_RUNPATH_SEARCH_PATHS = ( 284 | "$(inherited)", 285 | "@executable_path/Frameworks", 286 | ); 287 | MARKETING_VERSION = 1.0; 288 | PRODUCT_BUNDLE_IDENTIFIER = com.ZelynaSillas.ParallaxCarousel; 289 | PRODUCT_NAME = "$(TARGET_NAME)"; 290 | SWIFT_EMIT_LOC_STRINGS = YES; 291 | SWIFT_VERSION = 5.0; 292 | TARGETED_DEVICE_FAMILY = "1,2"; 293 | }; 294 | name = Debug; 295 | }; 296 | CED1FFEF2AAD10C50059D83C /* Release */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 300 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 301 | CODE_SIGN_STYLE = Automatic; 302 | CURRENT_PROJECT_VERSION = 1; 303 | DEVELOPMENT_ASSET_PATHS = "\"ParallaxCarousel/Preview Content\""; 304 | DEVELOPMENT_TEAM = 8X2U77VR7B; 305 | ENABLE_PREVIEWS = YES; 306 | GENERATE_INFOPLIST_FILE = YES; 307 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 308 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 309 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 310 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 311 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 312 | LD_RUNPATH_SEARCH_PATHS = ( 313 | "$(inherited)", 314 | "@executable_path/Frameworks", 315 | ); 316 | MARKETING_VERSION = 1.0; 317 | PRODUCT_BUNDLE_IDENTIFIER = com.ZelynaSillas.ParallaxCarousel; 318 | PRODUCT_NAME = "$(TARGET_NAME)"; 319 | SWIFT_EMIT_LOC_STRINGS = YES; 320 | SWIFT_VERSION = 5.0; 321 | TARGETED_DEVICE_FAMILY = "1,2"; 322 | }; 323 | name = Release; 324 | }; 325 | /* End XCBuildConfiguration section */ 326 | 327 | /* Begin XCConfigurationList section */ 328 | CED1FFDA2AAD10C00059D83C /* Build configuration list for PBXProject "ParallaxCarousel" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | CED1FFEB2AAD10C50059D83C /* Debug */, 332 | CED1FFEC2AAD10C50059D83C /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | CED1FFED2AAD10C50059D83C /* Build configuration list for PBXNativeTarget "ParallaxCarousel" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | CED1FFEE2AAD10C50059D83C /* Debug */, 341 | CED1FFEF2AAD10C50059D83C /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | /* End XCConfigurationList section */ 347 | }; 348 | rootObject = CED1FFD72AAD10C00059D83C /* Project object */; 349 | } 350 | -------------------------------------------------------------------------------- /ParallaxCarousel.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ParallaxCarousel.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ParallaxCarousel.xcodeproj/xcuserdata/zelynasillas.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ParallaxCarousel.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ParallaxCarousel/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 | -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/Chicago.imageset/Chicago.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZelynaFarrell/ParallaxCarousel/ddca4a810562453ec5838addae32bbb69073c53c/ParallaxCarousel/Assets.xcassets/Chicago.imageset/Chicago.jpg -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/Chicago.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Chicago.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/NYC.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "NYC.jpeg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/NYC.imageset/NYC.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZelynaFarrell/ParallaxCarousel/ddca4a810562453ec5838addae32bbb69073c53c/ParallaxCarousel/Assets.xcassets/NYC.imageset/NYC.jpeg -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/SF.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "SF.jpeg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/SF.imageset/SF.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZelynaFarrell/ParallaxCarousel/ddca4a810562453ec5838addae32bbb69073c53c/ParallaxCarousel/Assets.xcassets/SF.imageset/SF.jpeg -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/Seattle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Seattle.jpeg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ParallaxCarousel/Assets.xcassets/Seattle.imageset/Seattle.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZelynaFarrell/ParallaxCarousel/ddca4a810562453ec5838addae32bbb69073c53c/ParallaxCarousel/Assets.xcassets/Seattle.imageset/Seattle.jpeg -------------------------------------------------------------------------------- /ParallaxCarousel/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // ParallaxCarousel 4 | // 5 | // Created by Zelyna Sillas on 9/9/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | @State var searchText: String = "" 12 | 13 | var body: some View { 14 | ScrollView(.vertical) { 15 | VStack(spacing: 15) { 16 | Text("Airbnb") 17 | .font(.largeTitle).bold() 18 | .foregroundStyle(.red) 19 | .frame(maxWidth: .infinity, alignment: .leading) 20 | .padding(.top, 20) 21 | .padding(.leading, 13) 22 | 23 | HStack(spacing: 12) { 24 | HStack(spacing: 12) { 25 | Image(systemName: "magnifyingglass") 26 | .foregroundStyle(.gray) 27 | 28 | TextField("Where to?", text: $searchText) 29 | 30 | Image(systemName: "line.3.horizontal.decrease.circle") 31 | .font(.title3) 32 | .foregroundStyle(.gray) 33 | } 34 | .padding(.horizontal, 15) 35 | .padding(.vertical, 10) 36 | .background(.ultraThinMaterial, in: .capsule) 37 | } 38 | 39 | 40 | GeometryReader { geo in 41 | let size = geo.size 42 | 43 | ScrollView(.horizontal) { 44 | HStack(spacing: 5) { 45 | ForEach(locations) { location in 46 | GeometryReader { proxy in 47 | let cardSize = proxy.size 48 | 49 | let minX = min((proxy.frame(in: .scrollView).minX - 30) * 1.4, size.width * 1.4) 50 | 51 | Image(location.image) 52 | .resizable() 53 | .aspectRatio(contentMode: .fill) 54 | .offset(x: -minX) 55 | .frame(width: cardSize.width, height: cardSize.height) 56 | .overlay(LocationOverlay(location)) 57 | .clipShape(.rect(cornerRadius: 15)) 58 | .shadow(color: .black.opacity(0.25), radius: 8, x: 5, y: 10) 59 | } 60 | .frame(width: size.width - 60, height: size.height - 50) 61 | .scrollTransition(.interactive, axis: .horizontal) { view, phase in 62 | view 63 | .scaleEffect(phase.isIdentity ? 1 : 0.95) 64 | } 65 | } 66 | } 67 | .padding(.horizontal, 30) 68 | .scrollTargetLayout() 69 | .frame(height: size.height, alignment: .top) 70 | } 71 | .scrollTargetBehavior(.viewAligned) 72 | .scrollIndicators(.hidden) 73 | } 74 | .frame(height: 500) 75 | .padding(.horizontal, -15) 76 | .padding(.top, 20) 77 | } 78 | .padding(15) 79 | } 80 | .scrollIndicators(.hidden) 81 | } 82 | 83 | @ViewBuilder 84 | func LocationOverlay(_ location: Location) -> some View { 85 | ZStack(alignment: .bottomLeading) { 86 | LinearGradient(colors: [.clear, .clear, .clear, .clear, .clear, .black.opacity(0.1), .black.opacity(0.5), .black 87 | ], startPoint: .top, endPoint: .bottom) 88 | 89 | VStack(alignment: .leading, spacing: 4) { 90 | Text(location.city) 91 | .font(.title2) 92 | .fontWeight(.black) 93 | .foregroundStyle(.white) 94 | 95 | Text(location.country) 96 | .font(.callout) 97 | .foregroundStyle(.white.opacity(0.8)) 98 | } 99 | .padding(20) 100 | } 101 | } 102 | } 103 | 104 | #Preview { 105 | ContentView() 106 | } 107 | 108 | -------------------------------------------------------------------------------- /ParallaxCarousel/Location.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Location.swift 3 | // ParallaxCarousel 4 | // 5 | // Created by Zelyna Sillas on 9/9/23. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Location: Identifiable, Hashable { 11 | var id = UUID() 12 | var city: String 13 | var country: String 14 | var image: String 15 | } 16 | 17 | var locations: [Location] = [ 18 | Location(city: "New York City", country: "USA", image: "NYC"), 19 | Location(city: "San Francisco", country: "USA", image: "SF"), 20 | Location(city: "Seattle", country: "USA", image: "Seattle"), 21 | Location(city: "Chicago", country: "USA", image: "Chicago"), 22 | ] 23 | 24 | -------------------------------------------------------------------------------- /ParallaxCarousel/ParallaxCarouselApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ParallaxCarouselApp.swift 3 | // ParallaxCarousel 4 | // 5 | // Created by Zelyna Sillas on 9/9/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct ParallaxCarouselApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ParallaxCarousel/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #

Parallax Carousel Horizontal Image Scroll

2 | 3 | 4 | ####

This SwiftUI mini-project showcases a parallax carousel with horizontal scrolling functionality. It's designed to provide an interactive and visually appealing way to display images. 5 |

6 | 7 |
8 | 9 | ## **Features** 10 | - Horizontal Carousel: Presents location cards in a horizontal scrolling carousel for an interactive browsing experience. 11 | - Interactive Scroll Transition (iOS 17): Utilizes .scrollTransition with interactive behavior and horizontal axis to apply a dynamic scaling effect on the cards during scrolling. 12 | - Parallax Effect: Implements a parallax effect on card movement, adding depth and visual interest. 13 | - Search Bar Integration: Includes a search bar with a magnifying glass and filter icons for potential search functionality. 14 | - Airbnb-themed UI: Adopts an Airbnb-inspired user interface with a bold red color scheme for a visually appealing design. 15 | 16 |
17 | 18 | ### **Videos and Demos** 19 | https://github.com/ZelynaFarrell/ParallaxCarousel/assets/117409535/e1112a7a-3b5c-437d-bc7f-1cc2a68bd829 20 | 21 | 22 | 23 |
24 | 25 | 26 | ## **Getting Started** 27 | 28 | ### **Prerequisites** 29 | - Xcode (with SwiftUI support) 30 | - iOS Simulator or a physical iOS device 31 | 32 |
33 | 34 | ### **Installation** 35 | - Clone or download the project. 36 | - Open the project in Xcode. 37 | - Build and run the project on the desired simulator or device. 38 | 39 |
40 | 41 | 42 | ### **Usage** 43 | - Launch the app. 44 | - Scroll down to see the Airbnb-themed UI with the search bar and location cards. 45 | - Use the search bar to enter a destination (currently non-functional in this showcase). 46 | - Swipe horizontally to explore different location cards with the parallax effect. 47 | 48 |
49 | 50 | 51 | ### **Code Overview** 52 | - ContentView: The main SwiftUI view containing the entire UI structure. 53 | - OverlayView: A helper function to create an overlay view for each location card. 54 | 55 |
56 | 57 | ### **Libraries Used** 58 | This project uses SwiftUI, Apple's declarative framework for building user interfaces, and does not rely on any external libraries or dependencies. 59 | 60 |
61 | 62 | 63 | ###### **Acknowledgements** 64 | Inspired by Airbnb's UI design. 65 | 66 | --------------------------------------------------------------------------------