├── AWCollectionViewSlidingDoorsDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── antoine.xcuserdatad │ └── xcschemes │ ├── AWCollectionViewSlidingDoorsDemo.xcscheme │ └── xcschememanagement.plist ├── AWCollectionViewSlidingDoorsDemo ├── AWCollectionViewSlidingDoorLayout.h ├── AWCollectionViewSlidingDoorLayout.m ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── appicon-29.png │ │ ├── appicon-29@2x-1.png │ │ ├── appicon-29@2x.png │ │ ├── appicon-29@3x.png │ │ ├── appicon-40.png │ │ ├── appicon-40@2x-1.png │ │ ├── appicon-40@2x.png │ │ ├── appicon-60@2x-1.png │ │ ├── appicon-60@2x.png │ │ ├── appicon-60@3x.png │ │ ├── appicon-76.png │ │ └── appicon-76@2x.png │ └── Brand Assets.launchimage │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── GalleryCell.h ├── GalleryCell.m ├── Info.plist ├── ViewController.h ├── ViewController.m ├── assets │ ├── menu.png │ ├── menu@2x.png │ ├── photo-1249182325215-d517de72c42d.jpg │ ├── photo-1331975562098-bac8ded504c7.jpg │ ├── photo-1431887773042-803ed52bed26.jpg │ ├── photo-1438190318100-06790c8b2e5a.jpg │ ├── photo-1443890923422-7819ed4101c0.jpg │ ├── photo-1445285303476-2f3b16d67b7a.jpg │ ├── photo-1446752875215-b2761acb3c5d.jpg │ ├── photo-1446771326090-d910bfaf00f6.jpg │ ├── photo-1446797376004-9352dfc9f789.jpg │ ├── photo-1447877015176-3099cb49cd6a.jpg │ ├── photo-1448318440207-ef1893eb8ac0.jpg │ └── photo-1449157291145-7efd050a4d0e.jpg ├── gallery.json ├── galleryCell.xib ├── galleryCell2.xib ├── main.m └── settings_view.xib ├── LICENSE ├── README.md └── awslidingdoors.gif /AWCollectionViewSlidingDoorsDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 716032011C576944001CB845 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 716032001C576944001CB845 /* main.m */; }; 11 | 716032041C576944001CB845 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 716032031C576944001CB845 /* AppDelegate.m */; }; 12 | 716032071C576944001CB845 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 716032061C576944001CB845 /* ViewController.m */; }; 13 | 7160320A1C576944001CB845 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 716032081C576944001CB845 /* Main.storyboard */; }; 14 | 7160320C1C576944001CB845 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7160320B1C576944001CB845 /* Assets.xcassets */; }; 15 | 7160320F1C576944001CB845 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7160320D1C576944001CB845 /* LaunchScreen.storyboard */; }; 16 | 716032391C576B17001CB845 /* AWCollectionViewSlidingDoorLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 716032381C576B17001CB845 /* AWCollectionViewSlidingDoorLayout.m */; }; 17 | 7160323B1C5774FD001CB845 /* galleryCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7160323A1C5774FD001CB845 /* galleryCell.xib */; }; 18 | 7160323D1C5776B8001CB845 /* gallery.json in Resources */ = {isa = PBXBuildFile; fileRef = 7160323C1C5776B8001CB845 /* gallery.json */; }; 19 | 716032791C577E33001CB845 /* GalleryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 716032781C577E33001CB845 /* GalleryCell.m */; }; 20 | 716032AF1C5791D5001CB845 /* galleryCell2.xib in Resources */ = {isa = PBXBuildFile; fileRef = 716032AE1C5791D5001CB845 /* galleryCell2.xib */; }; 21 | 716032B71C579906001CB845 /* settings_view.xib in Resources */ = {isa = PBXBuildFile; fileRef = 716032B61C579906001CB845 /* settings_view.xib */; }; 22 | 71AA29121C57B07600E3F6C2 /* menu.png in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29041C57B07600E3F6C2 /* menu.png */; }; 23 | 71AA29131C57B07600E3F6C2 /* menu@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29051C57B07600E3F6C2 /* menu@2x.png */; }; 24 | 71AA29141C57B07600E3F6C2 /* photo-1249182325215-d517de72c42d.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29061C57B07600E3F6C2 /* photo-1249182325215-d517de72c42d.jpg */; }; 25 | 71AA29151C57B07600E3F6C2 /* photo-1331975562098-bac8ded504c7.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29071C57B07600E3F6C2 /* photo-1331975562098-bac8ded504c7.jpg */; }; 26 | 71AA29161C57B07600E3F6C2 /* photo-1431887773042-803ed52bed26.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29081C57B07600E3F6C2 /* photo-1431887773042-803ed52bed26.jpg */; }; 27 | 71AA29171C57B07600E3F6C2 /* photo-1438190318100-06790c8b2e5a.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29091C57B07600E3F6C2 /* photo-1438190318100-06790c8b2e5a.jpg */; }; 28 | 71AA29181C57B07600E3F6C2 /* photo-1443890923422-7819ed4101c0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA290A1C57B07600E3F6C2 /* photo-1443890923422-7819ed4101c0.jpg */; }; 29 | 71AA29191C57B07600E3F6C2 /* photo-1445285303476-2f3b16d67b7a.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA290B1C57B07600E3F6C2 /* photo-1445285303476-2f3b16d67b7a.jpg */; }; 30 | 71AA291A1C57B07600E3F6C2 /* photo-1446752875215-b2761acb3c5d.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA290C1C57B07600E3F6C2 /* photo-1446752875215-b2761acb3c5d.jpg */; }; 31 | 71AA291B1C57B07600E3F6C2 /* photo-1446771326090-d910bfaf00f6.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA290D1C57B07600E3F6C2 /* photo-1446771326090-d910bfaf00f6.jpg */; }; 32 | 71AA291C1C57B07600E3F6C2 /* photo-1446797376004-9352dfc9f789.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA290E1C57B07600E3F6C2 /* photo-1446797376004-9352dfc9f789.jpg */; }; 33 | 71AA291D1C57B07600E3F6C2 /* photo-1447877015176-3099cb49cd6a.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA290F1C57B07600E3F6C2 /* photo-1447877015176-3099cb49cd6a.jpg */; }; 34 | 71AA291E1C57B07600E3F6C2 /* photo-1448318440207-ef1893eb8ac0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29101C57B07600E3F6C2 /* photo-1448318440207-ef1893eb8ac0.jpg */; }; 35 | 71AA291F1C57B07600E3F6C2 /* photo-1449157291145-7efd050a4d0e.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 71AA29111C57B07600E3F6C2 /* photo-1449157291145-7efd050a4d0e.jpg */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 716031FC1C576943001CB845 /* AWCollectionViewSlidingDoorsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AWCollectionViewSlidingDoorsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 716032001C576944001CB845 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 716032021C576944001CB845 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 716032031C576944001CB845 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 716032051C576944001CB845 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | 716032061C576944001CB845 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | 716032091C576944001CB845 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 7160320B1C576944001CB845 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 7160320E1C576944001CB845 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 716032101C576944001CB845 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 716032371C576B17001CB845 /* AWCollectionViewSlidingDoorLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWCollectionViewSlidingDoorLayout.h; sourceTree = ""; }; 50 | 716032381C576B17001CB845 /* AWCollectionViewSlidingDoorLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AWCollectionViewSlidingDoorLayout.m; sourceTree = ""; }; 51 | 7160323A1C5774FD001CB845 /* galleryCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = galleryCell.xib; sourceTree = ""; }; 52 | 7160323C1C5776B8001CB845 /* gallery.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = gallery.json; sourceTree = ""; }; 53 | 716032771C577E33001CB845 /* GalleryCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GalleryCell.h; sourceTree = ""; }; 54 | 716032781C577E33001CB845 /* GalleryCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GalleryCell.m; sourceTree = ""; }; 55 | 716032AE1C5791D5001CB845 /* galleryCell2.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = galleryCell2.xib; sourceTree = ""; }; 56 | 716032B61C579906001CB845 /* settings_view.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = settings_view.xib; sourceTree = ""; }; 57 | 71AA29041C57B07600E3F6C2 /* menu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu.png; sourceTree = ""; }; 58 | 71AA29051C57B07600E3F6C2 /* menu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menu@2x.png"; sourceTree = ""; }; 59 | 71AA29061C57B07600E3F6C2 /* photo-1249182325215-d517de72c42d.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1249182325215-d517de72c42d.jpg"; sourceTree = ""; }; 60 | 71AA29071C57B07600E3F6C2 /* photo-1331975562098-bac8ded504c7.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1331975562098-bac8ded504c7.jpg"; sourceTree = ""; }; 61 | 71AA29081C57B07600E3F6C2 /* photo-1431887773042-803ed52bed26.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1431887773042-803ed52bed26.jpg"; sourceTree = ""; }; 62 | 71AA29091C57B07600E3F6C2 /* photo-1438190318100-06790c8b2e5a.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1438190318100-06790c8b2e5a.jpg"; sourceTree = ""; }; 63 | 71AA290A1C57B07600E3F6C2 /* photo-1443890923422-7819ed4101c0.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1443890923422-7819ed4101c0.jpg"; sourceTree = ""; }; 64 | 71AA290B1C57B07600E3F6C2 /* photo-1445285303476-2f3b16d67b7a.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1445285303476-2f3b16d67b7a.jpg"; sourceTree = ""; }; 65 | 71AA290C1C57B07600E3F6C2 /* photo-1446752875215-b2761acb3c5d.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1446752875215-b2761acb3c5d.jpg"; sourceTree = ""; }; 66 | 71AA290D1C57B07600E3F6C2 /* photo-1446771326090-d910bfaf00f6.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1446771326090-d910bfaf00f6.jpg"; sourceTree = ""; }; 67 | 71AA290E1C57B07600E3F6C2 /* photo-1446797376004-9352dfc9f789.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1446797376004-9352dfc9f789.jpg"; sourceTree = ""; }; 68 | 71AA290F1C57B07600E3F6C2 /* photo-1447877015176-3099cb49cd6a.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1447877015176-3099cb49cd6a.jpg"; sourceTree = ""; }; 69 | 71AA29101C57B07600E3F6C2 /* photo-1448318440207-ef1893eb8ac0.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1448318440207-ef1893eb8ac0.jpg"; sourceTree = ""; }; 70 | 71AA29111C57B07600E3F6C2 /* photo-1449157291145-7efd050a4d0e.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1449157291145-7efd050a4d0e.jpg"; sourceTree = ""; }; 71 | /* End PBXFileReference section */ 72 | 73 | /* Begin PBXFrameworksBuildPhase section */ 74 | 716031F91C576943001CB845 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 716031F31C576943001CB845 = { 85 | isa = PBXGroup; 86 | children = ( 87 | 716031FE1C576944001CB845 /* AWCollectionViewSlidingDoorsDemo */, 88 | 716031FD1C576943001CB845 /* Products */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 716031FD1C576943001CB845 /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 716031FC1C576943001CB845 /* AWCollectionViewSlidingDoorsDemo.app */, 96 | ); 97 | name = Products; 98 | sourceTree = ""; 99 | }; 100 | 716031FE1C576944001CB845 /* AWCollectionViewSlidingDoorsDemo */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 71AA29031C57B03600E3F6C2 /* assets */, 104 | 716032331C5769A7001CB845 /* AWCollectionViewSlidingDoors */, 105 | 716032021C576944001CB845 /* AppDelegate.h */, 106 | 716032031C576944001CB845 /* AppDelegate.m */, 107 | 716032051C576944001CB845 /* ViewController.h */, 108 | 716032061C576944001CB845 /* ViewController.m */, 109 | 7160323C1C5776B8001CB845 /* gallery.json */, 110 | 71AA29201C57B09E00E3F6C2 /* GalleryCell */, 111 | 716032B61C579906001CB845 /* settings_view.xib */, 112 | 716032081C576944001CB845 /* Main.storyboard */, 113 | 7160320B1C576944001CB845 /* Assets.xcassets */, 114 | 7160320D1C576944001CB845 /* LaunchScreen.storyboard */, 115 | 716032101C576944001CB845 /* Info.plist */, 116 | 716031FF1C576944001CB845 /* Supporting Files */, 117 | ); 118 | path = AWCollectionViewSlidingDoorsDemo; 119 | sourceTree = ""; 120 | }; 121 | 716031FF1C576944001CB845 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 716032001C576944001CB845 /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 716032331C5769A7001CB845 /* AWCollectionViewSlidingDoors */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 716032371C576B17001CB845 /* AWCollectionViewSlidingDoorLayout.h */, 133 | 716032381C576B17001CB845 /* AWCollectionViewSlidingDoorLayout.m */, 134 | ); 135 | name = AWCollectionViewSlidingDoors; 136 | sourceTree = ""; 137 | }; 138 | 71AA29031C57B03600E3F6C2 /* assets */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 71AA29041C57B07600E3F6C2 /* menu.png */, 142 | 71AA29051C57B07600E3F6C2 /* menu@2x.png */, 143 | 71AA29061C57B07600E3F6C2 /* photo-1249182325215-d517de72c42d.jpg */, 144 | 71AA29071C57B07600E3F6C2 /* photo-1331975562098-bac8ded504c7.jpg */, 145 | 71AA29081C57B07600E3F6C2 /* photo-1431887773042-803ed52bed26.jpg */, 146 | 71AA29091C57B07600E3F6C2 /* photo-1438190318100-06790c8b2e5a.jpg */, 147 | 71AA290A1C57B07600E3F6C2 /* photo-1443890923422-7819ed4101c0.jpg */, 148 | 71AA290B1C57B07600E3F6C2 /* photo-1445285303476-2f3b16d67b7a.jpg */, 149 | 71AA290C1C57B07600E3F6C2 /* photo-1446752875215-b2761acb3c5d.jpg */, 150 | 71AA290D1C57B07600E3F6C2 /* photo-1446771326090-d910bfaf00f6.jpg */, 151 | 71AA290E1C57B07600E3F6C2 /* photo-1446797376004-9352dfc9f789.jpg */, 152 | 71AA290F1C57B07600E3F6C2 /* photo-1447877015176-3099cb49cd6a.jpg */, 153 | 71AA29101C57B07600E3F6C2 /* photo-1448318440207-ef1893eb8ac0.jpg */, 154 | 71AA29111C57B07600E3F6C2 /* photo-1449157291145-7efd050a4d0e.jpg */, 155 | ); 156 | path = assets; 157 | sourceTree = ""; 158 | }; 159 | 71AA29201C57B09E00E3F6C2 /* GalleryCell */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 716032771C577E33001CB845 /* GalleryCell.h */, 163 | 716032781C577E33001CB845 /* GalleryCell.m */, 164 | 716032AE1C5791D5001CB845 /* galleryCell2.xib */, 165 | 7160323A1C5774FD001CB845 /* galleryCell.xib */, 166 | ); 167 | name = GalleryCell; 168 | sourceTree = ""; 169 | }; 170 | /* End PBXGroup section */ 171 | 172 | /* Begin PBXNativeTarget section */ 173 | 716031FB1C576943001CB845 /* AWCollectionViewSlidingDoorsDemo */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 716032291C576944001CB845 /* Build configuration list for PBXNativeTarget "AWCollectionViewSlidingDoorsDemo" */; 176 | buildPhases = ( 177 | 716031F81C576943001CB845 /* Sources */, 178 | 716031F91C576943001CB845 /* Frameworks */, 179 | 716031FA1C576943001CB845 /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | ); 185 | name = AWCollectionViewSlidingDoorsDemo; 186 | productName = AWCollectionViewSlidingDoorsDemo; 187 | productReference = 716031FC1C576943001CB845 /* AWCollectionViewSlidingDoorsDemo.app */; 188 | productType = "com.apple.product-type.application"; 189 | }; 190 | /* End PBXNativeTarget section */ 191 | 192 | /* Begin PBXProject section */ 193 | 716031F41C576943001CB845 /* Project object */ = { 194 | isa = PBXProject; 195 | attributes = { 196 | LastUpgradeCheck = 0720; 197 | ORGANIZATIONNAME = "Antoine Wette"; 198 | TargetAttributes = { 199 | 716031FB1C576943001CB845 = { 200 | CreatedOnToolsVersion = 7.2; 201 | }; 202 | }; 203 | }; 204 | buildConfigurationList = 716031F71C576943001CB845 /* Build configuration list for PBXProject "AWCollectionViewSlidingDoorsDemo" */; 205 | compatibilityVersion = "Xcode 3.2"; 206 | developmentRegion = English; 207 | hasScannedForEncodings = 0; 208 | knownRegions = ( 209 | en, 210 | Base, 211 | ); 212 | mainGroup = 716031F31C576943001CB845; 213 | productRefGroup = 716031FD1C576943001CB845 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 716031FB1C576943001CB845 /* AWCollectionViewSlidingDoorsDemo */, 218 | ); 219 | }; 220 | /* End PBXProject section */ 221 | 222 | /* Begin PBXResourcesBuildPhase section */ 223 | 716031FA1C576943001CB845 /* Resources */ = { 224 | isa = PBXResourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | 71AA291E1C57B07600E3F6C2 /* photo-1448318440207-ef1893eb8ac0.jpg in Resources */, 228 | 71AA291D1C57B07600E3F6C2 /* photo-1447877015176-3099cb49cd6a.jpg in Resources */, 229 | 71AA291C1C57B07600E3F6C2 /* photo-1446797376004-9352dfc9f789.jpg in Resources */, 230 | 71AA29171C57B07600E3F6C2 /* photo-1438190318100-06790c8b2e5a.jpg in Resources */, 231 | 71AA29121C57B07600E3F6C2 /* menu.png in Resources */, 232 | 71AA291B1C57B07600E3F6C2 /* photo-1446771326090-d910bfaf00f6.jpg in Resources */, 233 | 7160323B1C5774FD001CB845 /* galleryCell.xib in Resources */, 234 | 71AA29141C57B07600E3F6C2 /* photo-1249182325215-d517de72c42d.jpg in Resources */, 235 | 7160320F1C576944001CB845 /* LaunchScreen.storyboard in Resources */, 236 | 7160320C1C576944001CB845 /* Assets.xcassets in Resources */, 237 | 71AA29191C57B07600E3F6C2 /* photo-1445285303476-2f3b16d67b7a.jpg in Resources */, 238 | 71AA291A1C57B07600E3F6C2 /* photo-1446752875215-b2761acb3c5d.jpg in Resources */, 239 | 71AA291F1C57B07600E3F6C2 /* photo-1449157291145-7efd050a4d0e.jpg in Resources */, 240 | 71AA29131C57B07600E3F6C2 /* menu@2x.png in Resources */, 241 | 71AA29181C57B07600E3F6C2 /* photo-1443890923422-7819ed4101c0.jpg in Resources */, 242 | 7160320A1C576944001CB845 /* Main.storyboard in Resources */, 243 | 7160323D1C5776B8001CB845 /* gallery.json in Resources */, 244 | 71AA29161C57B07600E3F6C2 /* photo-1431887773042-803ed52bed26.jpg in Resources */, 245 | 716032AF1C5791D5001CB845 /* galleryCell2.xib in Resources */, 246 | 71AA29151C57B07600E3F6C2 /* photo-1331975562098-bac8ded504c7.jpg in Resources */, 247 | 716032B71C579906001CB845 /* settings_view.xib in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | /* End PBXResourcesBuildPhase section */ 252 | 253 | /* Begin PBXSourcesBuildPhase section */ 254 | 716031F81C576943001CB845 /* Sources */ = { 255 | isa = PBXSourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | 716032071C576944001CB845 /* ViewController.m in Sources */, 259 | 716032391C576B17001CB845 /* AWCollectionViewSlidingDoorLayout.m in Sources */, 260 | 716032041C576944001CB845 /* AppDelegate.m in Sources */, 261 | 716032011C576944001CB845 /* main.m in Sources */, 262 | 716032791C577E33001CB845 /* GalleryCell.m in Sources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXSourcesBuildPhase section */ 267 | 268 | /* Begin PBXVariantGroup section */ 269 | 716032081C576944001CB845 /* Main.storyboard */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | 716032091C576944001CB845 /* Base */, 273 | ); 274 | name = Main.storyboard; 275 | sourceTree = ""; 276 | }; 277 | 7160320D1C576944001CB845 /* LaunchScreen.storyboard */ = { 278 | isa = PBXVariantGroup; 279 | children = ( 280 | 7160320E1C576944001CB845 /* Base */, 281 | ); 282 | name = LaunchScreen.storyboard; 283 | sourceTree = ""; 284 | }; 285 | /* End PBXVariantGroup section */ 286 | 287 | /* Begin XCBuildConfiguration section */ 288 | 716032271C576944001CB845 /* Debug */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 293 | CLANG_CXX_LIBRARY = "libc++"; 294 | CLANG_ENABLE_MODULES = YES; 295 | CLANG_ENABLE_OBJC_ARC = YES; 296 | CLANG_WARN_BOOL_CONVERSION = YES; 297 | CLANG_WARN_CONSTANT_CONVERSION = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 306 | COPY_PHASE_STRIP = NO; 307 | DEBUG_INFORMATION_FORMAT = dwarf; 308 | ENABLE_STRICT_OBJC_MSGSEND = YES; 309 | ENABLE_TESTABILITY = YES; 310 | GCC_C_LANGUAGE_STANDARD = gnu99; 311 | GCC_DYNAMIC_NO_PIC = NO; 312 | GCC_NO_COMMON_BLOCKS = YES; 313 | GCC_OPTIMIZATION_LEVEL = 0; 314 | GCC_PREPROCESSOR_DEFINITIONS = ( 315 | "DEBUG=1", 316 | "$(inherited)", 317 | ); 318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 320 | GCC_WARN_UNDECLARED_SELECTOR = YES; 321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 322 | GCC_WARN_UNUSED_FUNCTION = YES; 323 | GCC_WARN_UNUSED_VARIABLE = YES; 324 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 325 | MTL_ENABLE_DEBUG_INFO = YES; 326 | ONLY_ACTIVE_ARCH = YES; 327 | SDKROOT = iphoneos; 328 | TARGETED_DEVICE_FAMILY = "1,2"; 329 | }; 330 | name = Debug; 331 | }; 332 | 716032281C576944001CB845 /* Release */ = { 333 | isa = XCBuildConfiguration; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 337 | CLANG_CXX_LIBRARY = "libc++"; 338 | CLANG_ENABLE_MODULES = YES; 339 | CLANG_ENABLE_OBJC_ARC = YES; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_CONSTANT_CONVERSION = YES; 342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 343 | CLANG_WARN_EMPTY_BODY = YES; 344 | CLANG_WARN_ENUM_CONVERSION = YES; 345 | CLANG_WARN_INT_CONVERSION = YES; 346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 347 | CLANG_WARN_UNREACHABLE_CODE = YES; 348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 349 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 350 | COPY_PHASE_STRIP = NO; 351 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 352 | ENABLE_NS_ASSERTIONS = NO; 353 | ENABLE_STRICT_OBJC_MSGSEND = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_NO_COMMON_BLOCKS = YES; 356 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 357 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 358 | GCC_WARN_UNDECLARED_SELECTOR = YES; 359 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 360 | GCC_WARN_UNUSED_FUNCTION = YES; 361 | GCC_WARN_UNUSED_VARIABLE = YES; 362 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 363 | MTL_ENABLE_DEBUG_INFO = NO; 364 | SDKROOT = iphoneos; 365 | TARGETED_DEVICE_FAMILY = "1,2"; 366 | VALIDATE_PRODUCT = YES; 367 | }; 368 | name = Release; 369 | }; 370 | 7160322A1C576944001CB845 /* Debug */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; 375 | INFOPLIST_FILE = AWCollectionViewSlidingDoorsDemo/Info.plist; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 377 | PRODUCT_BUNDLE_IDENTIFIER = com.aw.AWCollectionViewSlidingDoorsDemo; 378 | PRODUCT_NAME = "$(TARGET_NAME)"; 379 | }; 380 | name = Debug; 381 | }; 382 | 7160322B1C576944001CB845 /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 386 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; 387 | INFOPLIST_FILE = AWCollectionViewSlidingDoorsDemo/Info.plist; 388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 389 | PRODUCT_BUNDLE_IDENTIFIER = com.aw.AWCollectionViewSlidingDoorsDemo; 390 | PRODUCT_NAME = "$(TARGET_NAME)"; 391 | }; 392 | name = Release; 393 | }; 394 | /* End XCBuildConfiguration section */ 395 | 396 | /* Begin XCConfigurationList section */ 397 | 716031F71C576943001CB845 /* Build configuration list for PBXProject "AWCollectionViewSlidingDoorsDemo" */ = { 398 | isa = XCConfigurationList; 399 | buildConfigurations = ( 400 | 716032271C576944001CB845 /* Debug */, 401 | 716032281C576944001CB845 /* Release */, 402 | ); 403 | defaultConfigurationIsVisible = 0; 404 | defaultConfigurationName = Release; 405 | }; 406 | 716032291C576944001CB845 /* Build configuration list for PBXNativeTarget "AWCollectionViewSlidingDoorsDemo" */ = { 407 | isa = XCConfigurationList; 408 | buildConfigurations = ( 409 | 7160322A1C576944001CB845 /* Debug */, 410 | 7160322B1C576944001CB845 /* Release */, 411 | ); 412 | defaultConfigurationIsVisible = 0; 413 | defaultConfigurationName = Release; 414 | }; 415 | /* End XCConfigurationList section */ 416 | }; 417 | rootObject = 716031F41C576943001CB845 /* Project object */; 418 | } 419 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo.xcodeproj/xcuserdata/antoine.xcuserdatad/xcschemes/AWCollectionViewSlidingDoorsDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo.xcodeproj/xcuserdata/antoine.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AWCollectionViewSlidingDoorsDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 716031FB1C576943001CB845 16 | 17 | primary 18 | 19 | 20 | 716032141C576944001CB845 21 | 22 | primary 23 | 24 | 25 | 7160321F1C576944001CB845 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/AWCollectionViewSlidingDoorLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // AWCollectionViewSlidingDoorLayout.h 3 | // BERS 4 | // 5 | // Created by Antoine Wette on 31.03.15. 6 | // Copyright (c) 2015 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AWCollectionViewSlidingDoorLayout : UICollectionViewLayout 12 | 13 | @property (readwrite, nonatomic, assign) int cellCount; 14 | @property (readwrite, nonatomic, assign) CGFloat maxRatio; 15 | @property (readwrite, nonatomic, assign) CGFloat minRatio; 16 | @property (readwrite, nonatomic, assign) CGFloat maxHeight; 17 | @property (readwrite, nonatomic, assign) CGFloat minHeight; 18 | @property (readwrite, nonatomic, assign) CGFloat cellHeight; 19 | 20 | -(id)initWithMaxRatio: (CGFloat)maxR andMinRatio: (CGFloat)minR; 21 | @end 22 | 23 | @protocol AWCollectionViewDelegateSlidingDoorLayout 24 | @required 25 | /** 26 | * 27 | */ 28 | - (void)layoutSubviewsWithAttributes:(NSMutableArray*)theAttributes; 29 | @end 30 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/AWCollectionViewSlidingDoorLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // AWCollectionViewSlidingDoorLayout.m 3 | // BERS 4 | // 5 | // Created by Antoine Wette on 31.03.15. 6 | // Copyright (c) 2015 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import "AWCollectionViewSlidingDoorLayout.h" 10 | 11 | @interface AWCollectionViewSlidingDoorLayout () 12 | @property (nonatomic, weak) id delegate; 13 | @end 14 | 15 | @implementation AWCollectionViewSlidingDoorLayout 16 | 17 | - (id)init 18 | { 19 | if ((self = [super init]) != NULL) 20 | { 21 | [self setup]; 22 | } 23 | return self; 24 | } 25 | 26 | - (id )delegate { 27 | return (id )self.collectionView.delegate; 28 | } 29 | 30 | -(id)initWithMaxRatio: (CGFloat)maxR andMinRatio: (CGFloat)minR{ 31 | if ((self = [super init]) != NULL) 32 | { 33 | self.maxRatio = maxR;//420.0f; 34 | self.minRatio = minR;//(CGSize){ 220.0f, 80.0f }; 35 | [self setup]; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)setup 41 | { 42 | 43 | } 44 | 45 | - (void)prepareLayout 46 | { 47 | [super prepareLayout]; 48 | self.cellCount = (int)[self.collectionView numberOfItemsInSection:0]; 49 | self.maxHeight = self.collectionView.bounds.size.width / self.maxRatio; 50 | self.minHeight = self.collectionView.bounds.size.width / self.minRatio; 51 | self.cellHeight = (self.maxHeight*0.5 + self.minHeight*0.5); 52 | } 53 | 54 | - (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)oldBounds 55 | { 56 | return(YES); 57 | } 58 | 59 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 60 | { 61 | 62 | NSMutableArray *theLayoutAttributes = [NSMutableArray array]; 63 | 64 | float firstItem = 0;//fmax(0 , floorf(minY / self.itemHeight) - 4 ); 65 | float lastItem = self.cellCount-1;//fmin( self.cellCount-1 , floorf(maxY / self.itemHeight) ); 66 | 67 | 68 | for( int i = firstItem; i <= lastItem; i++ ){ 69 | NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0]; 70 | UICollectionViewLayoutAttributes *theAttributes = [self layoutAttributesForItemAtIndexPath:indexPath]; 71 | [theLayoutAttributes addObject:theAttributes]; 72 | } 73 | 74 | if ([self.delegate respondsToSelector:@selector(layoutSubviewsWithAttributes:)]) { 75 | [self.delegate layoutSubviewsWithAttributes:theLayoutAttributes]; 76 | } 77 | 78 | return(theLayoutAttributes); 79 | } 80 | 81 | - (CGSize)collectionViewContentSize{ 82 | const CGSize theSize = { 83 | .width = self.collectionView.bounds.size.width, 84 | .height = (self.cellCount-1) * self.cellHeight + self.collectionView.bounds.size.height, 85 | }; 86 | return(theSize); 87 | } 88 | 89 | - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath 90 | { 91 | CGFloat currentIndex = self.collectionView.contentOffset.y / self.cellHeight; 92 | 93 | UICollectionViewLayoutAttributes *theAttributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; 94 | theAttributes.center = CGPointMake(self.collectionView.center.x , self.maxHeight*0.5); 95 | 96 | CGAffineTransform translationT; 97 | 98 | 99 | CGFloat endTranslateOffset = 0; 100 | 101 | CGFloat endFactor1 = (self.collectionView.bounds.size.height - self.maxHeight) / self.minHeight; 102 | if(currentIndex + 1 > (self.cellCount - endFactor1)){ 103 | CGFloat valA = (currentIndex + 1 - (self.cellCount - endFactor1)); 104 | CGFloat valB = valA / endFactor1; 105 | endTranslateOffset = (self.collectionView.bounds.size.height - self.maxHeight) * valB; 106 | } 107 | 108 | 109 | /* 110 | CGFloat endTranslateOffset = 0; 111 | CGFloat lastItemY = (self.cellHeight * (self.cellCount - 1)) - self.collectionView.bounds.size.height; 112 | 113 | if(self.collectionView.contentOffset.y > lastItemY){ 114 | CGFloat maxEnd = self.collectionView.contentSize.height - lastItemY; 115 | CGFloat factorEnd = (self.collectionView.contentOffset.y - lastItemY) / maxEnd; 116 | endTranslateOffset = factorEnd * self.collectionView.bounds.size.height; 117 | } 118 | */ 119 | 120 | if(indexPath.item > floor(currentIndex) && indexPath.item <= floor(currentIndex) + 1 ){ 121 | CGFloat factorY = floor(currentIndex) + 1 - currentIndex; 122 | CGFloat factorSize = fabs(1 - factorY); 123 | theAttributes.size = CGSizeMake(self.collectionView.bounds.size.width, self.minHeight + (factorSize * (self.maxHeight - self.minHeight) )); 124 | translationT = CGAffineTransformMakeTranslation(0 ,endTranslateOffset + self.collectionView.contentOffset.y + self.cellHeight * factorY); 125 | }else if(indexPath.item > floor(currentIndex) + 1){ 126 | translationT = CGAffineTransformMakeTranslation(0 , endTranslateOffset+ self.collectionView.contentOffset.y +self.cellHeight + (self.minHeight * fmax(0, ((float)indexPath.item-currentIndex-1))) ); 127 | theAttributes.size = CGSizeMake(self.collectionView.bounds.size.width, self.minHeight); 128 | }else if (indexPath.item <= floor(currentIndex) && indexPath.item > floor(currentIndex) - 1){ 129 | CGFloat factorY = 1 - (floor(currentIndex) + 1 - currentIndex); 130 | CGFloat factorSize = fabs(1 - factorY); 131 | theAttributes.size = CGSizeMake(self.collectionView.bounds.size.width, self.minHeight + (factorSize * (self.maxHeight - self.minHeight) )); 132 | translationT = CGAffineTransformMakeTranslation(0 , endTranslateOffset + self.collectionView.contentOffset.y - self.cellHeight * factorY); 133 | }else if(indexPath.item <= floor(currentIndex) - 1){ 134 | theAttributes.size = CGSizeMake(self.collectionView.bounds.size.width, self.minHeight); 135 | translationT = CGAffineTransformMakeTranslation(0 , endTranslateOffset + self.collectionView.contentOffset.y - self.cellHeight + (self.minHeight * fmin(0, ((float)indexPath.item-currentIndex+1))) ); 136 | } 137 | 138 | theAttributes.transform = translationT; 139 | theAttributes.zIndex = 1; 140 | return(theAttributes); 141 | } 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AWCollectionViewSlidingDoorsDemo 4 | // 5 | // Created by Antoine Wette on 26.01.16. 6 | // Copyright © 2016 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AWCollectionViewSlidingDoorsDemo 4 | // 5 | // Created by Antoine Wette on 26.01.16. 6 | // Copyright © 2016 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "appicon-29@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "appicon-29@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "appicon-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "appicon-60@2x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "appicon-60@2x-1.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "appicon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "appicon-29.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "appicon-29@2x-1.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "appicon-40.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "appicon-40@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "76x76", 65 | "idiom" : "ipad", 66 | "filename" : "appicon-76.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "appicon-76@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "idiom" : "ipad", 77 | "size" : "83.5x83.5", 78 | "scale" : "2x" 79 | } 80 | ], 81 | "info" : { 82 | "version" : 1, 83 | "author" : "xcode" 84 | } 85 | } -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29@2x-1.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29@2x.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-29@3x.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-40.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-40@2x-1.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-40@2x.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-60@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-60@2x-1.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-60@2x.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-60@3x.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-76.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/Assets.xcassets/AppIcon.appiconset/appicon-76@2x.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Assets.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "minimum-system-version" : "7.0", 7 | "extent" : "full-screen", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "minimum-system-version" : "7.0", 14 | "extent" : "full-screen", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "landscape", 19 | "idiom" : "ipad", 20 | "minimum-system-version" : "7.0", 21 | "extent" : "full-screen", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "portrait", 26 | "idiom" : "iphone", 27 | "minimum-system-version" : "7.0", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "minimum-system-version" : "7.0", 34 | "subtype" : "retina4", 35 | "scale" : "2x" 36 | }, 37 | { 38 | "orientation" : "portrait", 39 | "idiom" : "ipad", 40 | "minimum-system-version" : "7.0", 41 | "extent" : "full-screen", 42 | "scale" : "1x" 43 | } 44 | ], 45 | "info" : { 46 | "version" : 1, 47 | "author" : "xcode" 48 | } 49 | } -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/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 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/GalleryCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // GalleryCell.h 3 | // AWCollectionViewSlidingDoorsDemo 4 | // 5 | // Created by Antoine Wette on 26.01.16. 6 | // Copyright © 2016 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GalleryCell : UICollectionViewCell 12 | 13 | @property (nonatomic, strong) IBOutlet UIView *overlayView; 14 | @property (nonatomic, strong) IBOutlet UIImageView *imageView; 15 | @property (nonatomic, strong) IBOutlet UILabel *titleLabel; 16 | @property (nonatomic, strong) IBOutlet UILabel *subtitleLabel; 17 | @property (nonatomic, strong) IBOutlet UIView *subtitleWrapper; 18 | @end 19 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/GalleryCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // GalleryCell.m 3 | // AWCollectionViewSlidingDoorsDemo 4 | // 5 | // Created by Antoine Wette on 26.01.16. 6 | // Copyright © 2016 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import "GalleryCell.h" 10 | 11 | @implementation GalleryCell 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | AW Demo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AWCollectionViewSlidingDoorsDemo 4 | // 5 | // Created by Antoine Wette on 26.01.16. 6 | // Copyright © 2016 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | - (IBAction)showMenu:(id)sender; 14 | - (IBAction)closeMenu:(id)sender; 15 | @property (nonatomic, weak) IBOutlet UICollectionView *collectionView; 16 | @property (nonatomic, weak) IBOutlet UIBarButtonItem *editBtn; 17 | @property NSArray *items;@end 18 | 19 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AWCollectionViewSlidingDoorsDemo 4 | // 5 | // Created by Antoine Wette on 26.01.16. 6 | // Copyright © 2016 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AWCollectionViewSlidingDoorLayout.h" 11 | #import "GalleryCell.h" 12 | 13 | #define cellID @"galleryCellID" 14 | #define cellID2 @"galleryCellID2" 15 | #define defaultMinRatio 6 16 | #define defaultMaxRatio 1.5 17 | 18 | @interface ViewController () 19 | 20 | @end 21 | 22 | @implementation ViewController{ 23 | NSString *currentStyle; 24 | UIView *menuOverlay; 25 | 26 | UILabel *minRatioLabel; 27 | UISlider *minRatioSlider; 28 | UILabel *maxRatioLabel; 29 | UISlider *maxRatioSlider; 30 | 31 | CGFloat minRatio; 32 | CGFloat maxRatio; 33 | 34 | UISegmentedControl *exampleSwitch; 35 | AWCollectionViewSlidingDoorLayout *slidingLayout; 36 | int exampleIndex; 37 | } 38 | 39 | @synthesize collectionView, items; 40 | 41 | - (void)viewDidLoad { 42 | [super viewDidLoad]; 43 | 44 | currentStyle = @"style1"; 45 | 46 | NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"gallery" ofType:@"json"]; 47 | NSData *jsonData = [[NSFileManager defaultManager] contentsAtPath:jsonPath]; 48 | items = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:nil]; 49 | 50 | minRatio = defaultMinRatio; 51 | maxRatio = defaultMaxRatio; 52 | exampleIndex = 0; 53 | 54 | [collectionView registerNib:[UINib nibWithNibName:@"galleryCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:cellID]; 55 | [collectionView registerNib:[UINib nibWithNibName:@"galleryCell2" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:cellID2]; 56 | slidingLayout = [[AWCollectionViewSlidingDoorLayout alloc] initWithMaxRatio:defaultMaxRatio andMinRatio:defaultMinRatio]; 57 | [collectionView setCollectionViewLayout:slidingLayout]; 58 | [collectionView.collectionViewLayout invalidateLayout]; 59 | 60 | [self buildSettings]; 61 | [self performSelector:@selector(quickFix) withObject:nil afterDelay:0.01]; 62 | } 63 | 64 | -(void)buildSettings{ 65 | NSArray *viewArr = [[NSBundle mainBundle] loadNibNamed:@"settings_view" owner:self options:nil]; 66 | menuOverlay = [viewArr objectAtIndex:0]; 67 | menuOverlay.translatesAutoresizingMaskIntoConstraints = NO; 68 | [self.view addSubview:menuOverlay]; 69 | [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[view]|" 70 | options:0 71 | metrics:nil 72 | views:@{@"view": menuOverlay}]]; 73 | [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[view]|" 74 | options:0 75 | metrics:nil 76 | views:@{@"view": menuOverlay}]]; 77 | menuOverlay.alpha = 0; 78 | menuOverlay.hidden = YES; 79 | 80 | minRatioLabel = (UILabel*)[menuOverlay viewWithTag:100]; 81 | minRatioSlider = (UISlider*)[menuOverlay viewWithTag:200]; 82 | 83 | [minRatioSlider addTarget:self action:@selector(updateDialSettings) forControlEvents:UIControlEventValueChanged]; 84 | 85 | maxRatioLabel = (UILabel*)[menuOverlay viewWithTag:101]; 86 | maxRatioSlider = (UISlider*)[menuOverlay viewWithTag:201]; 87 | [maxRatioSlider addTarget:self action:@selector(updateDialSettings) forControlEvents:UIControlEventValueChanged]; 88 | 89 | exampleSwitch = (UISegmentedControl*)[menuOverlay viewWithTag:203]; 90 | [exampleSwitch addTarget:self action:@selector(switchExample) forControlEvents:UIControlEventValueChanged]; 91 | } 92 | 93 | -(void)updateDialSettings{ 94 | minRatio = minRatioSlider.value; 95 | maxRatio = maxRatioSlider.value; 96 | 97 | [minRatioLabel setText:[NSString stringWithFormat:@"Min Ratio: %0.2f", minRatio]]; 98 | 99 | [maxRatioLabel setText:[NSString stringWithFormat:@"Max Ratio: %0.2f", maxRatio]]; 100 | 101 | [slidingLayout setMinRatio:minRatio]; 102 | [slidingLayout setMaxRatio:maxRatio]; 103 | 104 | 105 | [slidingLayout invalidateLayout]; 106 | } 107 | 108 | -(void)switchExample{ 109 | exampleIndex = (int)exampleSwitch.selectedSegmentIndex; 110 | [collectionView reloadData]; 111 | [self performSelector:@selector(quickFix) withObject:nil afterDelay:0.01]; 112 | } 113 | 114 | -(void)showMenu:(id)sender{ 115 | menuOverlay.alpha = 0; 116 | menuOverlay.hidden = NO; 117 | [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ 118 | menuOverlay.alpha = 1; 119 | } completion:^(BOOL finished) { 120 | }]; 121 | } 122 | -(void)closeMenu:(id)sender{ 123 | [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ 124 | menuOverlay.alpha = 0; 125 | } completion:^(BOOL finished) { 126 | menuOverlay.hidden = YES; 127 | }]; 128 | } 129 | 130 | -(void)quickFix{ 131 | [collectionView setContentOffset:CGPointMake(0, collectionView.contentOffset.y+1)]; 132 | } 133 | 134 | -(void)layoutSubviewsWithAttributes:(NSMutableArray *)theAttributes{ 135 | for(int i = 0; i < theAttributes.count; i++){ 136 | GalleryCell *cell = (GalleryCell*)[collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; 137 | 138 | CGFloat maxHeight = self.collectionView.bounds.size.width / maxRatio; 139 | CGFloat minHeight = self.collectionView.bounds.size.width / minRatio; 140 | CGFloat cellHeight = (maxHeight*0.5 + minHeight*0.5); 141 | CGFloat currentIndex = self.collectionView.contentOffset.y / cellHeight; 142 | 143 | CGFloat ratio = cell.bounds.size.width / cell.bounds.size.height; 144 | CGFloat maxDiff = minRatio - maxRatio; 145 | CGFloat diff = minRatio - ratio; 146 | 147 | CGFloat alpha = diff/maxDiff; 148 | 149 | 150 | if(exampleIndex == 0){ 151 | cell.overlayView.alpha = 1 - alpha; 152 | cell.titleLabel.alpha = alpha; 153 | }else{ 154 | cell.overlayView.alpha = 1 - alpha; 155 | cell.titleLabel.alpha = alpha; 156 | cell.subtitleLabel.alpha = alpha; 157 | if(i > currentIndex){ 158 | cell.titleLabel.transform = CGAffineTransformMakeScale(1 - (1- alpha) * 0.3, 1 - (1- alpha) * 0.3); 159 | cell.subtitleLabel.transform = CGAffineTransformMakeTranslation(0, (1- alpha) * 30); 160 | }else{ 161 | cell.titleLabel.transform = CGAffineTransformIdentity; 162 | cell.subtitleLabel.transform = CGAffineTransformIdentity; 163 | } 164 | } 165 | 166 | } 167 | } 168 | 169 | 170 | -(BOOL)prefersStatusBarHidden{ 171 | return YES; 172 | } 173 | 174 | -(UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath{ 175 | NSDictionary *itemDict = [items objectAtIndex:indexPath.item]; 176 | 177 | GalleryCell *cell; 178 | if(exampleIndex == 0){ 179 | cell = (GalleryCell*)[cv dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath]; 180 | }else{ 181 | cell = (GalleryCell*)[cv dequeueReusableCellWithReuseIdentifier:cellID2 forIndexPath:indexPath]; 182 | } 183 | 184 | cell.titleLabel.text = [[itemDict valueForKey:@"title"] uppercaseString]; 185 | cell.subtitleLabel.text = [itemDict valueForKey:@"subtitle"]; 186 | cell.imageView.image = [UIImage imageNamed:[itemDict valueForKey:@"image"]]; 187 | 188 | return cell; 189 | } 190 | 191 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{ 192 | return 1; 193 | } 194 | 195 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ 196 | return items.count; 197 | } 198 | 199 | -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ 200 | 201 | } 202 | 203 | 204 | 205 | - (void)didReceiveMemoryWarning { 206 | [super didReceiveMemoryWarning]; 207 | // Dispose of any resources that can be recreated. 208 | } 209 | 210 | @end 211 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/menu.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/menu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/menu@2x.png -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1249182325215-d517de72c42d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1249182325215-d517de72c42d.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1331975562098-bac8ded504c7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1331975562098-bac8ded504c7.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1431887773042-803ed52bed26.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1431887773042-803ed52bed26.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1438190318100-06790c8b2e5a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1438190318100-06790c8b2e5a.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1443890923422-7819ed4101c0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1443890923422-7819ed4101c0.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1445285303476-2f3b16d67b7a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1445285303476-2f3b16d67b7a.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1446752875215-b2761acb3c5d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1446752875215-b2761acb3c5d.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1446771326090-d910bfaf00f6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1446771326090-d910bfaf00f6.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1446797376004-9352dfc9f789.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1446797376004-9352dfc9f789.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1447877015176-3099cb49cd6a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1447877015176-3099cb49cd6a.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1448318440207-ef1893eb8ac0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1448318440207-ef1893eb8ac0.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/assets/photo-1449157291145-7efd050a4d0e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/AWCollectionViewSlidingDoorsDemo/assets/photo-1449157291145-7efd050a4d0e.jpg -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/gallery.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "title": "Snowy Road", 3 | "subtitle":"Drive drive drive", 4 | "image": "photo-1249182325215-d517de72c42d.jpg" 5 | }, { 6 | "title": "The Desert", 7 | "subtitle": "So hot, Much sand", 8 | "image": "photo-1331975562098-bac8ded504c7.jpg" 9 | }, { 10 | "title": "The Green", 11 | "subtitle": "great escape", 12 | "image": "photo-1431887773042-803ed52bed26.jpg" 13 | }, { 14 | "title": "Green door", 15 | "subtitle": "Knock knock", 16 | "image": "photo-1438190318100-06790c8b2e5a.jpg" 17 | }, { 18 | "title": "The Mountain", 19 | "subtitle": "Outdoor adventure", 20 | "image": "photo-1443890923422-7819ed4101c0.jpg" 21 | 22 | }, { 23 | "title": "Foggy forest", 24 | "subtitle": "Demystifying the mist", 25 | "image": "photo-1445285303476-2f3b16d67b7a.jpg" 26 | }, { 27 | "title": "Minimalism", 28 | "subtitle": "Modern architecture", 29 | "image": "photo-1446771326090-d910bfaf00f6.jpg" 30 | }, { 31 | "title": "Nature", 32 | "subtitle": "Cross the bridge", 33 | "image": "photo-1446752875215-b2761acb3c5d.jpg" 34 | }, { 35 | "title": "Snowy night", 36 | "subtitle": "Christmas story", 37 | "image": "photo-1447877015176-3099cb49cd6a.jpg" 38 | }, { 39 | "title": "White & Gold", 40 | "subtitle": "Architecture", 41 | "image": "photo-1448318440207-ef1893eb8ac0.jpg" 42 | }, { 43 | "title": "Skyline", 44 | "subtitle": "One night in New-York", 45 | "image": "photo-1449157291145-7efd050a4d0e.jpg" 46 | }] -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/galleryCell.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 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/galleryCell2.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 | 34 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AWCollectionViewSlidingDoorsDemo 4 | // 5 | // Created by Antoine Wette on 26.01.16. 6 | // Copyright © 2016 Antoine Wette. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /AWCollectionViewSlidingDoorsDemo/settings_view.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 awdigital 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AWCollectionViewSlidingDoors 2 | Custom UICollectionViewLayout to create a slick vertical sliding effect. 3 | 4 | 5 | ![awcollectionviewslidingdoors](awslidingdoors.gif) 6 | 7 | ## Usage 8 | There is a sample Xcode project available with two examples. Just Build & Run. 9 | To use the Custom layout in your projects just includes the AWCollectionViewSlidingDoorLayout.h and AWCollectionViewSlidingDoorLayout.m classes. 10 | 11 | Import the Custom CollectionViewLayout 12 | ```Objective-C 13 | #import "AWCollectionViewSlidingDoorLayout.h" 14 | ``` 15 | 16 | Create a new instance of the CollectionViewLayout and assign it to your collectionview 17 | ```Objective-C 18 | AWCollectionViewSlidingDoorLayout *slidingLayout = [[AWCollectionViewSlidingDoorLayout alloc] initWithMaxRatio:1.5 andMinRatio:6]; 19 | [collectionView setCollectionViewLayout:slidingLayout]; 20 | ``` 21 | You will need to define ratio (width/height) values for active and inactive states. MaxRatio is the ratio of your active Cell and MinRatio the ratio of the inactive cells. 22 | 23 | If you want to add custom animations to your UICollectionViewCell subviews overwrite the layoutSubviewsWithAttributes delegate and refer to the following code snippet 24 | 25 | ```Objective-C 26 | -(void)layoutSubviewsWithAttributes:(NSMutableArray *)theAttributes{ 27 | for(int i = 0; i < theAttributes.count; i++){ 28 | GalleryCell *cell = (GalleryCell*)[collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; 29 | 30 | CGFloat maxHeight = self.collectionView.bounds.size.width / maxRatio; 31 | CGFloat minHeight = self.collectionView.bounds.size.width / minRatio; 32 | CGFloat cellHeight = (maxHeight*0.5 + minHeight*0.5); 33 | CGFloat currentIndex = self.collectionView.contentOffset.y / cellHeight; 34 | 35 | CGFloat ratio = cell.bounds.size.width / cell.bounds.size.height; 36 | CGFloat maxDiff = minRatio - maxRatio; 37 | CGFloat diff = minRatio - ratio; 38 | 39 | CGFloat alpha = diff/maxDiff; 40 | 41 | //FADE-OUT THE BLACK OVERLAY WHEN THE CELL BECOMES ACTIVE 42 | cell.overlayView.alpha = 1 - alpha; 43 | 44 | //FADE-IN THE TITLE WHEN THE CELL BECOMES ACTIVE 45 | cell.titleLabel.alpha = alpha; 46 | 47 | //ANIMATE THE SUBVIEW WHEN THE CELL BECOMES ACTIVE 48 | if(i > currentIndex){ 49 | cell.titleLabel.transform = CGAffineTransformMakeScale(1 - (1- alpha) * 0.3, 1 - (1- alpha) * 0.3); 50 | cell.subtitleLabel.transform = CGAffineTransformMakeTranslation(0, (1- alpha) * 30); 51 | }else{ 52 | cell.titleLabel.transform = CGAffineTransformIdentity; 53 | cell.subtitleLabel.transform = CGAffineTransformIdentity; 54 | } 55 | 56 | } 57 | } 58 | ``` 59 | 60 | ## Tips 61 | * Use AutoLayout when setting up your UICollectionViewCell nib to achieve the resize effect you want. 62 | * Play aroud with the UIImageView ContentMode and the UILabel minimum scale 63 | * Make sure your MaxRatio is bigger than your Images ratio to avoid a sudden jump during the resizing of the Cell 64 | -------------------------------------------------------------------------------- /awslidingdoors.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awdigital/AWCollectionViewSlidingDoors/501be233db4f59777f9b34b2f3d4d1c050c95745/awslidingdoors.gif --------------------------------------------------------------------------------