├── .gitignore ├── InteractiveSpace.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── InteractiveSpace ├── 0.png ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CustomCollectionViewCell.swift ├── FlexibleFlowLayout.swift ├── Info.plist └── ViewController.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # Swift Package Manager 31 | # 32 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 33 | # Packages/ 34 | .build/ 35 | 36 | # CocoaPods 37 | # 38 | # We recommend against adding the Pods directory to your .gitignore. However 39 | # you should judge for yourself, the pros and cons are mentioned at: 40 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 41 | # 42 | # Pods/ 43 | 44 | # Carthage 45 | # 46 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 47 | # Carthage/Checkouts 48 | 49 | Carthage/Build 50 | 51 | # fastlane 52 | # 53 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 54 | # screenshots whenever they are needed. 55 | # For more information about the recommended setup visit: 56 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 57 | 58 | fastlane/report.xml 59 | fastlane/screenshots 60 | -------------------------------------------------------------------------------- /InteractiveSpace.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1C916CBB1C15F05C009795C0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C916CBA1C15F05C009795C0 /* AppDelegate.swift */; }; 11 | 1C916CBD1C15F05C009795C0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C916CBC1C15F05C009795C0 /* ViewController.swift */; }; 12 | 1C916CC01C15F05C009795C0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CBE1C15F05C009795C0 /* Main.storyboard */; }; 13 | 1C916CC21C15F05C009795C0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CC11C15F05C009795C0 /* Assets.xcassets */; }; 14 | 1C916CC51C15F05C009795C0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CC31C15F05C009795C0 /* LaunchScreen.storyboard */; }; 15 | 1C916CD01C15F143009795C0 /* CustomCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C916CCF1C15F143009795C0 /* CustomCollectionViewCell.swift */; }; 16 | 1C916CDA1C15F24D009795C0 /* 0.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD11C15F24D009795C0 /* 0.png */; }; 17 | 1C916CDB1C15F24D009795C0 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD21C15F24D009795C0 /* 1.png */; }; 18 | 1C916CDC1C15F24D009795C0 /* 2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD31C15F24D009795C0 /* 2.png */; }; 19 | 1C916CDE1C15F24D009795C0 /* 4.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD51C15F24D009795C0 /* 4.png */; }; 20 | 1C916CDF1C15F24D009795C0 /* 5.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD61C15F24D009795C0 /* 5.png */; }; 21 | 1C916CE01C15F24D009795C0 /* 6.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD71C15F24D009795C0 /* 6.png */; }; 22 | 1C916CE11C15F24D009795C0 /* 7.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD81C15F24D009795C0 /* 7.png */; }; 23 | 1C916CE21C15F24D009795C0 /* 3.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C916CD91C15F24D009795C0 /* 3.png */; }; 24 | 1C916CE51C15F8EC009795C0 /* FlexibleFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C916CE41C15F8EC009795C0 /* FlexibleFlowLayout.swift */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 1C916CB71C15F05C009795C0 /* InteractiveSpace.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InteractiveSpace.app; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 1C916CBA1C15F05C009795C0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 30 | 1C916CBC1C15F05C009795C0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 31 | 1C916CBF1C15F05C009795C0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 32 | 1C916CC11C15F05C009795C0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 33 | 1C916CC41C15F05C009795C0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 34 | 1C916CC61C15F05C009795C0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 1C916CCF1C15F143009795C0 /* CustomCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomCollectionViewCell.swift; sourceTree = ""; }; 36 | 1C916CD11C15F24D009795C0 /* 0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 0.png; sourceTree = ""; }; 37 | 1C916CD21C15F24D009795C0 /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 1.png; sourceTree = ""; }; 38 | 1C916CD31C15F24D009795C0 /* 2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 2.png; sourceTree = ""; }; 39 | 1C916CD51C15F24D009795C0 /* 4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 4.png; sourceTree = ""; }; 40 | 1C916CD61C15F24D009795C0 /* 5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 5.png; sourceTree = ""; }; 41 | 1C916CD71C15F24D009795C0 /* 6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 6.png; sourceTree = ""; }; 42 | 1C916CD81C15F24D009795C0 /* 7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 7.png; sourceTree = ""; }; 43 | 1C916CD91C15F24D009795C0 /* 3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 3.png; sourceTree = ""; }; 44 | 1C916CE41C15F8EC009795C0 /* FlexibleFlowLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlexibleFlowLayout.swift; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 1C916CB41C15F05C009795C0 /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 1C916CAE1C15F05C009795C0 = { 59 | isa = PBXGroup; 60 | children = ( 61 | 1C916CB91C15F05C009795C0 /* InteractiveSpace */, 62 | 1C916CB81C15F05C009795C0 /* Products */, 63 | ); 64 | sourceTree = ""; 65 | }; 66 | 1C916CB81C15F05C009795C0 /* Products */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 1C916CB71C15F05C009795C0 /* InteractiveSpace.app */, 70 | ); 71 | name = Products; 72 | sourceTree = ""; 73 | }; 74 | 1C916CB91C15F05C009795C0 /* InteractiveSpace */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 1C916CCC1C15F069009795C0 /* App Global */, 78 | 1C916CCD1C15F070009795C0 /* Controller */, 79 | 1C916CCE1C15F07A009795C0 /* View */, 80 | ); 81 | path = InteractiveSpace; 82 | sourceTree = ""; 83 | }; 84 | 1C916CCC1C15F069009795C0 /* App Global */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 1C916CBA1C15F05C009795C0 /* AppDelegate.swift */, 88 | 1C916CC61C15F05C009795C0 /* Info.plist */, 89 | ); 90 | name = "App Global"; 91 | sourceTree = ""; 92 | }; 93 | 1C916CCD1C15F070009795C0 /* Controller */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 1C916CBC1C15F05C009795C0 /* ViewController.swift */, 97 | ); 98 | name = Controller; 99 | sourceTree = ""; 100 | }; 101 | 1C916CCE1C15F07A009795C0 /* View */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 1C916CC11C15F05C009795C0 /* Assets.xcassets */, 105 | 1C916CCF1C15F143009795C0 /* CustomCollectionViewCell.swift */, 106 | 1C916CE41C15F8EC009795C0 /* FlexibleFlowLayout.swift */, 107 | 1C916CC31C15F05C009795C0 /* LaunchScreen.storyboard */, 108 | 1C916CBE1C15F05C009795C0 /* Main.storyboard */, 109 | 1C916CE31C15F256009795C0 /* Pictures */, 110 | ); 111 | name = View; 112 | sourceTree = ""; 113 | }; 114 | 1C916CE31C15F256009795C0 /* Pictures */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 1C916CD11C15F24D009795C0 /* 0.png */, 118 | 1C916CD21C15F24D009795C0 /* 1.png */, 119 | 1C916CD31C15F24D009795C0 /* 2.png */, 120 | 1C916CD91C15F24D009795C0 /* 3.png */, 121 | 1C916CD51C15F24D009795C0 /* 4.png */, 122 | 1C916CD61C15F24D009795C0 /* 5.png */, 123 | 1C916CD71C15F24D009795C0 /* 6.png */, 124 | 1C916CD81C15F24D009795C0 /* 7.png */, 125 | ); 126 | name = Pictures; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | 1C916CB61C15F05C009795C0 /* InteractiveSpace */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = 1C916CC91C15F05C009795C0 /* Build configuration list for PBXNativeTarget "InteractiveSpace" */; 135 | buildPhases = ( 136 | 1C916CB31C15F05C009795C0 /* Sources */, 137 | 1C916CB41C15F05C009795C0 /* Frameworks */, 138 | 1C916CB51C15F05C009795C0 /* Resources */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = InteractiveSpace; 145 | productName = InteractiveSpace; 146 | productReference = 1C916CB71C15F05C009795C0 /* InteractiveSpace.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 1C916CAF1C15F05C009795C0 /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastSwiftUpdateCheck = 0710; 156 | LastUpgradeCheck = 0800; 157 | ORGANIZATIONNAME = "Michael Babiy"; 158 | TargetAttributes = { 159 | 1C916CB61C15F05C009795C0 = { 160 | CreatedOnToolsVersion = 7.1.1; 161 | LastSwiftMigration = 0800; 162 | }; 163 | }; 164 | }; 165 | buildConfigurationList = 1C916CB21C15F05C009795C0 /* Build configuration list for PBXProject "InteractiveSpace" */; 166 | compatibilityVersion = "Xcode 3.2"; 167 | developmentRegion = English; 168 | hasScannedForEncodings = 0; 169 | knownRegions = ( 170 | en, 171 | Base, 172 | ); 173 | mainGroup = 1C916CAE1C15F05C009795C0; 174 | productRefGroup = 1C916CB81C15F05C009795C0 /* Products */; 175 | projectDirPath = ""; 176 | projectRoot = ""; 177 | targets = ( 178 | 1C916CB61C15F05C009795C0 /* InteractiveSpace */, 179 | ); 180 | }; 181 | /* End PBXProject section */ 182 | 183 | /* Begin PBXResourcesBuildPhase section */ 184 | 1C916CB51C15F05C009795C0 /* Resources */ = { 185 | isa = PBXResourcesBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | 1C916CE21C15F24D009795C0 /* 3.png in Resources */, 189 | 1C916CE11C15F24D009795C0 /* 7.png in Resources */, 190 | 1C916CDC1C15F24D009795C0 /* 2.png in Resources */, 191 | 1C916CDA1C15F24D009795C0 /* 0.png in Resources */, 192 | 1C916CC51C15F05C009795C0 /* LaunchScreen.storyboard in Resources */, 193 | 1C916CC21C15F05C009795C0 /* Assets.xcassets in Resources */, 194 | 1C916CE01C15F24D009795C0 /* 6.png in Resources */, 195 | 1C916CDE1C15F24D009795C0 /* 4.png in Resources */, 196 | 1C916CC01C15F05C009795C0 /* Main.storyboard in Resources */, 197 | 1C916CDF1C15F24D009795C0 /* 5.png in Resources */, 198 | 1C916CDB1C15F24D009795C0 /* 1.png in Resources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXResourcesBuildPhase section */ 203 | 204 | /* Begin PBXSourcesBuildPhase section */ 205 | 1C916CB31C15F05C009795C0 /* Sources */ = { 206 | isa = PBXSourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 1C916CE51C15F8EC009795C0 /* FlexibleFlowLayout.swift in Sources */, 210 | 1C916CBD1C15F05C009795C0 /* ViewController.swift in Sources */, 211 | 1C916CD01C15F143009795C0 /* CustomCollectionViewCell.swift in Sources */, 212 | 1C916CBB1C15F05C009795C0 /* AppDelegate.swift in Sources */, 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | }; 216 | /* End PBXSourcesBuildPhase section */ 217 | 218 | /* Begin PBXVariantGroup section */ 219 | 1C916CBE1C15F05C009795C0 /* Main.storyboard */ = { 220 | isa = PBXVariantGroup; 221 | children = ( 222 | 1C916CBF1C15F05C009795C0 /* Base */, 223 | ); 224 | name = Main.storyboard; 225 | sourceTree = ""; 226 | }; 227 | 1C916CC31C15F05C009795C0 /* LaunchScreen.storyboard */ = { 228 | isa = PBXVariantGroup; 229 | children = ( 230 | 1C916CC41C15F05C009795C0 /* Base */, 231 | ); 232 | name = LaunchScreen.storyboard; 233 | sourceTree = ""; 234 | }; 235 | /* End PBXVariantGroup section */ 236 | 237 | /* Begin XCBuildConfiguration section */ 238 | 1C916CC71C15F05C009795C0 /* Debug */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 243 | CLANG_CXX_LIBRARY = "libc++"; 244 | CLANG_ENABLE_MODULES = YES; 245 | CLANG_ENABLE_OBJC_ARC = YES; 246 | CLANG_WARN_BOOL_CONVERSION = YES; 247 | CLANG_WARN_CONSTANT_CONVERSION = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INT_CONVERSION = YES; 252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 253 | CLANG_WARN_UNREACHABLE_CODE = YES; 254 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 255 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 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 = gnu99; 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 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 275 | MTL_ENABLE_DEBUG_INFO = YES; 276 | ONLY_ACTIVE_ARCH = YES; 277 | SDKROOT = iphoneos; 278 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | }; 281 | name = Debug; 282 | }; 283 | 1C916CC81C15F05C009795C0 /* Release */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ALWAYS_SEARCH_USER_PATHS = NO; 287 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 288 | CLANG_CXX_LIBRARY = "libc++"; 289 | CLANG_ENABLE_MODULES = YES; 290 | CLANG_ENABLE_OBJC_ARC = YES; 291 | CLANG_WARN_BOOL_CONVERSION = YES; 292 | CLANG_WARN_CONSTANT_CONVERSION = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_EMPTY_BODY = YES; 295 | CLANG_WARN_ENUM_CONVERSION = YES; 296 | CLANG_WARN_INT_CONVERSION = YES; 297 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 298 | CLANG_WARN_UNREACHABLE_CODE = YES; 299 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 300 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 301 | COPY_PHASE_STRIP = NO; 302 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 303 | ENABLE_NS_ASSERTIONS = NO; 304 | ENABLE_STRICT_OBJC_MSGSEND = YES; 305 | GCC_C_LANGUAGE_STANDARD = gnu99; 306 | GCC_NO_COMMON_BLOCKS = YES; 307 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 308 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 309 | GCC_WARN_UNDECLARED_SELECTOR = YES; 310 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 311 | GCC_WARN_UNUSED_FUNCTION = YES; 312 | GCC_WARN_UNUSED_VARIABLE = YES; 313 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 314 | MTL_ENABLE_DEBUG_INFO = NO; 315 | SDKROOT = iphoneos; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | VALIDATE_PRODUCT = YES; 318 | }; 319 | name = Release; 320 | }; 321 | 1C916CCA1C15F05C009795C0 /* Debug */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 325 | INFOPLIST_FILE = InteractiveSpace/Info.plist; 326 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 327 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 328 | PRODUCT_BUNDLE_IDENTIFIER = com.michaelbabiy.InteractiveSpace; 329 | PRODUCT_NAME = "$(TARGET_NAME)"; 330 | SWIFT_VERSION = 3.0; 331 | }; 332 | name = Debug; 333 | }; 334 | 1C916CCB1C15F05C009795C0 /* Release */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 338 | INFOPLIST_FILE = InteractiveSpace/Info.plist; 339 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 340 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 341 | PRODUCT_BUNDLE_IDENTIFIER = com.michaelbabiy.InteractiveSpace; 342 | PRODUCT_NAME = "$(TARGET_NAME)"; 343 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 344 | SWIFT_VERSION = 3.0; 345 | }; 346 | name = Release; 347 | }; 348 | /* End XCBuildConfiguration section */ 349 | 350 | /* Begin XCConfigurationList section */ 351 | 1C916CB21C15F05C009795C0 /* Build configuration list for PBXProject "InteractiveSpace" */ = { 352 | isa = XCConfigurationList; 353 | buildConfigurations = ( 354 | 1C916CC71C15F05C009795C0 /* Debug */, 355 | 1C916CC81C15F05C009795C0 /* Release */, 356 | ); 357 | defaultConfigurationIsVisible = 0; 358 | defaultConfigurationName = Release; 359 | }; 360 | 1C916CC91C15F05C009795C0 /* Build configuration list for PBXNativeTarget "InteractiveSpace" */ = { 361 | isa = XCConfigurationList; 362 | buildConfigurations = ( 363 | 1C916CCA1C15F05C009795C0 /* Debug */, 364 | 1C916CCB1C15F05C009795C0 /* Release */, 365 | ); 366 | defaultConfigurationIsVisible = 0; 367 | defaultConfigurationName = Release; 368 | }; 369 | /* End XCConfigurationList section */ 370 | }; 371 | rootObject = 1C916CAF1C15F05C009795C0 /* Project object */; 372 | } 373 | -------------------------------------------------------------------------------- /InteractiveSpace.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InteractiveSpace/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/0.png -------------------------------------------------------------------------------- /InteractiveSpace/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/1.png -------------------------------------------------------------------------------- /InteractiveSpace/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/2.png -------------------------------------------------------------------------------- /InteractiveSpace/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/3.png -------------------------------------------------------------------------------- /InteractiveSpace/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/4.png -------------------------------------------------------------------------------- /InteractiveSpace/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/5.png -------------------------------------------------------------------------------- /InteractiveSpace/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/6.png -------------------------------------------------------------------------------- /InteractiveSpace/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbabiy/InteractiveSpace/be32d24e57a16086db9bc03b1a6823b518790a54/InteractiveSpace/7.png -------------------------------------------------------------------------------- /InteractiveSpace/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // InteractiveSpace 4 | // 5 | // Created by Michael Babiy on 12/7/15. 6 | // Copyright © 2015 Michael Babiy. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | 13 | class AppDelegate: UIResponder, UIApplicationDelegate 14 | { 15 | var window: UIWindow? 16 | 17 | private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool 18 | { 19 | return true 20 | } 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /InteractiveSpace/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /InteractiveSpace/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /InteractiveSpace/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /InteractiveSpace/CustomCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomCollectionViewCell.swift 3 | // InteractiveSpace 4 | // 5 | // Created by Michael Babiy on 12/7/15. 6 | // Copyright © 2015 Michael Babiy. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CustomCollectionViewCell: UICollectionViewCell 12 | { 13 | @IBOutlet weak var imageView: UIImageView! 14 | 15 | var image: UIImage? { 16 | didSet { 17 | self.imageView.image = self.image 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /InteractiveSpace/FlexibleFlowLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FlexibleFlowLayout.swift 3 | // InteractiveSpace 4 | // 5 | // Created by Michael Babiy on 12/7/15. 6 | // Copyright © 2015 Michael Babiy. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FlexibleFlowLayout: UICollectionViewFlowLayout 12 | { 13 | let frame: CGRect 14 | let columns: Int 15 | let interitemSpacing: CGFloat 16 | let lineSpacing: CGFloat 17 | let interitemSpacingOffset: CGFloat 18 | 19 | init(frame: CGRect = UIScreen.main.bounds, colums: Int = 3, interitemSpacing: CGFloat = 2.0, lineSpacing: CGFloat = 2.0) 20 | { 21 | self.frame = frame 22 | self.columns = colums 23 | self.interitemSpacing = interitemSpacing 24 | self.lineSpacing = lineSpacing 25 | self.interitemSpacingOffset = (self.interitemSpacing * CGFloat(self.columns - 1)) 26 | 27 | super.init() 28 | self.setup() 29 | } 30 | 31 | required init?(coder aDecoder: NSCoder) 32 | { 33 | fatalError("init(coder:) has not been implemented") 34 | } 35 | 36 | func setup() 37 | { 38 | let availableWidth = self.frame.width - self.interitemSpacingOffset 39 | let itemWidth = availableWidth / CGFloat(self.columns) 40 | self.minimumInteritemSpacing = self.interitemSpacing 41 | self.minimumLineSpacing = self.lineSpacing 42 | self.itemSize = CGSize(width: itemWidth, height: itemWidth) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /InteractiveSpace/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /InteractiveSpace/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // InteractiveSpace 4 | // 5 | // Created by Michael Babiy on 12/7/15. 6 | // Copyright © 2015 Michael Babiy. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource 12 | { 13 | @IBOutlet weak var collectionView: UICollectionView! 14 | 15 | let smallLayout = FlexibleFlowLayout(colums: 3) 16 | let mediumLayout = FlexibleFlowLayout(colums: 2) 17 | let largeLayout = FlexibleFlowLayout(colums: 1) 18 | var transitionLayout: UICollectionViewTransitionLayout? 19 | 20 | var postPinchTransitionCompleted = true 21 | var pinchDirectionDetermined = false 22 | var initialPinchScale: CGFloat = 0.0 23 | var pinchPoint: CGPoint = CGPoint(x: 0, y: 0) 24 | 25 | var datasource = [UIImage]() { 26 | didSet { 27 | self.collectionView.reloadData() 28 | } 29 | } 30 | 31 | override func viewDidLoad() 32 | { 33 | super.viewDidLoad() 34 | self.setupAppearance() 35 | self.setupSource() 36 | self.setupPinchGestureRecognizer() 37 | } 38 | 39 | override func didReceiveMemoryWarning() 40 | { 41 | super.didReceiveMemoryWarning() 42 | } 43 | 44 | func setupAppearance() 45 | { 46 | self.collectionView.collectionViewLayout = self.smallLayout 47 | } 48 | 49 | func setupSource() 50 | { 51 | for i in 0...7 { 52 | guard let image = UIImage(named: "\(i)") else {return} 53 | self.datasource.append(image) 54 | } 55 | } 56 | 57 | func setupPinchGestureRecognizer() 58 | { 59 | self.collectionView.addGestureRecognizer(UIPinchGestureRecognizer(target: self, action: #selector(ViewController.handlePinchGestureRecognizer(_:)))) 60 | } 61 | 62 | func handlePinchGestureRecognizer(_ gesture: UIPinchGestureRecognizer) 63 | { 64 | if gesture.velocity < 0 && self.collectionView.collectionViewLayout == self.smallLayout { return } 65 | 66 | if self.postPinchTransitionCompleted { 67 | 68 | // ... Gesture Began ... // 69 | if (gesture.state == .began) { 70 | self.initialPinchScale = gesture.scale 71 | self.pinchDirectionDetermined = false 72 | } 73 | 74 | if (gesture.state == .changed) && self.pinchDirectionDetermined == false { 75 | 76 | self.pinchDirectionDetermined = true 77 | self.pinchPoint = gesture.location(in: gesture.view) 78 | 79 | let endLayout = self.nextLayoutForVelocity(gesture.velocity) 80 | 81 | if endLayout != self.collectionView.collectionViewLayout { 82 | self.transitionLayout = self.collectionView.startInteractiveTransition(to: endLayout, completion: { (completed, finished) -> Void in 83 | if completed { 84 | self.transitionLayout = nil 85 | self.postPinchTransitionCompleted = true 86 | } 87 | }) 88 | } 89 | } 90 | 91 | guard let transitionLayout = self.transitionLayout else {return} 92 | transitionLayout.transitionProgress = fabs(self.initialPinchScale - gesture.scale) / self.initialPinchScale 93 | 94 | // ... Gesture Ended ... // 95 | if (gesture.state == .ended) { 96 | transitionLayout.transitionProgress > 0.25 ? self.collectionView.finishInteractiveTransition() : self.collectionView.cancelInteractiveTransition() 97 | self.postPinchTransitionCompleted = false 98 | } 99 | } 100 | } 101 | 102 | func nextLayoutForVelocity(_ velocity: CGFloat) -> UICollectionViewFlowLayout 103 | { 104 | if velocity > 0 { 105 | if self.collectionView.collectionViewLayout == self.smallLayout { 106 | return self.mediumLayout; 107 | } else if self.collectionView.collectionViewLayout == self.mediumLayout { 108 | return self.largeLayout; 109 | } else { 110 | return self.largeLayout; 111 | } 112 | } else { 113 | if self.collectionView.collectionViewLayout == self.largeLayout { 114 | return self.mediumLayout; 115 | } else { 116 | return self.smallLayout; 117 | } 118 | } 119 | } 120 | 121 | // MARK: UICollectionView 122 | 123 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int 124 | { 125 | return self.datasource.count 126 | } 127 | 128 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell 129 | { 130 | let customCell = collectionView.dequeueReusableCell(withReuseIdentifier: "CustomCollectionViewCell", for: indexPath) as! CustomCollectionViewCell 131 | customCell.image = self.datasource[(indexPath as NSIndexPath).row] 132 | return customCell 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InteractiveSpace 2 | 3 | Sample project demonstrating interactive transition between collection view layouts. 4 | 5 | See InteractiveSpace in action: https://www.youtube.com/watch?v=8waSgt28t2U 6 | 7 | twitter: @michaelbabiy 8 | 9 | in: in/michaelbabiy 10 | --------------------------------------------------------------------------------