├── .gitignore ├── DynamicGridLayout ├── DynamicGridLayout.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── DynamicGridLayout │ ├── AppDelegate.swift │ ├── Supports │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── bg-0.imageset │ │ │ ├── Contents.json │ │ │ └── bg-58.jpg │ │ ├── bg-1.imageset │ │ │ ├── Contents.json │ │ │ └── bg-1.jpg │ │ ├── bg-10.imageset │ │ │ ├── Contents.json │ │ │ └── bg-10.jpg │ │ ├── bg-11.imageset │ │ │ ├── Contents.json │ │ │ └── bg-11.jpg │ │ ├── bg-12.imageset │ │ │ ├── Contents.json │ │ │ └── bg-12.jpg │ │ ├── bg-13.imageset │ │ │ ├── Contents.json │ │ │ └── bg-13.jpg │ │ ├── bg-14.imageset │ │ │ ├── Contents.json │ │ │ └── bg-14.jpg │ │ ├── bg-15.imageset │ │ │ ├── Contents.json │ │ │ └── bg-15.jpg │ │ ├── bg-16.imageset │ │ │ ├── Contents.json │ │ │ └── bg-16.jpg │ │ ├── bg-17.imageset │ │ │ ├── Contents.json │ │ │ └── bg-17.jpg │ │ ├── bg-18.imageset │ │ │ ├── Contents.json │ │ │ └── bg-18.jpg │ │ ├── bg-19.imageset │ │ │ ├── Contents.json │ │ │ └── bg-19.jpg │ │ ├── bg-2.imageset │ │ │ ├── Contents.json │ │ │ └── bg-2.jpg │ │ ├── bg-20.imageset │ │ │ ├── Contents.json │ │ │ └── bg-20.jpg │ │ ├── bg-21.imageset │ │ │ ├── Contents.json │ │ │ └── bg-21.jpg │ │ ├── bg-22.imageset │ │ │ ├── Contents.json │ │ │ └── bg-22.jpg │ │ ├── bg-23.imageset │ │ │ ├── Contents.json │ │ │ └── bg-23.jpg │ │ ├── bg-24.imageset │ │ │ ├── Contents.json │ │ │ └── bg-24.jpg │ │ ├── bg-25.imageset │ │ │ ├── Contents.json │ │ │ └── bg-25.jpg │ │ ├── bg-26.imageset │ │ │ ├── Contents.json │ │ │ └── bg-26.jpg │ │ ├── bg-27.imageset │ │ │ ├── Contents.json │ │ │ └── bg-27.jpg │ │ ├── bg-28.imageset │ │ │ ├── Contents.json │ │ │ └── bg-28.jpg │ │ ├── bg-29.imageset │ │ │ ├── Contents.json │ │ │ └── bg-29.jpg │ │ ├── bg-3.imageset │ │ │ ├── Contents.json │ │ │ └── bg-3.jpg │ │ ├── bg-30.imageset │ │ │ ├── Contents.json │ │ │ └── bg-30.jpg │ │ ├── bg-31.imageset │ │ │ ├── Contents.json │ │ │ └── bg-31.jpg │ │ ├── bg-32.imageset │ │ │ ├── Contents.json │ │ │ └── bg-32.jpg │ │ ├── bg-33.imageset │ │ │ ├── Contents.json │ │ │ └── bg-33.jpg │ │ ├── bg-34.imageset │ │ │ ├── Contents.json │ │ │ └── bg-34.jpg │ │ ├── bg-35.imageset │ │ │ ├── Contents.json │ │ │ └── bg-35.jpg │ │ ├── bg-36.imageset │ │ │ ├── Contents.json │ │ │ └── bg-36.jpg │ │ ├── bg-37.imageset │ │ │ ├── Contents.json │ │ │ └── bg-37.jpg │ │ ├── bg-38.imageset │ │ │ ├── Contents.json │ │ │ └── bg-38.jpg │ │ ├── bg-39.imageset │ │ │ ├── Contents.json │ │ │ └── bg-39.jpg │ │ ├── bg-4.imageset │ │ │ ├── Contents.json │ │ │ └── bg-4.jpg │ │ ├── bg-40.imageset │ │ │ ├── Contents.json │ │ │ └── bg-40.jpg │ │ ├── bg-41.imageset │ │ │ ├── Contents.json │ │ │ └── bg-41.jpg │ │ ├── bg-42.imageset │ │ │ ├── Contents.json │ │ │ └── bg-42.jpg │ │ ├── bg-43.imageset │ │ │ ├── Contents.json │ │ │ └── bg-43.jpg │ │ ├── bg-44.imageset │ │ │ ├── Contents.json │ │ │ └── bg-44.jpg │ │ ├── bg-45.imageset │ │ │ ├── Contents.json │ │ │ └── bg-45.jpg │ │ ├── bg-46.imageset │ │ │ ├── Contents.json │ │ │ └── bg-46.jpg │ │ ├── bg-47.imageset │ │ │ ├── Contents.json │ │ │ └── bg-47.jpg │ │ ├── bg-48.imageset │ │ │ ├── Contents.json │ │ │ └── bg-48.jpg │ │ ├── bg-49.imageset │ │ │ ├── Contents.json │ │ │ └── bg-49.jpg │ │ ├── bg-5.imageset │ │ │ ├── Contents.json │ │ │ └── bg-5.jpg │ │ ├── bg-50.imageset │ │ │ ├── Contents.json │ │ │ └── bg-50.jpg │ │ ├── bg-51.imageset │ │ │ ├── Contents.json │ │ │ └── bg-57.jpg │ │ ├── bg-52.imageset │ │ │ ├── Contents.json │ │ │ └── bg-52.jpg │ │ ├── bg-53.imageset │ │ │ ├── Contents.json │ │ │ └── bg-53.jpg │ │ ├── bg-54.imageset │ │ │ ├── Contents.json │ │ │ └── bg-54.jpg │ │ ├── bg-55.imageset │ │ │ ├── Contents.json │ │ │ └── bg-55.jpg │ │ ├── bg-56.imageset │ │ │ ├── Contents.json │ │ │ └── bg-56.jpg │ │ ├── bg-6.imageset │ │ │ ├── Contents.json │ │ │ └── bg-6.jpg │ │ ├── bg-7.imageset │ │ │ ├── Contents.json │ │ │ └── bg-7.jpg │ │ ├── bg-8.imageset │ │ │ ├── Contents.json │ │ │ └── bg-8.jpg │ │ └── bg-9.imageset │ │ │ ├── Contents.json │ │ │ └── bg-9.jpg │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── View │ ├── HomeImageCell.swift │ └── HomeImageCell.xib │ └── ViewController │ ├── HomeFlowLayout.swift │ ├── HomeViewController.swift │ └── HomeViewController.xib ├── ParallaxGallery ├── ParallaxGallery.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── ParallaxGallery │ ├── AppDelegate.swift │ ├── Model │ └── WorldHeritageModel.swift │ ├── Store │ └── WorldHeritageStore.swift │ ├── Supports │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── bg-0.imageset │ │ │ ├── Contents.json │ │ │ └── bg-58.jpg │ │ ├── bg-1.imageset │ │ │ ├── Contents.json │ │ │ └── bg-1.jpg │ │ ├── bg-10.imageset │ │ │ ├── Contents.json │ │ │ └── bg-10.jpg │ │ ├── bg-11.imageset │ │ │ ├── Contents.json │ │ │ └── bg-11.jpg │ │ ├── bg-12.imageset │ │ │ ├── Contents.json │ │ │ └── bg-12.jpg │ │ ├── bg-13.imageset │ │ │ ├── Contents.json │ │ │ └── bg-13.jpg │ │ ├── bg-14.imageset │ │ │ ├── Contents.json │ │ │ └── bg-14.jpg │ │ ├── bg-15.imageset │ │ │ ├── Contents.json │ │ │ └── bg-15.jpg │ │ ├── bg-16.imageset │ │ │ ├── Contents.json │ │ │ └── bg-16.jpg │ │ ├── bg-17.imageset │ │ │ ├── Contents.json │ │ │ └── bg-17.jpg │ │ ├── bg-18.imageset │ │ │ ├── Contents.json │ │ │ └── bg-18.jpg │ │ ├── bg-19.imageset │ │ │ ├── Contents.json │ │ │ └── bg-19.jpg │ │ ├── bg-2.imageset │ │ │ ├── Contents.json │ │ │ └── bg-2.jpg │ │ ├── bg-20.imageset │ │ │ ├── Contents.json │ │ │ └── bg-20.jpg │ │ ├── bg-21.imageset │ │ │ ├── Contents.json │ │ │ └── bg-21.jpg │ │ ├── bg-22.imageset │ │ │ ├── Contents.json │ │ │ └── bg-22.jpg │ │ ├── bg-23.imageset │ │ │ ├── Contents.json │ │ │ └── bg-23.jpg │ │ ├── bg-24.imageset │ │ │ ├── Contents.json │ │ │ └── bg-24.jpg │ │ ├── bg-25.imageset │ │ │ ├── Contents.json │ │ │ └── bg-25.jpg │ │ ├── bg-26.imageset │ │ │ ├── Contents.json │ │ │ └── bg-26.jpg │ │ ├── bg-27.imageset │ │ │ ├── Contents.json │ │ │ └── bg-27.jpg │ │ ├── bg-28.imageset │ │ │ ├── Contents.json │ │ │ └── bg-28.jpg │ │ ├── bg-29.imageset │ │ │ ├── Contents.json │ │ │ └── bg-29.jpg │ │ ├── bg-3.imageset │ │ │ ├── Contents.json │ │ │ └── bg-3.jpg │ │ ├── bg-30.imageset │ │ │ ├── Contents.json │ │ │ └── bg-30.jpg │ │ ├── bg-31.imageset │ │ │ ├── Contents.json │ │ │ └── bg-31.jpg │ │ ├── bg-32.imageset │ │ │ ├── Contents.json │ │ │ └── bg-32.jpg │ │ ├── bg-33.imageset │ │ │ ├── Contents.json │ │ │ └── bg-33.jpg │ │ ├── bg-34.imageset │ │ │ ├── Contents.json │ │ │ └── bg-34.jpg │ │ ├── bg-35.imageset │ │ │ ├── Contents.json │ │ │ └── bg-35.jpg │ │ ├── bg-36.imageset │ │ │ ├── Contents.json │ │ │ └── bg-36.jpg │ │ ├── bg-37.imageset │ │ │ ├── Contents.json │ │ │ └── bg-37.jpg │ │ ├── bg-38.imageset │ │ │ ├── Contents.json │ │ │ └── bg-38.jpg │ │ ├── bg-39.imageset │ │ │ ├── Contents.json │ │ │ └── bg-39.jpg │ │ ├── bg-4.imageset │ │ │ ├── Contents.json │ │ │ └── bg-4.jpg │ │ ├── bg-40.imageset │ │ │ ├── Contents.json │ │ │ └── bg-40.jpg │ │ ├── bg-41.imageset │ │ │ ├── Contents.json │ │ │ └── bg-41.jpg │ │ ├── bg-42.imageset │ │ │ ├── Contents.json │ │ │ └── bg-42.jpg │ │ ├── bg-43.imageset │ │ │ ├── Contents.json │ │ │ └── bg-43.jpg │ │ ├── bg-44.imageset │ │ │ ├── Contents.json │ │ │ └── bg-44.jpg │ │ ├── bg-45.imageset │ │ │ ├── Contents.json │ │ │ └── bg-45.jpg │ │ ├── bg-46.imageset │ │ │ ├── Contents.json │ │ │ └── bg-46.jpg │ │ ├── bg-47.imageset │ │ │ ├── Contents.json │ │ │ └── bg-47.jpg │ │ ├── bg-48.imageset │ │ │ ├── Contents.json │ │ │ └── bg-48.jpg │ │ ├── bg-49.imageset │ │ │ ├── Contents.json │ │ │ └── bg-49.jpg │ │ ├── bg-5.imageset │ │ │ ├── Contents.json │ │ │ └── bg-5.jpg │ │ ├── bg-50.imageset │ │ │ ├── Contents.json │ │ │ └── bg-50.jpg │ │ ├── bg-51.imageset │ │ │ ├── Contents.json │ │ │ └── bg-57.jpg │ │ ├── bg-52.imageset │ │ │ ├── Contents.json │ │ │ └── bg-52.jpg │ │ ├── bg-53.imageset │ │ │ ├── Contents.json │ │ │ └── bg-53.jpg │ │ ├── bg-54.imageset │ │ │ ├── Contents.json │ │ │ └── bg-54.jpg │ │ ├── bg-55.imageset │ │ │ ├── Contents.json │ │ │ └── bg-55.jpg │ │ ├── bg-56.imageset │ │ │ ├── Contents.json │ │ │ └── bg-56.jpg │ │ ├── bg-6.imageset │ │ │ ├── Contents.json │ │ │ └── bg-6.jpg │ │ ├── bg-7.imageset │ │ │ ├── Contents.json │ │ │ └── bg-7.jpg │ │ ├── bg-8.imageset │ │ │ ├── Contents.json │ │ │ └── bg-8.jpg │ │ └── bg-9.imageset │ │ │ ├── Contents.json │ │ │ └── bg-9.jpg │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── View │ ├── HomeCell.swift │ └── HomeCell.xib │ └── ViewController │ ├── HomeViewController.swift │ └── HomeViewController.xib ├── README.md └── resource ├── Swift-Masonry-Layout.gif └── Swift-Parallax-Scrolling.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/swift 2 | .DS_Store 3 | ### Swift ### 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | ## Build generated 8 | build/ 9 | DerivedData/ 10 | ## Various settings 11 | *.pbxuser 12 | !default.pbxuser 13 | *.mode1v3 14 | !default.mode1v3 15 | *.mode2v3 16 | !default.mode2v3 17 | *.perspectivev3 18 | !default.perspectivev3 19 | xcuserdata/ 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | ## Obj-C/Swift specific 24 | *.hmap 25 | *.ipa 26 | *.dSYM.zip 27 | *.dSYM 28 | ## Playgrounds 29 | timeline.xctimeline 30 | playground.xcworkspace 31 | # Swift Package Manager 32 | # 33 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 34 | # Packages/ 35 | .build/ 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 | # Carthage 44 | # 45 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 46 | # Carthage/Checkouts 47 | Carthage/Build 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 54 | fastlane/report.xml 55 | fastlane/Preview.html 56 | fastlane/screenshots 57 | fastlane/test_output 58 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A090D981FCEB0A40060DCDF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A090D971FCEB0A40060DCDF /* Main.storyboard */; }; 11 | 1A090D9A1FCEB0B10060DCDF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A090D991FCEB0B10060DCDF /* LaunchScreen.storyboard */; }; 12 | 1AEE13D21E763F8E003A177C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AEE13D11E763F8E003A177C /* AppDelegate.swift */; }; 13 | 1AEE13D91E763F8E003A177C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1AEE13D81E763F8E003A177C /* Assets.xcassets */; }; 14 | 1AEE13E81E763FCE003A177C /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AEE13E61E763FCE003A177C /* HomeViewController.swift */; }; 15 | 1AEE13E91E763FCE003A177C /* HomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1AEE13E71E763FCE003A177C /* HomeViewController.xib */; }; 16 | 1AEE13EC1E764093003A177C /* HomeImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AEE13EA1E764093003A177C /* HomeImageCell.swift */; }; 17 | 1AEE13ED1E764093003A177C /* HomeImageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1AEE13EB1E764093003A177C /* HomeImageCell.xib */; }; 18 | 1AEE13F31E76C4C9003A177C /* HomeFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AEE13F21E76C4C9003A177C /* HomeFlowLayout.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 1A090D971FCEB0A40060DCDF /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 23 | 1A090D991FCEB0B10060DCDF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 24 | 1AEE13CE1E763F8E003A177C /* DynamicGridLayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DynamicGridLayout.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 1AEE13D11E763F8E003A177C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 26 | 1AEE13D81E763F8E003A177C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 1AEE13DD1E763F8E003A177C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 1AEE13E61E763FCE003A177C /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 29 | 1AEE13E71E763FCE003A177C /* HomeViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeViewController.xib; sourceTree = ""; }; 30 | 1AEE13EA1E764093003A177C /* HomeImageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeImageCell.swift; sourceTree = ""; }; 31 | 1AEE13EB1E764093003A177C /* HomeImageCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeImageCell.xib; sourceTree = ""; }; 32 | 1AEE13F21E76C4C9003A177C /* HomeFlowLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeFlowLayout.swift; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 1AEE13CB1E763F8E003A177C /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 1AEE13C51E763F8E003A177C = { 47 | isa = PBXGroup; 48 | children = ( 49 | 1AEE13D01E763F8E003A177C /* DynamicGridLayout */, 50 | 1AEE13CF1E763F8E003A177C /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | 1AEE13CF1E763F8E003A177C /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 1AEE13CE1E763F8E003A177C /* DynamicGridLayout.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | 1AEE13D01E763F8E003A177C /* DynamicGridLayout */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 1AEE13D11E763F8E003A177C /* AppDelegate.swift */, 66 | 1AEE13E51E763FB7003A177C /* ViewController */, 67 | 1AEE13E41E763FB7003A177C /* View */, 68 | 1AF911101FCEAF9200A841CF /* Supports */, 69 | ); 70 | path = DynamicGridLayout; 71 | sourceTree = ""; 72 | }; 73 | 1AEE13E41E763FB7003A177C /* View */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 1AEE13EA1E764093003A177C /* HomeImageCell.swift */, 77 | 1AEE13EB1E764093003A177C /* HomeImageCell.xib */, 78 | ); 79 | path = View; 80 | sourceTree = ""; 81 | }; 82 | 1AEE13E51E763FB7003A177C /* ViewController */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 1AEE13F21E76C4C9003A177C /* HomeFlowLayout.swift */, 86 | 1AEE13E61E763FCE003A177C /* HomeViewController.swift */, 87 | 1AEE13E71E763FCE003A177C /* HomeViewController.xib */, 88 | ); 89 | path = ViewController; 90 | sourceTree = ""; 91 | }; 92 | 1AF911101FCEAF9200A841CF /* Supports */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 1AEE13D81E763F8E003A177C /* Assets.xcassets */, 96 | 1AEE13DD1E763F8E003A177C /* Info.plist */, 97 | 1A090D971FCEB0A40060DCDF /* Main.storyboard */, 98 | 1A090D991FCEB0B10060DCDF /* LaunchScreen.storyboard */, 99 | ); 100 | path = Supports; 101 | sourceTree = ""; 102 | }; 103 | /* End PBXGroup section */ 104 | 105 | /* Begin PBXNativeTarget section */ 106 | 1AEE13CD1E763F8E003A177C /* DynamicGridLayout */ = { 107 | isa = PBXNativeTarget; 108 | buildConfigurationList = 1AEE13E01E763F8E003A177C /* Build configuration list for PBXNativeTarget "DynamicGridLayout" */; 109 | buildPhases = ( 110 | 1AEE13CA1E763F8E003A177C /* Sources */, 111 | 1AEE13CB1E763F8E003A177C /* Frameworks */, 112 | 1AEE13CC1E763F8E003A177C /* Resources */, 113 | ); 114 | buildRules = ( 115 | ); 116 | dependencies = ( 117 | ); 118 | name = DynamicGridLayout; 119 | productName = DynamicGridLayout; 120 | productReference = 1AEE13CE1E763F8E003A177C /* DynamicGridLayout.app */; 121 | productType = "com.apple.product-type.application"; 122 | }; 123 | /* End PBXNativeTarget section */ 124 | 125 | /* Begin PBXProject section */ 126 | 1AEE13C61E763F8E003A177C /* Project object */ = { 127 | isa = PBXProject; 128 | attributes = { 129 | LastSwiftUpdateCheck = 0820; 130 | LastUpgradeCheck = 0820; 131 | ORGANIZATIONNAME = "Don Chen"; 132 | TargetAttributes = { 133 | 1AEE13CD1E763F8E003A177C = { 134 | CreatedOnToolsVersion = 8.2.1; 135 | DevelopmentTeam = DT8726CBX4; 136 | ProvisioningStyle = Automatic; 137 | }; 138 | }; 139 | }; 140 | buildConfigurationList = 1AEE13C91E763F8E003A177C /* Build configuration list for PBXProject "DynamicGridLayout" */; 141 | compatibilityVersion = "Xcode 3.2"; 142 | developmentRegion = English; 143 | hasScannedForEncodings = 0; 144 | knownRegions = ( 145 | en, 146 | Base, 147 | ); 148 | mainGroup = 1AEE13C51E763F8E003A177C; 149 | productRefGroup = 1AEE13CF1E763F8E003A177C /* Products */; 150 | projectDirPath = ""; 151 | projectRoot = ""; 152 | targets = ( 153 | 1AEE13CD1E763F8E003A177C /* DynamicGridLayout */, 154 | ); 155 | }; 156 | /* End PBXProject section */ 157 | 158 | /* Begin PBXResourcesBuildPhase section */ 159 | 1AEE13CC1E763F8E003A177C /* Resources */ = { 160 | isa = PBXResourcesBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | 1AEE13ED1E764093003A177C /* HomeImageCell.xib in Resources */, 164 | 1AEE13D91E763F8E003A177C /* Assets.xcassets in Resources */, 165 | 1A090D9A1FCEB0B10060DCDF /* LaunchScreen.storyboard in Resources */, 166 | 1A090D981FCEB0A40060DCDF /* Main.storyboard in Resources */, 167 | 1AEE13E91E763FCE003A177C /* HomeViewController.xib in Resources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXResourcesBuildPhase section */ 172 | 173 | /* Begin PBXSourcesBuildPhase section */ 174 | 1AEE13CA1E763F8E003A177C /* Sources */ = { 175 | isa = PBXSourcesBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 1AEE13D21E763F8E003A177C /* AppDelegate.swift in Sources */, 179 | 1AEE13E81E763FCE003A177C /* HomeViewController.swift in Sources */, 180 | 1AEE13EC1E764093003A177C /* HomeImageCell.swift in Sources */, 181 | 1AEE13F31E76C4C9003A177C /* HomeFlowLayout.swift in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin XCBuildConfiguration section */ 188 | 1AEE13DE1E763F8E003A177C /* Debug */ = { 189 | isa = XCBuildConfiguration; 190 | buildSettings = { 191 | ALWAYS_SEARCH_USER_PATHS = NO; 192 | CLANG_ANALYZER_NONNULL = YES; 193 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 194 | CLANG_CXX_LIBRARY = "libc++"; 195 | CLANG_ENABLE_MODULES = YES; 196 | CLANG_ENABLE_OBJC_ARC = YES; 197 | CLANG_WARN_BOOL_CONVERSION = YES; 198 | CLANG_WARN_CONSTANT_CONVERSION = YES; 199 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 200 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 201 | CLANG_WARN_EMPTY_BODY = YES; 202 | CLANG_WARN_ENUM_CONVERSION = YES; 203 | CLANG_WARN_INFINITE_RECURSION = YES; 204 | CLANG_WARN_INT_CONVERSION = YES; 205 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 206 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 207 | CLANG_WARN_UNREACHABLE_CODE = YES; 208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 209 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 210 | COPY_PHASE_STRIP = NO; 211 | DEBUG_INFORMATION_FORMAT = dwarf; 212 | ENABLE_STRICT_OBJC_MSGSEND = YES; 213 | ENABLE_TESTABILITY = YES; 214 | GCC_C_LANGUAGE_STANDARD = gnu99; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_NO_COMMON_BLOCKS = YES; 217 | GCC_OPTIMIZATION_LEVEL = 0; 218 | GCC_PREPROCESSOR_DEFINITIONS = ( 219 | "DEBUG=1", 220 | "$(inherited)", 221 | ); 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 224 | GCC_WARN_UNDECLARED_SELECTOR = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 226 | GCC_WARN_UNUSED_FUNCTION = YES; 227 | GCC_WARN_UNUSED_VARIABLE = YES; 228 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 229 | MTL_ENABLE_DEBUG_INFO = YES; 230 | ONLY_ACTIVE_ARCH = YES; 231 | SDKROOT = iphoneos; 232 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 233 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 234 | }; 235 | name = Debug; 236 | }; 237 | 1AEE13DF1E763F8E003A177C /* Release */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_ANALYZER_NONNULL = YES; 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_DOCUMENTATION_COMMENTS = YES; 250 | CLANG_WARN_EMPTY_BODY = YES; 251 | CLANG_WARN_ENUM_CONVERSION = YES; 252 | CLANG_WARN_INFINITE_RECURSION = YES; 253 | CLANG_WARN_INT_CONVERSION = YES; 254 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 255 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 256 | CLANG_WARN_UNREACHABLE_CODE = YES; 257 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 258 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 259 | COPY_PHASE_STRIP = NO; 260 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 261 | ENABLE_NS_ASSERTIONS = NO; 262 | ENABLE_STRICT_OBJC_MSGSEND = YES; 263 | GCC_C_LANGUAGE_STANDARD = gnu99; 264 | GCC_NO_COMMON_BLOCKS = YES; 265 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 266 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 267 | GCC_WARN_UNDECLARED_SELECTOR = YES; 268 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 269 | GCC_WARN_UNUSED_FUNCTION = YES; 270 | GCC_WARN_UNUSED_VARIABLE = YES; 271 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 272 | MTL_ENABLE_DEBUG_INFO = NO; 273 | SDKROOT = iphoneos; 274 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 275 | VALIDATE_PRODUCT = YES; 276 | }; 277 | name = Release; 278 | }; 279 | 1AEE13E11E763F8E003A177C /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 283 | DEVELOPMENT_TEAM = DT8726CBX4; 284 | INFOPLIST_FILE = DynamicGridLayout/Supports/Info.plist; 285 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 286 | PRODUCT_BUNDLE_IDENTIFIER = ios.devdon.com.DynamicGridLayout; 287 | PRODUCT_NAME = "$(TARGET_NAME)"; 288 | SWIFT_VERSION = 3.0; 289 | }; 290 | name = Debug; 291 | }; 292 | 1AEE13E21E763F8E003A177C /* Release */ = { 293 | isa = XCBuildConfiguration; 294 | buildSettings = { 295 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 296 | DEVELOPMENT_TEAM = DT8726CBX4; 297 | INFOPLIST_FILE = DynamicGridLayout/Supports/Info.plist; 298 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 299 | PRODUCT_BUNDLE_IDENTIFIER = ios.devdon.com.DynamicGridLayout; 300 | PRODUCT_NAME = "$(TARGET_NAME)"; 301 | SWIFT_VERSION = 3.0; 302 | }; 303 | name = Release; 304 | }; 305 | /* End XCBuildConfiguration section */ 306 | 307 | /* Begin XCConfigurationList section */ 308 | 1AEE13C91E763F8E003A177C /* Build configuration list for PBXProject "DynamicGridLayout" */ = { 309 | isa = XCConfigurationList; 310 | buildConfigurations = ( 311 | 1AEE13DE1E763F8E003A177C /* Debug */, 312 | 1AEE13DF1E763F8E003A177C /* Release */, 313 | ); 314 | defaultConfigurationIsVisible = 0; 315 | defaultConfigurationName = Release; 316 | }; 317 | 1AEE13E01E763F8E003A177C /* Build configuration list for PBXNativeTarget "DynamicGridLayout" */ = { 318 | isa = XCConfigurationList; 319 | buildConfigurations = ( 320 | 1AEE13E11E763F8E003A177C /* Debug */, 321 | 1AEE13E21E763F8E003A177C /* Release */, 322 | ); 323 | defaultConfigurationIsVisible = 0; 324 | defaultConfigurationName = Release; 325 | }; 326 | /* End XCConfigurationList section */ 327 | }; 328 | rootObject = 1AEE13C61E763F8E003A177C /* Project object */; 329 | } 330 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DynamicGridLayout 4 | // 5 | // Created by don chen on 2017/3/13. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | 19 | let VC = HomeViewController(nibName: "HomeViewController", bundle: nil) 20 | window?.rootViewController = VC 21 | 22 | return true 23 | } 24 | 25 | func applicationWillResignActive(_ application: UIApplication) { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 28 | } 29 | 30 | func applicationDidEnterBackground(_ application: UIApplication) { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | func applicationWillEnterForeground(_ application: UIApplication) { 36 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | func applicationDidBecomeActive(_ application: UIApplication) { 40 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 41 | } 42 | 43 | func applicationWillTerminate(_ application: UIApplication) { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | } 46 | 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-0.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-58.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-0.imageset/bg-58.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-0.imageset/bg-58.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-1.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-1.imageset/bg-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-1.imageset/bg-1.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-10.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-10.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-10.imageset/bg-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-10.imageset/bg-10.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-11.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-11.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-11.imageset/bg-11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-11.imageset/bg-11.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-12.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-12.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-12.imageset/bg-12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-12.imageset/bg-12.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-13.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-13.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-13.imageset/bg-13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-13.imageset/bg-13.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-14.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-14.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-14.imageset/bg-14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-14.imageset/bg-14.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-15.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-15.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-15.imageset/bg-15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-15.imageset/bg-15.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-16.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-16.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-16.imageset/bg-16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-16.imageset/bg-16.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-17.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-17.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-17.imageset/bg-17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-17.imageset/bg-17.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-18.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-18.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-18.imageset/bg-18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-18.imageset/bg-18.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-19.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-19.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-19.imageset/bg-19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-19.imageset/bg-19.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-2.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-2.imageset/bg-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-2.imageset/bg-2.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-20.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-20.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-20.imageset/bg-20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-20.imageset/bg-20.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-21.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-21.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-21.imageset/bg-21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-21.imageset/bg-21.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-22.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-22.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-22.imageset/bg-22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-22.imageset/bg-22.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-23.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-23.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-23.imageset/bg-23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-23.imageset/bg-23.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-24.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-24.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-24.imageset/bg-24.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-24.imageset/bg-24.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-25.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-25.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-25.imageset/bg-25.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-25.imageset/bg-25.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-26.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-26.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-26.imageset/bg-26.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-26.imageset/bg-26.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-27.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-27.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-27.imageset/bg-27.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-27.imageset/bg-27.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-28.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-28.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-28.imageset/bg-28.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-28.imageset/bg-28.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-29.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-29.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-29.imageset/bg-29.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-29.imageset/bg-29.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-3.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-3.imageset/bg-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-3.imageset/bg-3.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-30.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-30.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-30.imageset/bg-30.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-30.imageset/bg-30.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-31.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-31.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-31.imageset/bg-31.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-31.imageset/bg-31.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-32.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-32.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-32.imageset/bg-32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-32.imageset/bg-32.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-33.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-33.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-33.imageset/bg-33.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-33.imageset/bg-33.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-34.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-34.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-34.imageset/bg-34.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-34.imageset/bg-34.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-35.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-35.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-35.imageset/bg-35.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-35.imageset/bg-35.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-36.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-36.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-36.imageset/bg-36.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-36.imageset/bg-36.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-37.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-37.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-37.imageset/bg-37.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-37.imageset/bg-37.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-38.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-38.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-38.imageset/bg-38.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-38.imageset/bg-38.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-39.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-39.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-39.imageset/bg-39.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-39.imageset/bg-39.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-4.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-4.imageset/bg-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-4.imageset/bg-4.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-40.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-40.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-40.imageset/bg-40.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-40.imageset/bg-40.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-41.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-41.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-41.imageset/bg-41.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-41.imageset/bg-41.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-42.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-42.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-42.imageset/bg-42.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-42.imageset/bg-42.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-43.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-43.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-43.imageset/bg-43.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-43.imageset/bg-43.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-44.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-44.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-44.imageset/bg-44.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-44.imageset/bg-44.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-45.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-45.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-45.imageset/bg-45.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-45.imageset/bg-45.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-46.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-46.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-46.imageset/bg-46.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-46.imageset/bg-46.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-47.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-47.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-47.imageset/bg-47.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-47.imageset/bg-47.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-48.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-48.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-48.imageset/bg-48.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-48.imageset/bg-48.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-49.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-49.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-49.imageset/bg-49.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-49.imageset/bg-49.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-5.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-5.imageset/bg-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-5.imageset/bg-5.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-50.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-50.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-50.imageset/bg-50.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-50.imageset/bg-50.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-51.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-57.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-51.imageset/bg-57.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-51.imageset/bg-57.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-52.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-52.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-52.imageset/bg-52.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-52.imageset/bg-52.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-53.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-53.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-53.imageset/bg-53.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-53.imageset/bg-53.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-54.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-54.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-54.imageset/bg-54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-54.imageset/bg-54.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-55.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-55.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-55.imageset/bg-55.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-55.imageset/bg-55.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-56.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-56.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-56.imageset/bg-56.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-56.imageset/bg-56.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-6.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-6.imageset/bg-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-6.imageset/bg-6.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-7.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-7.imageset/bg-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-7.imageset/bg-7.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-8.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-8.imageset/bg-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-8.imageset/bg-8.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg-9.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-9.imageset/bg-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/DynamicGridLayout/DynamicGridLayout/Supports/Assets.xcassets/bg-9.imageset/bg-9.jpg -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/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 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/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 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/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 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/Supports/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 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/View/HomeImageCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeImageCell.swift 3 | // DynamicGridLayout 4 | // 5 | // Created by don chen on 2017/3/13. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HomeImageCell: UICollectionViewCell { 12 | 13 | @IBOutlet var aImageView: UIImageView! 14 | override func awakeFromNib() { 15 | super.awakeFromNib() 16 | // Initialization code 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/View/HomeImageCell.xib: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/ViewController/HomeFlowLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeFlowLayout.swift 3 | // DynamicGridLayout 4 | // 5 | // Created by don chen on 2017/3/13. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HomeFlowLayout: UICollectionViewFlowLayout { 12 | 13 | // 定義幾種column類型 14 | enum LayoutType:String { 15 | case twoColumn, threeColumn, sixColumn, twelve 16 | 17 | var column: Int { 18 | switch self { 19 | case .twoColumn: return 2 20 | case .threeColumn: return 3 21 | case .sixColumn: return 6 22 | case .twelve: return 12 23 | } 24 | } 25 | 26 | var keyName: String { 27 | switch self { 28 | case .twoColumn: return "two" 29 | case .threeColumn: return "three" 30 | case .sixColumn: return "six" 31 | case .twelve: return "twelve" 32 | } 33 | } 34 | 35 | } 36 | 37 | var items = [UIImage]() 38 | var layoutType:LayoutType = .twoColumn 39 | fileprivate lazy var layoutAttributes:[String:[UICollectionViewLayoutAttributes]] = { 40 | return [String:[UICollectionViewLayoutAttributes]]() 41 | }() 42 | 43 | fileprivate lazy var layoutItemSize:[String:CGSize] = { 44 | return [String:CGSize]() 45 | }() 46 | 47 | override func prepare() { 48 | super.prepare() 49 | minimumInteritemSpacing = 10 50 | minimumLineSpacing = 10 51 | 52 | sectionInset.top = 10 53 | sectionInset.left = 10 54 | sectionInset.right = 10 55 | 56 | // 如果之前沒有計算過Layout則計算並存入cache中 57 | if layoutAttributes[layoutType.keyName] == nil && collectionView != nil{ 58 | // 根據想要的column數量來計算一個cell的寬度 59 | let contentWidth:CGFloat = collectionView!.bounds.size.width - sectionInset.left - sectionInset.right 60 | let itemWidth = (contentWidth - minimumInteritemSpacing * (CGFloat(layoutType.column)-1)) / CGFloat(layoutType.column) 61 | 62 | // 計算cell的佈局 63 | computeAndStoreAttributes(layoutType ,CGFloat(itemWidth)) 64 | 65 | } 66 | 67 | // 佈局變化時記得跟著改變itemSize 68 | if let size = layoutItemSize[layoutType.keyName] { 69 | itemSize = size 70 | } 71 | 72 | 73 | } 74 | 75 | 76 | override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { 77 | return layoutAttributes[layoutType.keyName] 78 | } 79 | 80 | // 計算cell的frame以及設定item size來提供系統計算UICollectionView的contentSize 81 | fileprivate func computeAndStoreAttributes(_ layoutType:LayoutType ,_ itemWidth:CGFloat) { 82 | 83 | // 以sectionInset.top作為最初始的高度,紀錄每一個column的高度 84 | var columnHeights = [CGFloat](repeating: sectionInset.top, count: layoutType.column) 85 | 86 | // 記錄每一個column的item個數 87 | var columnItemCount = [Int](repeating: 0, count: layoutType.column) 88 | 89 | // 紀錄每一個cell的attributes 90 | var attributes = [UICollectionViewLayoutAttributes]() 91 | 92 | var row = 0 93 | for item in items { 94 | // 建立一個attribute 95 | let indexPath = IndexPath.init(row: row, section: 0) 96 | let attribute = UICollectionViewLayoutAttributes(forCellWith: indexPath) 97 | 98 | // 找出最短的Column 99 | let minHeight = columnHeights.sorted().first! 100 | let minHeightColumn = columnHeights.index(of: minHeight)! 101 | 102 | // 新的照片放到最短Column上 103 | columnItemCount[minHeightColumn] += 1 104 | let itemX = (itemWidth + minimumInteritemSpacing) * CGFloat(minHeightColumn) + sectionInset.left 105 | let itemY = minHeight 106 | 107 | // 計算高度,按照原圖片大小等比例縮放 108 | let itemHeight = item.size.height * itemWidth / item.size.width 109 | 110 | // 設定Frame,加入到attributes中 111 | attribute.frame = CGRect(x: itemX, y: CGFloat(itemY), width: itemWidth, height: CGFloat(itemHeight)) 112 | attributes.append(attribute) 113 | 114 | // 計算最短的column當前的高度 115 | columnHeights[minHeightColumn] += itemHeight + minimumLineSpacing 116 | 117 | row += 1 118 | } 119 | 120 | // 找出最高的Column 121 | let maxHeight = columnHeights.sorted().last! 122 | let column = columnHeights.index(of: maxHeight) 123 | 124 | // 用於系統計算collectionView的contentSize - 根據最高的Column來設置itemSize,使用總高度的平均值 125 | let itemHeight = (maxHeight - minimumLineSpacing * CGFloat(columnItemCount[column!])) / CGFloat(columnItemCount[column!]) 126 | let cellSize = CGSize(width: itemWidth, height: itemHeight) 127 | 128 | // 將計算後的結果存起來 129 | layoutAttributes[layoutType.keyName] = attributes 130 | layoutItemSize[layoutType.keyName] = cellSize 131 | 132 | } 133 | 134 | 135 | 136 | 137 | } 138 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/ViewController/HomeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.swift 3 | // DynamicGridLayout 4 | // 5 | // Created by don chen on 2017/3/13. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HomeViewController: UIViewController { 12 | 13 | @IBOutlet var aCollectionView: UICollectionView! 14 | @IBOutlet weak var flowLayout: HomeFlowLayout! 15 | @IBOutlet weak var layoutSegment: UISegmentedControl! 16 | 17 | var items = [UIImage]() 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | setupView() 22 | 23 | } 24 | 25 | // 切換UISectionControl來更換Layout 26 | @IBAction func didChangeSegment(_ sender: UISegmentedControl) { 27 | switch sender.selectedSegmentIndex { 28 | case 0: 29 | flowLayout.layoutType = .twoColumn 30 | 31 | case 1: 32 | flowLayout.layoutType = .threeColumn 33 | 34 | case 2: 35 | flowLayout.layoutType = .sixColumn 36 | 37 | case 3: 38 | flowLayout.layoutType = .twelve 39 | default: 40 | break 41 | } 42 | 43 | // 更換layout動畫 44 | UIView.animate(withDuration: 1, animations: { [unowned self] in 45 | self.aCollectionView.collectionViewLayout.invalidateLayout() 46 | 47 | self.aCollectionView.performBatchUpdates({ [unowned self] in 48 | self.aCollectionView.setCollectionViewLayout(self.flowLayout, animated: true) 49 | }, completion: nil) 50 | }) 51 | 52 | } 53 | 54 | 55 | func setupView() { 56 | // 設定UICollectionView背景顏色 57 | aCollectionView.backgroundColor = UIColor(red: 56/255, green: 54/255, blue: 57/255, alpha: 1) 58 | 59 | // UICollectionView註冊HomeImageCell 60 | let imageNib = UINib(nibName: "HomeImageCell", bundle: nil) 61 | aCollectionView.register(imageNib, forCellWithReuseIdentifier: "imageCell") 62 | 63 | // 產生1000個圖片,圖片檔案從bg-0到bg-57 64 | var pos = 0 65 | for _ in 1...1000 { 66 | if let image = UIImage(named: "bg-\(pos)") { 67 | items.append(image) 68 | } 69 | 70 | pos += 1 71 | if pos == 58 { 72 | pos = 0 73 | } 74 | 75 | } 76 | 77 | flowLayout.items = items 78 | aCollectionView.collectionViewLayout = flowLayout 79 | 80 | } 81 | 82 | } 83 | 84 | // MARK: UICollectionViewDataSource 85 | extension HomeViewController: UICollectionViewDataSource { 86 | 87 | func numberOfSections(in collectionView: UICollectionView) -> Int { 88 | return 1 89 | } 90 | 91 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 92 | return items.count 93 | } 94 | 95 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 96 | 97 | let aCell = collectionView.dequeueReusableCell(withReuseIdentifier: "imageCell", for: indexPath) as! HomeImageCell 98 | aCell.aImageView.image = items[indexPath.row] 99 | return aCell 100 | 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /DynamicGridLayout/DynamicGridLayout/ViewController/HomeViewController.xib: -------------------------------------------------------------------------------- 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 | 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 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A090D9D1FCEB1A60060DCDF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A090D9B1FCEB1A60060DCDF /* LaunchScreen.storyboard */; }; 11 | 1A090D9E1FCEB1A60060DCDF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A090D9C1FCEB1A60060DCDF /* Main.storyboard */; }; 12 | 1A9F55FF1E7CF3CA0025DA00 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A9F55FE1E7CF3CA0025DA00 /* AppDelegate.swift */; }; 13 | 1A9F56061E7CF3CA0025DA00 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A9F56051E7CF3CA0025DA00 /* Assets.xcassets */; }; 14 | 1A9F56151E7CF3FC0025DA00 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A9F56131E7CF3FC0025DA00 /* HomeViewController.swift */; }; 15 | 1A9F56161E7CF3FC0025DA00 /* HomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A9F56141E7CF3FC0025DA00 /* HomeViewController.xib */; }; 16 | 1A9F56191E7CF4450025DA00 /* HomeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A9F56171E7CF4450025DA00 /* HomeCell.swift */; }; 17 | 1A9F561A1E7CF4450025DA00 /* HomeCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A9F56181E7CF4450025DA00 /* HomeCell.xib */; }; 18 | 1A9F561F1E7D38AC0025DA00 /* WorldHeritageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A9F561E1E7D38AC0025DA00 /* WorldHeritageModel.swift */; }; 19 | 1A9F56221E7D38DE0025DA00 /* WorldHeritageStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A9F56211E7D38DE0025DA00 /* WorldHeritageStore.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 1A090D9B1FCEB1A60060DCDF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 24 | 1A090D9C1FCEB1A60060DCDF /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 25 | 1A9F55FB1E7CF3CA0025DA00 /* ParallaxGallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ParallaxGallery.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 1A9F55FE1E7CF3CA0025DA00 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 27 | 1A9F56051E7CF3CA0025DA00 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 1A9F560A1E7CF3CA0025DA00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 1A9F56131E7CF3FC0025DA00 /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 30 | 1A9F56141E7CF3FC0025DA00 /* HomeViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeViewController.xib; sourceTree = ""; }; 31 | 1A9F56171E7CF4450025DA00 /* HomeCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeCell.swift; sourceTree = ""; }; 32 | 1A9F56181E7CF4450025DA00 /* HomeCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeCell.xib; sourceTree = ""; }; 33 | 1A9F561E1E7D38AC0025DA00 /* WorldHeritageModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WorldHeritageModel.swift; sourceTree = ""; }; 34 | 1A9F56211E7D38DE0025DA00 /* WorldHeritageStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WorldHeritageStore.swift; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 1A9F55F81E7CF3CA0025DA00 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 1A9F55F21E7CF3C90025DA00 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 1A9F55FD1E7CF3CA0025DA00 /* ParallaxGallery */, 52 | 1A9F55FC1E7CF3CA0025DA00 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 1A9F55FC1E7CF3CA0025DA00 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 1A9F55FB1E7CF3CA0025DA00 /* ParallaxGallery.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 1A9F55FD1E7CF3CA0025DA00 /* ParallaxGallery */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 1A9F55FE1E7CF3CA0025DA00 /* AppDelegate.swift */, 68 | 1A9F56201E7D38D10025DA00 /* Store */, 69 | 1A9F561D1E7D38890025DA00 /* Model */, 70 | 1A9F56121E7CF3E60025DA00 /* ViewController */, 71 | 1A9F56111E7CF3E60025DA00 /* View */, 72 | 1AF911111FCEAFC300A841CF /* Supports */, 73 | ); 74 | path = ParallaxGallery; 75 | sourceTree = ""; 76 | }; 77 | 1A9F56111E7CF3E60025DA00 /* View */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 1A9F56171E7CF4450025DA00 /* HomeCell.swift */, 81 | 1A9F56181E7CF4450025DA00 /* HomeCell.xib */, 82 | ); 83 | path = View; 84 | sourceTree = ""; 85 | }; 86 | 1A9F56121E7CF3E60025DA00 /* ViewController */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 1A9F56131E7CF3FC0025DA00 /* HomeViewController.swift */, 90 | 1A9F56141E7CF3FC0025DA00 /* HomeViewController.xib */, 91 | ); 92 | path = ViewController; 93 | sourceTree = ""; 94 | }; 95 | 1A9F561D1E7D38890025DA00 /* Model */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 1A9F561E1E7D38AC0025DA00 /* WorldHeritageModel.swift */, 99 | ); 100 | path = Model; 101 | sourceTree = ""; 102 | }; 103 | 1A9F56201E7D38D10025DA00 /* Store */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 1A9F56211E7D38DE0025DA00 /* WorldHeritageStore.swift */, 107 | ); 108 | path = Store; 109 | sourceTree = ""; 110 | }; 111 | 1AF911111FCEAFC300A841CF /* Supports */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 1A090D9B1FCEB1A60060DCDF /* LaunchScreen.storyboard */, 115 | 1A090D9C1FCEB1A60060DCDF /* Main.storyboard */, 116 | 1A9F56051E7CF3CA0025DA00 /* Assets.xcassets */, 117 | 1A9F560A1E7CF3CA0025DA00 /* Info.plist */, 118 | ); 119 | path = Supports; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 1A9F55FA1E7CF3CA0025DA00 /* ParallaxGallery */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 1A9F560D1E7CF3CA0025DA00 /* Build configuration list for PBXNativeTarget "ParallaxGallery" */; 128 | buildPhases = ( 129 | 1A9F55F71E7CF3CA0025DA00 /* Sources */, 130 | 1A9F55F81E7CF3CA0025DA00 /* Frameworks */, 131 | 1A9F55F91E7CF3CA0025DA00 /* Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | ); 137 | name = ParallaxGallery; 138 | productName = ParallaxGallery; 139 | productReference = 1A9F55FB1E7CF3CA0025DA00 /* ParallaxGallery.app */; 140 | productType = "com.apple.product-type.application"; 141 | }; 142 | /* End PBXNativeTarget section */ 143 | 144 | /* Begin PBXProject section */ 145 | 1A9F55F31E7CF3C90025DA00 /* Project object */ = { 146 | isa = PBXProject; 147 | attributes = { 148 | LastSwiftUpdateCheck = 0820; 149 | LastUpgradeCheck = 0820; 150 | ORGANIZATIONNAME = "Don Chen"; 151 | TargetAttributes = { 152 | 1A9F55FA1E7CF3CA0025DA00 = { 153 | CreatedOnToolsVersion = 8.2.1; 154 | DevelopmentTeam = DT8726CBX4; 155 | ProvisioningStyle = Automatic; 156 | }; 157 | }; 158 | }; 159 | buildConfigurationList = 1A9F55F61E7CF3C90025DA00 /* Build configuration list for PBXProject "ParallaxGallery" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = English; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | Base, 166 | ); 167 | mainGroup = 1A9F55F21E7CF3C90025DA00; 168 | productRefGroup = 1A9F55FC1E7CF3CA0025DA00 /* Products */; 169 | projectDirPath = ""; 170 | projectRoot = ""; 171 | targets = ( 172 | 1A9F55FA1E7CF3CA0025DA00 /* ParallaxGallery */, 173 | ); 174 | }; 175 | /* End PBXProject section */ 176 | 177 | /* Begin PBXResourcesBuildPhase section */ 178 | 1A9F55F91E7CF3CA0025DA00 /* Resources */ = { 179 | isa = PBXResourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | 1A090D9E1FCEB1A60060DCDF /* Main.storyboard in Resources */, 183 | 1A9F56061E7CF3CA0025DA00 /* Assets.xcassets in Resources */, 184 | 1A090D9D1FCEB1A60060DCDF /* LaunchScreen.storyboard in Resources */, 185 | 1A9F56161E7CF3FC0025DA00 /* HomeViewController.xib in Resources */, 186 | 1A9F561A1E7CF4450025DA00 /* HomeCell.xib in Resources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXResourcesBuildPhase section */ 191 | 192 | /* Begin PBXSourcesBuildPhase section */ 193 | 1A9F55F71E7CF3CA0025DA00 /* Sources */ = { 194 | isa = PBXSourcesBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | 1A9F55FF1E7CF3CA0025DA00 /* AppDelegate.swift in Sources */, 198 | 1A9F561F1E7D38AC0025DA00 /* WorldHeritageModel.swift in Sources */, 199 | 1A9F56191E7CF4450025DA00 /* HomeCell.swift in Sources */, 200 | 1A9F56151E7CF3FC0025DA00 /* HomeViewController.swift in Sources */, 201 | 1A9F56221E7D38DE0025DA00 /* WorldHeritageStore.swift in Sources */, 202 | ); 203 | runOnlyForDeploymentPostprocessing = 0; 204 | }; 205 | /* End PBXSourcesBuildPhase section */ 206 | 207 | /* Begin XCBuildConfiguration section */ 208 | 1A9F560B1E7CF3CA0025DA00 /* Debug */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | ALWAYS_SEARCH_USER_PATHS = NO; 212 | CLANG_ANALYZER_NONNULL = YES; 213 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 214 | CLANG_CXX_LIBRARY = "libc++"; 215 | CLANG_ENABLE_MODULES = YES; 216 | CLANG_ENABLE_OBJC_ARC = YES; 217 | CLANG_WARN_BOOL_CONVERSION = YES; 218 | CLANG_WARN_CONSTANT_CONVERSION = YES; 219 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 220 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 221 | CLANG_WARN_EMPTY_BODY = YES; 222 | CLANG_WARN_ENUM_CONVERSION = YES; 223 | CLANG_WARN_INFINITE_RECURSION = YES; 224 | CLANG_WARN_INT_CONVERSION = YES; 225 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 226 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 227 | CLANG_WARN_UNREACHABLE_CODE = YES; 228 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 229 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 230 | COPY_PHASE_STRIP = NO; 231 | DEBUG_INFORMATION_FORMAT = dwarf; 232 | ENABLE_STRICT_OBJC_MSGSEND = YES; 233 | ENABLE_TESTABILITY = YES; 234 | GCC_C_LANGUAGE_STANDARD = gnu99; 235 | GCC_DYNAMIC_NO_PIC = NO; 236 | GCC_NO_COMMON_BLOCKS = YES; 237 | GCC_OPTIMIZATION_LEVEL = 0; 238 | GCC_PREPROCESSOR_DEFINITIONS = ( 239 | "DEBUG=1", 240 | "$(inherited)", 241 | ); 242 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 243 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 244 | GCC_WARN_UNDECLARED_SELECTOR = YES; 245 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 246 | GCC_WARN_UNUSED_FUNCTION = YES; 247 | GCC_WARN_UNUSED_VARIABLE = YES; 248 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 249 | MTL_ENABLE_DEBUG_INFO = YES; 250 | ONLY_ACTIVE_ARCH = YES; 251 | SDKROOT = iphoneos; 252 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 253 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 254 | }; 255 | name = Debug; 256 | }; 257 | 1A9F560C1E7CF3CA0025DA00 /* Release */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BOOL_CONVERSION = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 269 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 276 | CLANG_WARN_UNREACHABLE_CODE = YES; 277 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 278 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 279 | COPY_PHASE_STRIP = NO; 280 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 281 | ENABLE_NS_ASSERTIONS = NO; 282 | ENABLE_STRICT_OBJC_MSGSEND = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_NO_COMMON_BLOCKS = YES; 285 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 286 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 287 | GCC_WARN_UNDECLARED_SELECTOR = YES; 288 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 289 | GCC_WARN_UNUSED_FUNCTION = YES; 290 | GCC_WARN_UNUSED_VARIABLE = YES; 291 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 292 | MTL_ENABLE_DEBUG_INFO = NO; 293 | SDKROOT = iphoneos; 294 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 295 | VALIDATE_PRODUCT = YES; 296 | }; 297 | name = Release; 298 | }; 299 | 1A9F560E1E7CF3CA0025DA00 /* Debug */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 303 | DEVELOPMENT_TEAM = DT8726CBX4; 304 | INFOPLIST_FILE = ParallaxGallery/Supports/Info.plist; 305 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 306 | PRODUCT_BUNDLE_IDENTIFIER = ios.devdon.com.ParallaxGallery; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | SWIFT_VERSION = 3.0; 309 | }; 310 | name = Debug; 311 | }; 312 | 1A9F560F1E7CF3CA0025DA00 /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 316 | DEVELOPMENT_TEAM = DT8726CBX4; 317 | INFOPLIST_FILE = ParallaxGallery/Supports/Info.plist; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | PRODUCT_BUNDLE_IDENTIFIER = ios.devdon.com.ParallaxGallery; 320 | PRODUCT_NAME = "$(TARGET_NAME)"; 321 | SWIFT_VERSION = 3.0; 322 | }; 323 | name = Release; 324 | }; 325 | /* End XCBuildConfiguration section */ 326 | 327 | /* Begin XCConfigurationList section */ 328 | 1A9F55F61E7CF3C90025DA00 /* Build configuration list for PBXProject "ParallaxGallery" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | 1A9F560B1E7CF3CA0025DA00 /* Debug */, 332 | 1A9F560C1E7CF3CA0025DA00 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | 1A9F560D1E7CF3CA0025DA00 /* Build configuration list for PBXNativeTarget "ParallaxGallery" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | 1A9F560E1E7CF3CA0025DA00 /* Debug */, 341 | 1A9F560F1E7CF3CA0025DA00 /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | /* End XCConfigurationList section */ 347 | }; 348 | rootObject = 1A9F55F31E7CF3C90025DA00 /* Project object */; 349 | } 350 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ParallaxGallery 4 | // 5 | // Created by don chen on 2017/3/18. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | 19 | let VC = HomeViewController(nibName: "HomeViewController", bundle: nil) 20 | window?.rootViewController = VC 21 | 22 | return true 23 | } 24 | 25 | func applicationWillResignActive(_ application: UIApplication) { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 28 | } 29 | 30 | func applicationDidEnterBackground(_ application: UIApplication) { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | func applicationWillEnterForeground(_ application: UIApplication) { 36 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | func applicationDidBecomeActive(_ application: UIApplication) { 40 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 41 | } 42 | 43 | func applicationWillTerminate(_ application: UIApplication) { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | } 46 | 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/Model/WorldHeritageModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WorldHeritageModel.swift 3 | // ParallaxGallery 4 | // 5 | // Created by don chen on 2017/3/18. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct WorldHeritageModel { 12 | var placeName:String 13 | var imageName:String 14 | var date:String 15 | } 16 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/Store/WorldHeritageStore.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WorldHeritageStore.swift 3 | // ParallaxGallery 4 | // 5 | // Created by don chen on 2017/3/18. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class WorldHeritageStore { 12 | static let shared = WorldHeritageStore() 13 | 14 | fileprivate let places = ["富冈制丝厂及产业遗产群","小笠原群岛","石见银山","知床半岛","纪伊山地的灵场和参拜道","日光的神社与寺院","古都奈良的文化财","严岛神社","白神山地","屋久岛","姬路城","法隆寺地域的佛教建筑物","波斯坎儿井","卢特沙漠","苏萨","梅满德文化景观","被焚之城","古列斯坦宫","贡巴德·卡武斯高塔","伊斯法罕的聚礼清真寺","波斯花园","大不里士历史巴扎建筑群","舒希达历史水力系统","贝希斯敦","苏丹尼耶","巴姆及其文化景观","帕萨尔加德","塔赫特苏莱曼","伊斯法罕的伊玛目广场","波斯波利斯","恰高·占比尔","洛伦茨国家公园","桑吉兰早期人类地点","巴兰班南寺院群","科莫多国家公园","乌戎库隆国家公园","那烂陀寺考古遗址","干城章嘉国家公园","拉贾斯坦邦的山地要塞","西高止山脉","斋浦尔的简塔·曼塔","红堡建筑群","比莫贝特卡岩荫群","顾特卜塔","德里的胡马雍陵","桑吉的佛教古迹","孙德尔本斯国家公园","象岛石窟","帕塔达卡尔古迹组群","法塔赫布尔西格里","亨比古迹组群","克久拉霍古迹组群","果阿的教堂和会院","凯奥拉德奥国家公园","玛纳斯野生生物禁猎区","加济兰加国家公园","默哈伯利布勒姆古迹组群","科纳克的太阳神庙","泰姬陵","阿格拉堡","埃洛拉石窟","阿旖陀石窟"] 15 | 16 | private init(){} 17 | 18 | func getList() -> [WorldHeritageModel] { 19 | // 圖片有57張 20 | let itemsCount = min(places.count - 1, 57) 21 | 22 | var items = [WorldHeritageModel]() 23 | for pos in 0.. 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 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/Supports/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 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/Supports/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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/Supports/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 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/Supports/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 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/View/HomeCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeCell.swift 3 | // ParallaxGallery 4 | // 5 | // Created by don chen on 2017/3/18. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HomeCell: UICollectionViewCell { 12 | 13 | @IBOutlet weak var imageView: UIImageView! 14 | @IBOutlet weak var titleLabel: UILabel! 15 | @IBOutlet weak var timeLabel: UILabel! 16 | 17 | override func awakeFromNib() { 18 | super.awakeFromNib() 19 | 20 | imageView.contentMode = .scaleAspectFill 21 | imageView.clipsToBounds = true 22 | 23 | layer.borderColor = UIColor.white.cgColor 24 | layer.borderWidth = 1 25 | } 26 | 27 | func cellOnTableView(collectionView:UICollectionView, didScrollOnView view:UIView) { 28 | 29 | // 取得cell在collectionView中,相對view座標系統的frame 30 | let rectInSuperview = collectionView.convert(self.frame, to: view) 31 | 32 | // 位移相對中心點的距離 33 | let distanceFromCenter = view.frame.height/2 - rectInSuperview.minY 34 | 35 | // 圖片大於cell高度的部分,也就是視差的高度 36 | let parallaxHeight = imageView.frame.height - frame.height 37 | 38 | // 以cell相對view中心點移動的距離,來計算視差的移動距離 39 | let move = (distanceFromCenter / view.frame.height) * parallaxHeight 40 | 41 | // 先將imageView向上移動一半的視差高度(difference/2),然後根據move程度變化y的位置 42 | var imageRect = imageView.frame 43 | imageRect.origin.y = -(parallaxHeight/2) + move 44 | 45 | // 給予imageView一個新的frame,達到視差效果。 46 | imageView.frame = imageRect 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/View/HomeCell.xib: -------------------------------------------------------------------------------- 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 | 37 | 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 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/ViewController/HomeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.swift 3 | // ParallaxGallery 4 | // 5 | // Created by don chen on 2017/3/18. 6 | // Copyright © 2017年 Don Chen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HomeViewController: UIViewController { 12 | 13 | @IBOutlet weak var aCollectionView: UICollectionView! 14 | 15 | fileprivate var items = [WorldHeritageModel]() 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | setupView() 21 | } 22 | 23 | override func viewDidAppear(_ animated: Bool) { 24 | // 畫面第一次出現時就先計算cell中的offset 25 | scrollViewDidScroll(aCollectionView) 26 | } 27 | 28 | fileprivate func setupView() { 29 | // 註冊 Xib 30 | let cellNib = UINib(nibName: "HomeCell", bundle: nil) 31 | aCollectionView.register(cellNib, forCellWithReuseIdentifier: "aCell") 32 | 33 | // 準備items 34 | let store = WorldHeritageStore.shared 35 | items = store.getList() 36 | 37 | } 38 | } 39 | 40 | // MARK: UICollectionViewDataSource 41 | extension HomeViewController: UICollectionViewDataSource { 42 | 43 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 44 | return items.count 45 | } 46 | 47 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 48 | if let aCell = aCollectionView.dequeueReusableCell(withReuseIdentifier: "aCell", for: indexPath) as? HomeCell { 49 | let item = items[indexPath.row] 50 | aCell.imageView.image = UIImage(named: item.imageName) 51 | aCell.titleLabel.text = item.placeName 52 | aCell.timeLabel.text = item.date 53 | return aCell 54 | } 55 | 56 | return UICollectionViewCell() 57 | } 58 | 59 | } 60 | 61 | // MARK: UICollectionVieDelegateFloLayout 62 | extension HomeViewController: UICollectionViewDelegateFlowLayout { 63 | 64 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 65 | 66 | return CGSize(width: UIScreen.main.bounds.width, height: 160) 67 | 68 | } 69 | 70 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { 71 | return 0 72 | } 73 | } 74 | 75 | // MARK: UIScrollViewDelegate 76 | extension HomeViewController: UIScrollViewDelegate { 77 | func scrollViewDidScroll(_ scrollView: UIScrollView) { 78 | // 當UICollectionView被拖動的時候,通知出現在畫面上的cell 79 | for cell in aCollectionView.visibleCells { 80 | if let homeCell = cell as? HomeCell { 81 | homeCell.cellOnTableView(collectionView: aCollectionView, didScrollOnView: view) 82 | } 83 | 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /ParallaxGallery/ParallaxGallery/ViewController/HomeViewController.xib: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Swift Layout Example 2 | 平時會常常下載各行業的App來試用,發現有趣的內容都會做個紀錄,找機會來實作分享。 3 | 4 | 5 | ## 瀑布流排版(Masonry Layout) 6 | 7 | ![瀑布流排版](resource/Swift-Masonry-Layout.gif) 8 | 9 | - Blog介紹 - [Swift實現瀑布流排版](https://ios.devdon.com/archives/593) 10 | - [Source Code](https://github.com/slamdon/Swift-Layout-Example/tree/master/DynamicGridLayout) 11 | 12 | ## 捲動視差(Parallax Scrolling) 13 | 14 | ![捲動視差](resource/Swift-Parallax-Scrolling.gif) 15 | - Blog介紹 - [Swift實現捲動視差效果](https://ios.devdon.com/archives/643) 16 | - [Source Code](https://github.com/slamdon/Swift-Layout-Example/tree/master/DynamicGridLayout) 17 | 18 | ## 相關內容 19 | - [Swift Transition Example](https://github.com/slamdon/Swift-Transition-Example) - 轉場動畫例子 20 | - [Swift Interesting Example](https://github.com/slamdon/Swift-Interesting) - 有趣的例子 21 | - [Swift Layout Example](https://github.com/slamdon/Swift-Layout-Example) - 佈局例子 22 | 23 | 24 | -------------------------------------------------------------------------------- /resource/Swift-Masonry-Layout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/resource/Swift-Masonry-Layout.gif -------------------------------------------------------------------------------- /resource/Swift-Parallax-Scrolling.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slamdon/Swift-Layout-Example/2f785be912e3947cb594269dae10fb811b625a50/resource/Swift-Parallax-Scrolling.gif --------------------------------------------------------------------------------