├── .gitignore ├── LICENSE ├── MagazineView.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── MagazineView ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Images │ ├── insight1.png │ ├── insight2.png │ ├── insight3.png │ ├── insight4.png │ ├── insight5.png │ └── insight6.png ├── Magazine Collection View │ ├── MagazineCell.h │ ├── MagazineCell.m │ ├── MagazineCellA.xib │ ├── MagazineCellB.xib │ ├── MagazineCellC.xib │ ├── MagazineCellD.xib │ ├── MagazineCollectionView.h │ ├── MagazineCollectionView.m │ ├── MagazineLayout.h │ ├── MagazineLayout.m │ └── MagazineLayout.xib ├── MagazineView-Info.plist ├── MagazineView-Prefix.pch ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── MagazineViewTests ├── MagazineViewTests-Info.plist ├── MagazineViewTests.m └── en.lproj │ └── InfoPlist.strings └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | MagazineView.xcodeproj/xcuserdata 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /MagazineView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4F02825A1806E63A003AD800 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F0282591806E63A003AD800 /* Foundation.framework */; }; 11 | 4F02825C1806E63A003AD800 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F02825B1806E63A003AD800 /* CoreGraphics.framework */; }; 12 | 4F02825E1806E63A003AD800 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F02825D1806E63A003AD800 /* UIKit.framework */; }; 13 | 4F0282641806E63A003AD800 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282621806E63A003AD800 /* InfoPlist.strings */; }; 14 | 4F0282661806E63A003AD800 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0282651806E63A003AD800 /* main.m */; }; 15 | 4F02826A1806E63A003AD800 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0282691806E63A003AD800 /* AppDelegate.m */; }; 16 | 4F02826D1806E63A003AD800 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4F02826B1806E63A003AD800 /* Main.storyboard */; }; 17 | 4F0282701806E63A003AD800 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F02826F1806E63A003AD800 /* ViewController.m */; }; 18 | 4F0282721806E63A003AD800 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282711806E63A003AD800 /* Images.xcassets */; }; 19 | 4F0282791806E63A003AD800 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F0282781806E63A003AD800 /* XCTest.framework */; }; 20 | 4F02827A1806E63A003AD800 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F0282591806E63A003AD800 /* Foundation.framework */; }; 21 | 4F02827B1806E63A003AD800 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F02825D1806E63A003AD800 /* UIKit.framework */; }; 22 | 4F0282831806E63A003AD800 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282811806E63A003AD800 /* InfoPlist.strings */; }; 23 | 4F0282851806E63A003AD800 /* MagazineViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0282841806E63A003AD800 /* MagazineViewTests.m */; }; 24 | 4F0282AD1806EA03003AD800 /* MagazineCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0282A31806EA03003AD800 /* MagazineCell.m */; }; 25 | 4F0282AE1806EA03003AD800 /* MagazineCellA.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282A41806EA03003AD800 /* MagazineCellA.xib */; }; 26 | 4F0282AF1806EA03003AD800 /* MagazineCellB.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282A51806EA03003AD800 /* MagazineCellB.xib */; }; 27 | 4F0282B01806EA03003AD800 /* MagazineCellC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282A61806EA03003AD800 /* MagazineCellC.xib */; }; 28 | 4F0282B11806EA03003AD800 /* MagazineCellD.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282A71806EA03003AD800 /* MagazineCellD.xib */; }; 29 | 4F0282B21806EA03003AD800 /* MagazineCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0282A91806EA03003AD800 /* MagazineCollectionView.m */; }; 30 | 4F0282B31806EA03003AD800 /* MagazineLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0282AB1806EA03003AD800 /* MagazineLayout.m */; }; 31 | 4F0282B41806EA03003AD800 /* MagazineLayout.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F0282AC1806EA03003AD800 /* MagazineLayout.xib */; }; 32 | 4FB9998F183BC6BC001AA2FF /* insight1.png in Resources */ = {isa = PBXBuildFile; fileRef = 4FB99989183BC6BC001AA2FF /* insight1.png */; }; 33 | 4FB99990183BC6BC001AA2FF /* insight2.png in Resources */ = {isa = PBXBuildFile; fileRef = 4FB9998A183BC6BC001AA2FF /* insight2.png */; }; 34 | 4FB99991183BC6BC001AA2FF /* insight3.png in Resources */ = {isa = PBXBuildFile; fileRef = 4FB9998B183BC6BC001AA2FF /* insight3.png */; }; 35 | 4FB99992183BC6BC001AA2FF /* insight4.png in Resources */ = {isa = PBXBuildFile; fileRef = 4FB9998C183BC6BC001AA2FF /* insight4.png */; }; 36 | 4FB99993183BC6BC001AA2FF /* insight5.png in Resources */ = {isa = PBXBuildFile; fileRef = 4FB9998D183BC6BC001AA2FF /* insight5.png */; }; 37 | 4FB99994183BC6BC001AA2FF /* insight6.png in Resources */ = {isa = PBXBuildFile; fileRef = 4FB9998E183BC6BC001AA2FF /* insight6.png */; }; 38 | /* End PBXBuildFile section */ 39 | 40 | /* Begin PBXContainerItemProxy section */ 41 | 4F02827C1806E63A003AD800 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = 4F02824E1806E63A003AD800 /* Project object */; 44 | proxyType = 1; 45 | remoteGlobalIDString = 4F0282551806E63A003AD800; 46 | remoteInfo = MagazineView; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXFileReference section */ 51 | 4F0282561806E63A003AD800 /* MagazineView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MagazineView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 4F0282591806E63A003AD800 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 53 | 4F02825B1806E63A003AD800 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 54 | 4F02825D1806E63A003AD800 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 55 | 4F0282611806E63A003AD800 /* MagazineView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MagazineView-Info.plist"; sourceTree = ""; }; 56 | 4F0282631806E63A003AD800 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | 4F0282651806E63A003AD800 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 58 | 4F0282671806E63A003AD800 /* MagazineView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MagazineView-Prefix.pch"; sourceTree = ""; }; 59 | 4F0282681806E63A003AD800 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 60 | 4F0282691806E63A003AD800 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 61 | 4F02826C1806E63A003AD800 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 62 | 4F02826E1806E63A003AD800 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 63 | 4F02826F1806E63A003AD800 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 64 | 4F0282711806E63A003AD800 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 65 | 4F0282771806E63A003AD800 /* MagazineViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MagazineViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 4F0282781806E63A003AD800 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 67 | 4F0282801806E63A003AD800 /* MagazineViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MagazineViewTests-Info.plist"; sourceTree = ""; }; 68 | 4F0282821806E63A003AD800 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 69 | 4F0282841806E63A003AD800 /* MagazineViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MagazineViewTests.m; sourceTree = ""; }; 70 | 4F0282A21806EA03003AD800 /* MagazineCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MagazineCell.h; path = "MagazineView/Magazine Collection View/MagazineCell.h"; sourceTree = SOURCE_ROOT; }; 71 | 4F0282A31806EA03003AD800 /* MagazineCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MagazineCell.m; path = "MagazineView/Magazine Collection View/MagazineCell.m"; sourceTree = SOURCE_ROOT; }; 72 | 4F0282A41806EA03003AD800 /* MagazineCellA.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MagazineCellA.xib; path = "MagazineView/Magazine Collection View/MagazineCellA.xib"; sourceTree = SOURCE_ROOT; }; 73 | 4F0282A51806EA03003AD800 /* MagazineCellB.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MagazineCellB.xib; path = "MagazineView/Magazine Collection View/MagazineCellB.xib"; sourceTree = SOURCE_ROOT; }; 74 | 4F0282A61806EA03003AD800 /* MagazineCellC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MagazineCellC.xib; path = "MagazineView/Magazine Collection View/MagazineCellC.xib"; sourceTree = SOURCE_ROOT; }; 75 | 4F0282A71806EA03003AD800 /* MagazineCellD.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MagazineCellD.xib; path = "MagazineView/Magazine Collection View/MagazineCellD.xib"; sourceTree = SOURCE_ROOT; }; 76 | 4F0282A81806EA03003AD800 /* MagazineCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MagazineCollectionView.h; path = "MagazineView/Magazine Collection View/MagazineCollectionView.h"; sourceTree = SOURCE_ROOT; }; 77 | 4F0282A91806EA03003AD800 /* MagazineCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MagazineCollectionView.m; path = "MagazineView/Magazine Collection View/MagazineCollectionView.m"; sourceTree = SOURCE_ROOT; }; 78 | 4F0282AA1806EA03003AD800 /* MagazineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MagazineLayout.h; path = "MagazineView/Magazine Collection View/MagazineLayout.h"; sourceTree = SOURCE_ROOT; }; 79 | 4F0282AB1806EA03003AD800 /* MagazineLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MagazineLayout.m; path = "MagazineView/Magazine Collection View/MagazineLayout.m"; sourceTree = SOURCE_ROOT; }; 80 | 4F0282AC1806EA03003AD800 /* MagazineLayout.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MagazineLayout.xib; path = "MagazineView/Magazine Collection View/MagazineLayout.xib"; sourceTree = SOURCE_ROOT; }; 81 | 4FB99989183BC6BC001AA2FF /* insight1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = insight1.png; path = Images/insight1.png; sourceTree = ""; }; 82 | 4FB9998A183BC6BC001AA2FF /* insight2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = insight2.png; path = Images/insight2.png; sourceTree = ""; }; 83 | 4FB9998B183BC6BC001AA2FF /* insight3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = insight3.png; path = Images/insight3.png; sourceTree = ""; }; 84 | 4FB9998C183BC6BC001AA2FF /* insight4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = insight4.png; path = Images/insight4.png; sourceTree = ""; }; 85 | 4FB9998D183BC6BC001AA2FF /* insight5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = insight5.png; path = Images/insight5.png; sourceTree = ""; }; 86 | 4FB9998E183BC6BC001AA2FF /* insight6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = insight6.png; path = Images/insight6.png; sourceTree = ""; }; 87 | /* End PBXFileReference section */ 88 | 89 | /* Begin PBXFrameworksBuildPhase section */ 90 | 4F0282531806E63A003AD800 /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | 4F02825C1806E63A003AD800 /* CoreGraphics.framework in Frameworks */, 95 | 4F02825E1806E63A003AD800 /* UIKit.framework in Frameworks */, 96 | 4F02825A1806E63A003AD800 /* Foundation.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | 4F0282741806E63A003AD800 /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | 4F0282791806E63A003AD800 /* XCTest.framework in Frameworks */, 105 | 4F02827B1806E63A003AD800 /* UIKit.framework in Frameworks */, 106 | 4F02827A1806E63A003AD800 /* Foundation.framework in Frameworks */, 107 | ); 108 | runOnlyForDeploymentPostprocessing = 0; 109 | }; 110 | /* End PBXFrameworksBuildPhase section */ 111 | 112 | /* Begin PBXGroup section */ 113 | 4F02824D1806E63A003AD800 = { 114 | isa = PBXGroup; 115 | children = ( 116 | 4F02825F1806E63A003AD800 /* MagazineView */, 117 | 4F02827E1806E63A003AD800 /* MagazineViewTests */, 118 | 4F0282581806E63A003AD800 /* Frameworks */, 119 | 4F0282571806E63A003AD800 /* Products */, 120 | ); 121 | sourceTree = ""; 122 | }; 123 | 4F0282571806E63A003AD800 /* Products */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 4F0282561806E63A003AD800 /* MagazineView.app */, 127 | 4F0282771806E63A003AD800 /* MagazineViewTests.xctest */, 128 | ); 129 | name = Products; 130 | sourceTree = ""; 131 | }; 132 | 4F0282581806E63A003AD800 /* Frameworks */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 4F0282591806E63A003AD800 /* Foundation.framework */, 136 | 4F02825B1806E63A003AD800 /* CoreGraphics.framework */, 137 | 4F02825D1806E63A003AD800 /* UIKit.framework */, 138 | 4F0282781806E63A003AD800 /* XCTest.framework */, 139 | ); 140 | name = Frameworks; 141 | sourceTree = ""; 142 | }; 143 | 4F02825F1806E63A003AD800 /* MagazineView */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 4FB99988183BC6AF001AA2FF /* Images */, 147 | 4F02828E1806E91A003AD800 /* Magazine Collection View */, 148 | 4F0282681806E63A003AD800 /* AppDelegate.h */, 149 | 4F0282691806E63A003AD800 /* AppDelegate.m */, 150 | 4F02826B1806E63A003AD800 /* Main.storyboard */, 151 | 4F02826E1806E63A003AD800 /* ViewController.h */, 152 | 4F02826F1806E63A003AD800 /* ViewController.m */, 153 | 4F0282711806E63A003AD800 /* Images.xcassets */, 154 | 4F0282601806E63A003AD800 /* Supporting Files */, 155 | ); 156 | path = MagazineView; 157 | sourceTree = ""; 158 | }; 159 | 4F0282601806E63A003AD800 /* Supporting Files */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 4F0282611806E63A003AD800 /* MagazineView-Info.plist */, 163 | 4F0282621806E63A003AD800 /* InfoPlist.strings */, 164 | 4F0282651806E63A003AD800 /* main.m */, 165 | 4F0282671806E63A003AD800 /* MagazineView-Prefix.pch */, 166 | ); 167 | name = "Supporting Files"; 168 | sourceTree = ""; 169 | }; 170 | 4F02827E1806E63A003AD800 /* MagazineViewTests */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 4F0282841806E63A003AD800 /* MagazineViewTests.m */, 174 | 4F02827F1806E63A003AD800 /* Supporting Files */, 175 | ); 176 | path = MagazineViewTests; 177 | sourceTree = ""; 178 | }; 179 | 4F02827F1806E63A003AD800 /* Supporting Files */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 4F0282801806E63A003AD800 /* MagazineViewTests-Info.plist */, 183 | 4F0282811806E63A003AD800 /* InfoPlist.strings */, 184 | ); 185 | name = "Supporting Files"; 186 | sourceTree = ""; 187 | }; 188 | 4F02828E1806E91A003AD800 /* Magazine Collection View */ = { 189 | isa = PBXGroup; 190 | children = ( 191 | 4F0282A21806EA03003AD800 /* MagazineCell.h */, 192 | 4F0282A31806EA03003AD800 /* MagazineCell.m */, 193 | 4F0282A41806EA03003AD800 /* MagazineCellA.xib */, 194 | 4F0282A51806EA03003AD800 /* MagazineCellB.xib */, 195 | 4F0282A61806EA03003AD800 /* MagazineCellC.xib */, 196 | 4F0282A71806EA03003AD800 /* MagazineCellD.xib */, 197 | 4F0282A81806EA03003AD800 /* MagazineCollectionView.h */, 198 | 4F0282A91806EA03003AD800 /* MagazineCollectionView.m */, 199 | 4F0282AA1806EA03003AD800 /* MagazineLayout.h */, 200 | 4F0282AB1806EA03003AD800 /* MagazineLayout.m */, 201 | 4F0282AC1806EA03003AD800 /* MagazineLayout.xib */, 202 | ); 203 | name = "Magazine Collection View"; 204 | path = "Magazine View Framework"; 205 | sourceTree = ""; 206 | }; 207 | 4FB99988183BC6AF001AA2FF /* Images */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | 4FB99989183BC6BC001AA2FF /* insight1.png */, 211 | 4FB9998A183BC6BC001AA2FF /* insight2.png */, 212 | 4FB9998B183BC6BC001AA2FF /* insight3.png */, 213 | 4FB9998C183BC6BC001AA2FF /* insight4.png */, 214 | 4FB9998D183BC6BC001AA2FF /* insight5.png */, 215 | 4FB9998E183BC6BC001AA2FF /* insight6.png */, 216 | ); 217 | name = Images; 218 | sourceTree = ""; 219 | }; 220 | /* End PBXGroup section */ 221 | 222 | /* Begin PBXNativeTarget section */ 223 | 4F0282551806E63A003AD800 /* MagazineView */ = { 224 | isa = PBXNativeTarget; 225 | buildConfigurationList = 4F0282881806E63A003AD800 /* Build configuration list for PBXNativeTarget "MagazineView" */; 226 | buildPhases = ( 227 | 4F0282521806E63A003AD800 /* Sources */, 228 | 4F0282531806E63A003AD800 /* Frameworks */, 229 | 4F0282541806E63A003AD800 /* Resources */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | ); 235 | name = MagazineView; 236 | productName = MagazineView; 237 | productReference = 4F0282561806E63A003AD800 /* MagazineView.app */; 238 | productType = "com.apple.product-type.application"; 239 | }; 240 | 4F0282761806E63A003AD800 /* MagazineViewTests */ = { 241 | isa = PBXNativeTarget; 242 | buildConfigurationList = 4F02828B1806E63A003AD800 /* Build configuration list for PBXNativeTarget "MagazineViewTests" */; 243 | buildPhases = ( 244 | 4F0282731806E63A003AD800 /* Sources */, 245 | 4F0282741806E63A003AD800 /* Frameworks */, 246 | 4F0282751806E63A003AD800 /* Resources */, 247 | ); 248 | buildRules = ( 249 | ); 250 | dependencies = ( 251 | 4F02827D1806E63A003AD800 /* PBXTargetDependency */, 252 | ); 253 | name = MagazineViewTests; 254 | productName = MagazineViewTests; 255 | productReference = 4F0282771806E63A003AD800 /* MagazineViewTests.xctest */; 256 | productType = "com.apple.product-type.bundle.unit-test"; 257 | }; 258 | /* End PBXNativeTarget section */ 259 | 260 | /* Begin PBXProject section */ 261 | 4F02824E1806E63A003AD800 /* Project object */ = { 262 | isa = PBXProject; 263 | attributes = { 264 | LastUpgradeCheck = 0610; 265 | ORGANIZATIONNAME = "Daher Alfawares"; 266 | TargetAttributes = { 267 | 4F0282761806E63A003AD800 = { 268 | TestTargetID = 4F0282551806E63A003AD800; 269 | }; 270 | }; 271 | }; 272 | buildConfigurationList = 4F0282511806E63A003AD800 /* Build configuration list for PBXProject "MagazineView" */; 273 | compatibilityVersion = "Xcode 3.2"; 274 | developmentRegion = English; 275 | hasScannedForEncodings = 0; 276 | knownRegions = ( 277 | en, 278 | Base, 279 | ); 280 | mainGroup = 4F02824D1806E63A003AD800; 281 | productRefGroup = 4F0282571806E63A003AD800 /* Products */; 282 | projectDirPath = ""; 283 | projectRoot = ""; 284 | targets = ( 285 | 4F0282551806E63A003AD800 /* MagazineView */, 286 | 4F0282761806E63A003AD800 /* MagazineViewTests */, 287 | ); 288 | }; 289 | /* End PBXProject section */ 290 | 291 | /* Begin PBXResourcesBuildPhase section */ 292 | 4F0282541806E63A003AD800 /* Resources */ = { 293 | isa = PBXResourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | 4F0282AF1806EA03003AD800 /* MagazineCellB.xib in Resources */, 297 | 4FB99992183BC6BC001AA2FF /* insight4.png in Resources */, 298 | 4FB9998F183BC6BC001AA2FF /* insight1.png in Resources */, 299 | 4FB99993183BC6BC001AA2FF /* insight5.png in Resources */, 300 | 4F0282B01806EA03003AD800 /* MagazineCellC.xib in Resources */, 301 | 4F0282721806E63A003AD800 /* Images.xcassets in Resources */, 302 | 4F0282641806E63A003AD800 /* InfoPlist.strings in Resources */, 303 | 4FB99994183BC6BC001AA2FF /* insight6.png in Resources */, 304 | 4F0282B11806EA03003AD800 /* MagazineCellD.xib in Resources */, 305 | 4F0282B41806EA03003AD800 /* MagazineLayout.xib in Resources */, 306 | 4F02826D1806E63A003AD800 /* Main.storyboard in Resources */, 307 | 4F0282AE1806EA03003AD800 /* MagazineCellA.xib in Resources */, 308 | 4FB99990183BC6BC001AA2FF /* insight2.png in Resources */, 309 | 4FB99991183BC6BC001AA2FF /* insight3.png in Resources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | 4F0282751806E63A003AD800 /* Resources */ = { 314 | isa = PBXResourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | 4F0282831806E63A003AD800 /* InfoPlist.strings in Resources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | /* End PBXResourcesBuildPhase section */ 322 | 323 | /* Begin PBXSourcesBuildPhase section */ 324 | 4F0282521806E63A003AD800 /* Sources */ = { 325 | isa = PBXSourcesBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | 4F0282701806E63A003AD800 /* ViewController.m in Sources */, 329 | 4F0282AD1806EA03003AD800 /* MagazineCell.m in Sources */, 330 | 4F0282B21806EA03003AD800 /* MagazineCollectionView.m in Sources */, 331 | 4F0282B31806EA03003AD800 /* MagazineLayout.m in Sources */, 332 | 4F02826A1806E63A003AD800 /* AppDelegate.m in Sources */, 333 | 4F0282661806E63A003AD800 /* main.m in Sources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | 4F0282731806E63A003AD800 /* Sources */ = { 338 | isa = PBXSourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | 4F0282851806E63A003AD800 /* MagazineViewTests.m in Sources */, 342 | ); 343 | runOnlyForDeploymentPostprocessing = 0; 344 | }; 345 | /* End PBXSourcesBuildPhase section */ 346 | 347 | /* Begin PBXTargetDependency section */ 348 | 4F02827D1806E63A003AD800 /* PBXTargetDependency */ = { 349 | isa = PBXTargetDependency; 350 | target = 4F0282551806E63A003AD800 /* MagazineView */; 351 | targetProxy = 4F02827C1806E63A003AD800 /* PBXContainerItemProxy */; 352 | }; 353 | /* End PBXTargetDependency section */ 354 | 355 | /* Begin PBXVariantGroup section */ 356 | 4F0282621806E63A003AD800 /* InfoPlist.strings */ = { 357 | isa = PBXVariantGroup; 358 | children = ( 359 | 4F0282631806E63A003AD800 /* en */, 360 | ); 361 | name = InfoPlist.strings; 362 | sourceTree = ""; 363 | }; 364 | 4F02826B1806E63A003AD800 /* Main.storyboard */ = { 365 | isa = PBXVariantGroup; 366 | children = ( 367 | 4F02826C1806E63A003AD800 /* Base */, 368 | ); 369 | name = Main.storyboard; 370 | sourceTree = ""; 371 | }; 372 | 4F0282811806E63A003AD800 /* InfoPlist.strings */ = { 373 | isa = PBXVariantGroup; 374 | children = ( 375 | 4F0282821806E63A003AD800 /* en */, 376 | ); 377 | name = InfoPlist.strings; 378 | sourceTree = ""; 379 | }; 380 | /* End PBXVariantGroup section */ 381 | 382 | /* Begin XCBuildConfiguration section */ 383 | 4F0282861806E63A003AD800 /* Debug */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ALWAYS_SEARCH_USER_PATHS = NO; 387 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 388 | CLANG_CXX_LIBRARY = "libc++"; 389 | CLANG_ENABLE_MODULES = YES; 390 | CLANG_ENABLE_OBJC_ARC = YES; 391 | CLANG_WARN_BOOL_CONVERSION = YES; 392 | CLANG_WARN_CONSTANT_CONVERSION = YES; 393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 394 | CLANG_WARN_EMPTY_BODY = YES; 395 | CLANG_WARN_ENUM_CONVERSION = YES; 396 | CLANG_WARN_INT_CONVERSION = YES; 397 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 398 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 399 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 400 | COPY_PHASE_STRIP = NO; 401 | GCC_C_LANGUAGE_STANDARD = gnu99; 402 | GCC_DYNAMIC_NO_PIC = NO; 403 | GCC_OPTIMIZATION_LEVEL = 0; 404 | GCC_PREPROCESSOR_DEFINITIONS = ( 405 | "DEBUG=1", 406 | "$(inherited)", 407 | ); 408 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 411 | GCC_WARN_UNDECLARED_SELECTOR = YES; 412 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 413 | GCC_WARN_UNUSED_FUNCTION = YES; 414 | GCC_WARN_UNUSED_VARIABLE = YES; 415 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 416 | ONLY_ACTIVE_ARCH = YES; 417 | SDKROOT = iphoneos; 418 | TARGETED_DEVICE_FAMILY = 2; 419 | }; 420 | name = Debug; 421 | }; 422 | 4F0282871806E63A003AD800 /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ALWAYS_SEARCH_USER_PATHS = NO; 426 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 427 | CLANG_CXX_LIBRARY = "libc++"; 428 | CLANG_ENABLE_MODULES = YES; 429 | CLANG_ENABLE_OBJC_ARC = YES; 430 | CLANG_WARN_BOOL_CONVERSION = YES; 431 | CLANG_WARN_CONSTANT_CONVERSION = YES; 432 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 433 | CLANG_WARN_EMPTY_BODY = YES; 434 | CLANG_WARN_ENUM_CONVERSION = YES; 435 | CLANG_WARN_INT_CONVERSION = YES; 436 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 437 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 438 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 439 | COPY_PHASE_STRIP = YES; 440 | ENABLE_NS_ASSERTIONS = NO; 441 | GCC_C_LANGUAGE_STANDARD = gnu99; 442 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 443 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 444 | GCC_WARN_UNDECLARED_SELECTOR = YES; 445 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 446 | GCC_WARN_UNUSED_FUNCTION = YES; 447 | GCC_WARN_UNUSED_VARIABLE = YES; 448 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 449 | SDKROOT = iphoneos; 450 | TARGETED_DEVICE_FAMILY = 2; 451 | VALIDATE_PRODUCT = YES; 452 | }; 453 | name = Release; 454 | }; 455 | 4F0282891806E63A003AD800 /* Debug */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 459 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 460 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 461 | GCC_PREFIX_HEADER = "MagazineView/MagazineView-Prefix.pch"; 462 | INFOPLIST_FILE = "MagazineView/MagazineView-Info.plist"; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | WRAPPER_EXTENSION = app; 465 | }; 466 | name = Debug; 467 | }; 468 | 4F02828A1806E63A003AD800 /* Release */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 472 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 473 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 474 | GCC_PREFIX_HEADER = "MagazineView/MagazineView-Prefix.pch"; 475 | INFOPLIST_FILE = "MagazineView/MagazineView-Info.plist"; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | WRAPPER_EXTENSION = app; 478 | }; 479 | name = Release; 480 | }; 481 | 4F02828C1806E63A003AD800 /* Debug */ = { 482 | isa = XCBuildConfiguration; 483 | buildSettings = { 484 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MagazineView.app/MagazineView"; 485 | FRAMEWORK_SEARCH_PATHS = ( 486 | "$(SDKROOT)/Developer/Library/Frameworks", 487 | "$(inherited)", 488 | "$(DEVELOPER_FRAMEWORKS_DIR)", 489 | ); 490 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 491 | GCC_PREFIX_HEADER = "MagazineView/MagazineView-Prefix.pch"; 492 | GCC_PREPROCESSOR_DEFINITIONS = ( 493 | "DEBUG=1", 494 | "$(inherited)", 495 | ); 496 | INFOPLIST_FILE = "MagazineViewTests/MagazineViewTests-Info.plist"; 497 | PRODUCT_NAME = "$(TARGET_NAME)"; 498 | TEST_HOST = "$(BUNDLE_LOADER)"; 499 | WRAPPER_EXTENSION = xctest; 500 | }; 501 | name = Debug; 502 | }; 503 | 4F02828D1806E63A003AD800 /* Release */ = { 504 | isa = XCBuildConfiguration; 505 | buildSettings = { 506 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MagazineView.app/MagazineView"; 507 | FRAMEWORK_SEARCH_PATHS = ( 508 | "$(SDKROOT)/Developer/Library/Frameworks", 509 | "$(inherited)", 510 | "$(DEVELOPER_FRAMEWORKS_DIR)", 511 | ); 512 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 513 | GCC_PREFIX_HEADER = "MagazineView/MagazineView-Prefix.pch"; 514 | INFOPLIST_FILE = "MagazineViewTests/MagazineViewTests-Info.plist"; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | TEST_HOST = "$(BUNDLE_LOADER)"; 517 | WRAPPER_EXTENSION = xctest; 518 | }; 519 | name = Release; 520 | }; 521 | /* End XCBuildConfiguration section */ 522 | 523 | /* Begin XCConfigurationList section */ 524 | 4F0282511806E63A003AD800 /* Build configuration list for PBXProject "MagazineView" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | 4F0282861806E63A003AD800 /* Debug */, 528 | 4F0282871806E63A003AD800 /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | 4F0282881806E63A003AD800 /* Build configuration list for PBXNativeTarget "MagazineView" */ = { 534 | isa = XCConfigurationList; 535 | buildConfigurations = ( 536 | 4F0282891806E63A003AD800 /* Debug */, 537 | 4F02828A1806E63A003AD800 /* Release */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | 4F02828B1806E63A003AD800 /* Build configuration list for PBXNativeTarget "MagazineViewTests" */ = { 543 | isa = XCConfigurationList; 544 | buildConfigurations = ( 545 | 4F02828C1806E63A003AD800 /* Debug */, 546 | 4F02828D1806E63A003AD800 /* Release */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | defaultConfigurationName = Release; 550 | }; 551 | /* End XCConfigurationList section */ 552 | }; 553 | rootObject = 4F02824E1806E63A003AD800 /* Project object */; 554 | } 555 | -------------------------------------------------------------------------------- /MagazineView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MagazineView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface AppDelegate : UIResponder 20 | 21 | @property (strong, nonatomic) UIWindow *window; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MagazineView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "AppDelegate.h" 18 | 19 | @implementation AppDelegate 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application 28 | { 29 | // 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. 30 | // 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. 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application 34 | { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application 40 | { 41 | // 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. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application 45 | { 46 | // 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. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application 50 | { 51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /MagazineView/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 | -------------------------------------------------------------------------------- /MagazineView/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "ipad", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "ipad", 10 | "size" : "29x29", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "ipad", 15 | "size" : "40x40", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "40x40", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "76x76", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "76x76", 31 | "scale" : "2x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /MagazineView/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /MagazineView/Images/insight1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/da0x/MagazineView/fee0d8a9e2bdea92a3d0fb5980481b7ba456a713/MagazineView/Images/insight1.png -------------------------------------------------------------------------------- /MagazineView/Images/insight2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/da0x/MagazineView/fee0d8a9e2bdea92a3d0fb5980481b7ba456a713/MagazineView/Images/insight2.png -------------------------------------------------------------------------------- /MagazineView/Images/insight3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/da0x/MagazineView/fee0d8a9e2bdea92a3d0fb5980481b7ba456a713/MagazineView/Images/insight3.png -------------------------------------------------------------------------------- /MagazineView/Images/insight4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/da0x/MagazineView/fee0d8a9e2bdea92a3d0fb5980481b7ba456a713/MagazineView/Images/insight4.png -------------------------------------------------------------------------------- /MagazineView/Images/insight5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/da0x/MagazineView/fee0d8a9e2bdea92a3d0fb5980481b7ba456a713/MagazineView/Images/insight5.png -------------------------------------------------------------------------------- /MagazineView/Images/insight6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/da0x/MagazineView/fee0d8a9e2bdea92a3d0fb5980481b7ba456a713/MagazineView/Images/insight6.png -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | 18 | #import 19 | 20 | @interface MagazineCell : UICollectionViewCell 21 | @property IBOutlet UILabel* title; 22 | @property IBOutlet UILabel* subtitle; 23 | @property IBOutlet UITextView* details; 24 | @property IBOutlet UILabel* date; 25 | @property IBOutlet UIImageView* image; 26 | @end 27 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "MagazineCell.h" 18 | 19 | /*! Base cell type */ 20 | @implementation MagazineCell 21 | 22 | -(void)setBackgroundColor:(UIColor *)backgroundColor 23 | { 24 | [super setBackgroundColor:backgroundColor]; 25 | 26 | // pass on the background color to the text field. 27 | [self.details setBackgroundColor:backgroundColor]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCellA.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCellB.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 24 | 30 | 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 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCellC.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 30 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCellD.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCollectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | #import "MagazineCell.h" 19 | 20 | @interface MagazineCollectionView : UICollectionView 21 | @property (nonatomic,strong) UIColor* accentColor; 22 | @property (nonatomic,strong) NSArray* data; 23 | 24 | -(MagazineCell *)dequeueReusableCellWithIndexPath:(NSIndexPath*)indexPath; 25 | @end 26 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineCollectionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "MagazineCollectionView.h" 18 | #import "MagazineCell.h" 19 | #import "MagazineLayout.h" 20 | 21 | @implementation MagazineCollectionView 22 | 23 | - (id)initWithCoder:(NSCoder *)aDecoder 24 | { 25 | self = [super initWithCoder:aDecoder]; 26 | if (self) { 27 | [self registerNibNamed:@"MagazineCellA" forCellWithReuseIdentifier:@"A"]; 28 | [self registerNibNamed:@"MagazineCellB" forCellWithReuseIdentifier:@"B"]; 29 | [self registerNibNamed:@"MagazineCellC" forCellWithReuseIdentifier:@"C"]; 30 | [self registerNibNamed:@"MagazineCellD" forCellWithReuseIdentifier:@"D"]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)registerNibNamed:(NSString*)nibName forCellWithReuseIdentifier:(NSString*)reuseId 36 | { 37 | UINib* nib = [UINib nibWithNibName:nibName bundle:[NSBundle mainBundle]]; 38 | 39 | [self registerNib:nib forCellWithReuseIdentifier:reuseId]; 40 | } 41 | 42 | -(UICollectionViewCell *)dequeueReusableCellWithIndexPath:(NSIndexPath*)indexPath 43 | { 44 | return [self dequeueReusableCellWithReuseIdentifier:[self reuseIdentifierForCellWithIndexPath:indexPath] forIndexPath:indexPath]; 45 | } 46 | 47 | -(NSString*)reuseIdentifierForCellWithIndexPath:(NSIndexPath*)indexPath 48 | { 49 | NSArray* cells = @[@"A",@"B",@"C",@"D", 50 | @"B",@"C",@"D",@"A"]; 51 | return [cells objectAtIndex:(indexPath.row % MagazineLayoutsPerRow)]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | 20 | // Out newspaper layout types: 21 | // +---++-----+-----+ 22 | // | || B | 23 | // | A |+-----+-----+ 24 | // | || C | D | 25 | // +---++-----+-----+ 26 | // +-----+-----++---+ 27 | // | B || | 28 | // +-----+-----+| A | 29 | // | C | D || | 30 | // +-----+-----++---+ 31 | // +---++-----+-----+ 32 | // | || B | 33 | // | A |+-----+-----+ 34 | // | || c | d | 35 | // +---++-----+-----+ 36 | typedef enum MagazineLayoutType_e 37 | { 38 | MagazineLayoutTypeA, 39 | MagazineLayoutTypeB, 40 | MagazineLayoutTypeC, 41 | MagazineLayoutTypeD, 42 | MagazineLayoutTypeE, 43 | MagazineLayoutTypeF, 44 | MagazineLayoutTypeG, 45 | MagazineLayoutTypeH, 46 | } MagazineLayoutType; 47 | 48 | static const int MagazineLayoutsPerRow = 8L; 49 | 50 | @interface MagazineLayout : UICollectionViewLayout 51 | 52 | //! this is the number of items in the collection view. 53 | @property int itemCount; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "MagazineLayout.h" 18 | 19 | @interface MagazineLayout() 20 | @property UIView* layoutView; 21 | @end 22 | @implementation MagazineLayout 23 | 24 | -(id)init 25 | { 26 | self = [super init]; 27 | if (self) { 28 | [self initialize]; 29 | } 30 | return self; 31 | } 32 | 33 | -(id)initWithCoder:(NSCoder *)aDecoder 34 | { 35 | self = [super initWithCoder:aDecoder]; 36 | if( self ) 37 | { 38 | [self initialize]; 39 | } 40 | return self; 41 | } 42 | 43 | -(void)initialize 44 | { 45 | self.layoutView = [[[NSBundle mainBundle] loadNibNamed:@"MagazineLayout" owner:self options:nil] objectAtIndex:0]; 46 | } 47 | 48 | -(CGSize)collectionViewContentSize 49 | { 50 | if( self.itemCount == 0 ) 51 | return CGSizeZero; 52 | 53 | float w = [self rowWidth]; 54 | float h = [self rowHeight]; 55 | int x = [self itemCount]; 56 | float c = MagazineLayoutsPerRow; 57 | 58 | float height = (h/c * ( x + (c/2) - ( x % (int)(c/2) ) ) ); 59 | CGSize contentSize = { w, height }; 60 | return contentSize; 61 | } 62 | 63 | -(CGRect)frameForLayoutType:(MagazineLayoutType)type 64 | { 65 | UIView* cell = [self.layoutView.subviews objectAtIndex:type]; 66 | 67 | return cell.frame; 68 | } 69 | 70 | -(float)rowWidth 71 | { 72 | return self.layoutView.frame.size.width; 73 | } 74 | 75 | -(float)rowHeight 76 | { 77 | return self.layoutView.frame.size.height; 78 | } 79 | 80 | -(MagazineLayoutType)layoutTypeForIndexPath:(NSIndexPath*)indexPath 81 | { 82 | return indexPath.row % MagazineLayoutsPerRow; 83 | } 84 | 85 | -(NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 86 | { 87 | NSMutableArray* array = [[NSMutableArray alloc] init]; 88 | 89 | for( int i=0, size = self.itemCount; i< size; i++ ) 90 | { 91 | UICollectionViewLayoutAttributes* attributes = [self layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; 92 | if( CGRectIntersectsRect( attributes.frame, rect) ) 93 | [array addObject:attributes]; 94 | } 95 | 96 | return [NSArray arrayWithArray:array]; 97 | } 98 | 99 | -(UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath 100 | { 101 | CGRect frame = [self frameForLayoutType:[self layoutTypeForIndexPath:indexPath]]; 102 | 103 | long row = indexPath.row / MagazineLayoutsPerRow; 104 | frame.origin.y += row * [self rowHeight]; 105 | 106 | UICollectionViewLayoutAttributes* attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; 107 | 108 | attributes.frame = frame; 109 | 110 | return attributes; 111 | } 112 | 113 | -(UICollectionViewScrollDirection)scrollDirection 114 | { 115 | return UICollectionViewScrollDirectionVertical; 116 | } 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /MagazineView/Magazine Collection View/MagazineLayout.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 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /MagazineView/MagazineView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | Example.${PRODUCT_NAME:rfc1034identifier} 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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations~ipad 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationPortraitUpsideDown 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /MagazineView/MagazineView-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /MagazineView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface ViewController : UIViewController 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MagazineView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "ViewController.h" 18 | #import "MagazineCollectionView.h" 19 | #import "MagazineCell.h" 20 | #import "MagazineLayout.h" 21 | 22 | @interface ViewController () 23 | @property IBOutlet MagazineCollectionView* collectionView; 24 | @property IBOutlet MagazineLayout* layout; 25 | @end 26 | 27 | @implementation ViewController 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view, typically from a nib. 33 | 34 | 35 | self.layout = [[MagazineLayout alloc] init]; 36 | self.layout.itemCount = 83; 37 | 38 | [self.collectionView setCollectionViewLayout:self.layout]; 39 | [self.collectionView reloadData]; 40 | } 41 | 42 | - (void)didReceiveMemoryWarning 43 | { 44 | [super didReceiveMemoryWarning]; 45 | // Dispose of any resources that can be recreated. 46 | } 47 | 48 | 49 | - (NSInteger)collectionView:(UICollectionView *)collection numberOfItemsInSection:(NSInteger)section 50 | { 51 | return 83; 52 | } 53 | 54 | - (UICollectionViewCell *)collectionView:(MagazineCollectionView *)collection cellForItemAtIndexPath:(NSIndexPath *)indexPath 55 | { 56 | MagazineCell *cell = [collection dequeueReusableCellWithIndexPath:indexPath]; 57 | 58 | cell.title.text = @"Lorem ipsum"; 59 | cell.subtitle.text = @"January, 2013"; 60 | cell.date.text = @"1 / 1 / 2013"; 61 | 62 | cell.details.text = @"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; 63 | 64 | NSString *filename = [NSString stringWithFormat:@"insight%ld",(indexPath.row%6)+1]; 65 | cell.image.image = [UIImage imageNamed:filename]; 66 | 67 | // Cell Background Color 68 | [cell setBackgroundColor:[self randomColor]]; 69 | 70 | return cell; 71 | } 72 | 73 | - (UIColor*)randomColor 74 | { 75 | CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0 76 | CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white 77 | CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black 78 | UIColor *color = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; 79 | return color; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /MagazineView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MagazineView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | #import "AppDelegate.h" 20 | 21 | int main(int argc, char * argv[]) 22 | { 23 | @autoreleasepool { 24 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MagazineViewTests/MagazineViewTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | Example.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /MagazineViewTests/MagazineViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Daher Alfawares 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface MagazineViewTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation MagazineViewTests 24 | 25 | - (void)setUp 26 | { 27 | [super setUp]; 28 | // Put setup code here. This method is called before the invocation of each test method in the class. 29 | } 30 | 31 | - (void)tearDown 32 | { 33 | // Put teardown code here. This method is called after the invocation of each test method in the class. 34 | [super tearDown]; 35 | } 36 | 37 | - (void)testExample 38 | { 39 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /MagazineViewTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MagazineView 2 | ============ 3 | 4 | A UICollectionView custom layout 5 | --------------------------------------------------------------------------------