├── .gitignore ├── 108 - 特殊布局 ├── 108 - 特殊布局.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── 108 - 特殊布局 │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── 1.imageset │ │ │ ├── Contents.json │ │ │ └── bd3eb13533fa828b9ec3dde4fe1f4134960a5ad0.jpg │ │ ├── 10.imageset │ │ │ ├── Contents.json │ │ │ └── be83b9adec4066b6455b175c13335d4a.jpg │ │ ├── 11.imageset │ │ │ ├── Contents.json │ │ │ └── u=622329262,4092570241&fm=56.jpeg │ │ ├── 12.imageset │ │ │ ├── Contents.json │ │ │ └── u=3535393864,1777389478&fm=56.jpeg │ │ ├── 2.imageset │ │ │ ├── 314e251f95cad1c841f319217c3e6709c93d5168.jpg │ │ │ └── Contents.json │ │ ├── 3.imageset │ │ │ ├── 1e6b0cfb40c83b1e51ec8c7c9fe52abc.jpg │ │ │ └── Contents.json │ │ ├── 4.imageset │ │ │ ├── 7a899e510fb30f244e270105cb95d143ad4b0372.jpg │ │ │ └── Contents.json │ │ ├── 5.imageset │ │ │ ├── 37d12f2eb9389b504227a1558635e5dde6116ed8.jpg │ │ │ └── Contents.json │ │ ├── 6.imageset │ │ │ ├── 3812b31bb051f819140e404dd9b44aed2e73e78a.jpg │ │ │ └── Contents.json │ │ ├── 7.imageset │ │ │ ├── 11385343fbf2b211aec79449c98065380dd78ecf.jpg │ │ │ └── Contents.json │ │ ├── 8.imageset │ │ │ ├── 060828381f30e9241999de364f086e061d95f7fc.jpg │ │ │ └── Contents.json │ │ ├── 9.imageset │ │ │ ├── Contents.json │ │ │ └── b06f4780e9832137c22977189785837b.jpg │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── SXCircleLayout.h │ ├── SXCircleLayout.m │ ├── SXCircleViewController.h │ ├── SXCircleViewController.m │ ├── SXImageCell.h │ ├── SXImageCell.m │ ├── SXImageCell.xib │ ├── SXLineLayout.h │ ├── SXLineLayout.m │ ├── SXLineViewController.h │ ├── SXLineViewController.m │ ├── SXStackLayout.h │ ├── SXStackLayout.m │ ├── SXStackViewController.h │ ├── SXStackViewController.m │ └── main.m └── 108 - 特殊布局Tests │ ├── Info.plist │ └── _08_______Tests.m ├── LICENSE ├── README.md └── screenshots └── photo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D21A7281ABC3C3000D4B18A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A7271ABC3C3000D4B18A /* main.m */; }; 11 | 1D21A72B1ABC3C3000D4B18A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A72A1ABC3C3000D4B18A /* AppDelegate.m */; }; 12 | 1D21A72E1ABC3C3000D4B18A /* SXStackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A72D1ABC3C3000D4B18A /* SXStackViewController.m */; }; 13 | 1D21A7311ABC3C3000D4B18A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D21A72F1ABC3C3000D4B18A /* Main.storyboard */; }; 14 | 1D21A7331ABC3C3000D4B18A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1D21A7321ABC3C3000D4B18A /* Images.xcassets */; }; 15 | 1D21A7361ABC3C3000D4B18A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1D21A7341ABC3C3000D4B18A /* LaunchScreen.xib */; }; 16 | 1D21A7421ABC3C3000D4B18A /* _08_______Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A7411ABC3C3000D4B18A /* _08_______Tests.m */; }; 17 | 1D21A74E1ABC3E7100D4B18A /* SXLineLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A74D1ABC3E7100D4B18A /* SXLineLayout.m */; }; 18 | 1D21A7511ABC3EAF00D4B18A /* SXCircleLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A7501ABC3EAF00D4B18A /* SXCircleLayout.m */; }; 19 | 1D21A7541ABC3F1F00D4B18A /* SXStackLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A7531ABC3F1F00D4B18A /* SXStackLayout.m */; }; 20 | 1D21A7571ABC3F8200D4B18A /* SXImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D21A7561ABC3F8200D4B18A /* SXImageCell.m */; }; 21 | 1D21A7591ABC3FEA00D4B18A /* SXImageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1D21A7581ABC3FEA00D4B18A /* SXImageCell.xib */; }; 22 | 1D32137D1ABC7026008070B6 /* SXLineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D32137C1ABC7026008070B6 /* SXLineViewController.m */; }; 23 | 1D3213801ABC7392008070B6 /* SXCircleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D32137F1ABC7392008070B6 /* SXCircleViewController.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 1D21A73C1ABC3C3000D4B18A /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 1D21A71A1ABC3C3000D4B18A /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 1D21A7211ABC3C3000D4B18A; 32 | remoteInfo = "108 - 特殊布局"; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 1D21A7221ABC3C3000D4B18A /* 108 - 特殊布局.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "108 - 特殊布局.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 1D21A7261ABC3C3000D4B18A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 1D21A7271ABC3C3000D4B18A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | 1D21A7291ABC3C3000D4B18A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | 1D21A72A1ABC3C3000D4B18A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | 1D21A72C1ABC3C3000D4B18A /* SXStackViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SXStackViewController.h; sourceTree = ""; }; 43 | 1D21A72D1ABC3C3000D4B18A /* SXStackViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SXStackViewController.m; sourceTree = ""; }; 44 | 1D21A7301ABC3C3000D4B18A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 1D21A7321ABC3C3000D4B18A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 46 | 1D21A7351ABC3C3000D4B18A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 47 | 1D21A73B1ABC3C3000D4B18A /* 108 - 特殊布局Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "108 - 特殊布局Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 1D21A7401ABC3C3000D4B18A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 1D21A7411ABC3C3000D4B18A /* _08_______Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "_08_______Tests.m"; sourceTree = ""; }; 50 | 1D21A74C1ABC3E7100D4B18A /* SXLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SXLineLayout.h; sourceTree = ""; }; 51 | 1D21A74D1ABC3E7100D4B18A /* SXLineLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SXLineLayout.m; sourceTree = ""; }; 52 | 1D21A74F1ABC3EAF00D4B18A /* SXCircleLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SXCircleLayout.h; sourceTree = ""; }; 53 | 1D21A7501ABC3EAF00D4B18A /* SXCircleLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SXCircleLayout.m; sourceTree = ""; }; 54 | 1D21A7521ABC3F1F00D4B18A /* SXStackLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SXStackLayout.h; sourceTree = ""; }; 55 | 1D21A7531ABC3F1F00D4B18A /* SXStackLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SXStackLayout.m; sourceTree = ""; }; 56 | 1D21A7551ABC3F8200D4B18A /* SXImageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SXImageCell.h; sourceTree = ""; }; 57 | 1D21A7561ABC3F8200D4B18A /* SXImageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SXImageCell.m; sourceTree = ""; }; 58 | 1D21A7581ABC3FEA00D4B18A /* SXImageCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SXImageCell.xib; sourceTree = ""; }; 59 | 1D32137B1ABC7026008070B6 /* SXLineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SXLineViewController.h; sourceTree = ""; }; 60 | 1D32137C1ABC7026008070B6 /* SXLineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SXLineViewController.m; sourceTree = ""; }; 61 | 1D32137E1ABC7392008070B6 /* SXCircleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SXCircleViewController.h; sourceTree = ""; }; 62 | 1D32137F1ABC7392008070B6 /* SXCircleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SXCircleViewController.m; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 1D21A71F1ABC3C3000D4B18A /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 1D21A7381ABC3C3000D4B18A /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 1D21A7191ABC3C3000D4B18A = { 84 | isa = PBXGroup; 85 | children = ( 86 | 1D21A7241ABC3C3000D4B18A /* 108 - 特殊布局 */, 87 | 1D21A73E1ABC3C3000D4B18A /* 108 - 特殊布局Tests */, 88 | 1D21A7231ABC3C3000D4B18A /* Products */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 1D21A7231ABC3C3000D4B18A /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 1D21A7221ABC3C3000D4B18A /* 108 - 特殊布局.app */, 96 | 1D21A73B1ABC3C3000D4B18A /* 108 - 特殊布局Tests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 1D21A7241ABC3C3000D4B18A /* 108 - 特殊布局 */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 1D21A74B1ABC3CA500D4B18A /* Layout */, 105 | 1D21A7291ABC3C3000D4B18A /* AppDelegate.h */, 106 | 1D21A72A1ABC3C3000D4B18A /* AppDelegate.m */, 107 | 1D21A72C1ABC3C3000D4B18A /* SXStackViewController.h */, 108 | 1D21A72D1ABC3C3000D4B18A /* SXStackViewController.m */, 109 | 1D32137B1ABC7026008070B6 /* SXLineViewController.h */, 110 | 1D32137C1ABC7026008070B6 /* SXLineViewController.m */, 111 | 1D32137E1ABC7392008070B6 /* SXCircleViewController.h */, 112 | 1D32137F1ABC7392008070B6 /* SXCircleViewController.m */, 113 | 1D21A7551ABC3F8200D4B18A /* SXImageCell.h */, 114 | 1D21A7561ABC3F8200D4B18A /* SXImageCell.m */, 115 | 1D21A7581ABC3FEA00D4B18A /* SXImageCell.xib */, 116 | 1D21A72F1ABC3C3000D4B18A /* Main.storyboard */, 117 | 1D21A7321ABC3C3000D4B18A /* Images.xcassets */, 118 | 1D21A7341ABC3C3000D4B18A /* LaunchScreen.xib */, 119 | 1D21A7251ABC3C3000D4B18A /* Supporting Files */, 120 | ); 121 | path = "108 - 特殊布局"; 122 | sourceTree = ""; 123 | }; 124 | 1D21A7251ABC3C3000D4B18A /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 1D21A7261ABC3C3000D4B18A /* Info.plist */, 128 | 1D21A7271ABC3C3000D4B18A /* main.m */, 129 | ); 130 | name = "Supporting Files"; 131 | sourceTree = ""; 132 | }; 133 | 1D21A73E1ABC3C3000D4B18A /* 108 - 特殊布局Tests */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 1D21A7411ABC3C3000D4B18A /* _08_______Tests.m */, 137 | 1D21A73F1ABC3C3000D4B18A /* Supporting Files */, 138 | ); 139 | path = "108 - 特殊布局Tests"; 140 | sourceTree = ""; 141 | }; 142 | 1D21A73F1ABC3C3000D4B18A /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 1D21A7401ABC3C3000D4B18A /* Info.plist */, 146 | ); 147 | name = "Supporting Files"; 148 | sourceTree = ""; 149 | }; 150 | 1D21A74B1ABC3CA500D4B18A /* Layout */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 1D21A74C1ABC3E7100D4B18A /* SXLineLayout.h */, 154 | 1D21A74D1ABC3E7100D4B18A /* SXLineLayout.m */, 155 | 1D21A74F1ABC3EAF00D4B18A /* SXCircleLayout.h */, 156 | 1D21A7501ABC3EAF00D4B18A /* SXCircleLayout.m */, 157 | 1D21A7521ABC3F1F00D4B18A /* SXStackLayout.h */, 158 | 1D21A7531ABC3F1F00D4B18A /* SXStackLayout.m */, 159 | ); 160 | name = Layout; 161 | sourceTree = ""; 162 | }; 163 | /* End PBXGroup section */ 164 | 165 | /* Begin PBXNativeTarget section */ 166 | 1D21A7211ABC3C3000D4B18A /* 108 - 特殊布局 */ = { 167 | isa = PBXNativeTarget; 168 | buildConfigurationList = 1D21A7451ABC3C3000D4B18A /* Build configuration list for PBXNativeTarget "108 - 特殊布局" */; 169 | buildPhases = ( 170 | 1D21A71E1ABC3C3000D4B18A /* Sources */, 171 | 1D21A71F1ABC3C3000D4B18A /* Frameworks */, 172 | 1D21A7201ABC3C3000D4B18A /* Resources */, 173 | ); 174 | buildRules = ( 175 | ); 176 | dependencies = ( 177 | ); 178 | name = "108 - 特殊布局"; 179 | productName = "108 - 特殊布局"; 180 | productReference = 1D21A7221ABC3C3000D4B18A /* 108 - 特殊布局.app */; 181 | productType = "com.apple.product-type.application"; 182 | }; 183 | 1D21A73A1ABC3C3000D4B18A /* 108 - 特殊布局Tests */ = { 184 | isa = PBXNativeTarget; 185 | buildConfigurationList = 1D21A7481ABC3C3000D4B18A /* Build configuration list for PBXNativeTarget "108 - 特殊布局Tests" */; 186 | buildPhases = ( 187 | 1D21A7371ABC3C3000D4B18A /* Sources */, 188 | 1D21A7381ABC3C3000D4B18A /* Frameworks */, 189 | 1D21A7391ABC3C3000D4B18A /* Resources */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | 1D21A73D1ABC3C3000D4B18A /* PBXTargetDependency */, 195 | ); 196 | name = "108 - 特殊布局Tests"; 197 | productName = "108 - 特殊布局Tests"; 198 | productReference = 1D21A73B1ABC3C3000D4B18A /* 108 - 特殊布局Tests.xctest */; 199 | productType = "com.apple.product-type.bundle.unit-test"; 200 | }; 201 | /* End PBXNativeTarget section */ 202 | 203 | /* Begin PBXProject section */ 204 | 1D21A71A1ABC3C3000D4B18A /* Project object */ = { 205 | isa = PBXProject; 206 | attributes = { 207 | CLASSPREFIX = SX; 208 | LastUpgradeCheck = 0630; 209 | ORGANIZATIONNAME = shangxianDante; 210 | TargetAttributes = { 211 | 1D21A7211ABC3C3000D4B18A = { 212 | CreatedOnToolsVersion = 6.3; 213 | }; 214 | 1D21A73A1ABC3C3000D4B18A = { 215 | CreatedOnToolsVersion = 6.3; 216 | TestTargetID = 1D21A7211ABC3C3000D4B18A; 217 | }; 218 | }; 219 | }; 220 | buildConfigurationList = 1D21A71D1ABC3C3000D4B18A /* Build configuration list for PBXProject "108 - 特殊布局" */; 221 | compatibilityVersion = "Xcode 3.2"; 222 | developmentRegion = English; 223 | hasScannedForEncodings = 0; 224 | knownRegions = ( 225 | en, 226 | Base, 227 | ); 228 | mainGroup = 1D21A7191ABC3C3000D4B18A; 229 | productRefGroup = 1D21A7231ABC3C3000D4B18A /* Products */; 230 | projectDirPath = ""; 231 | projectRoot = ""; 232 | targets = ( 233 | 1D21A7211ABC3C3000D4B18A /* 108 - 特殊布局 */, 234 | 1D21A73A1ABC3C3000D4B18A /* 108 - 特殊布局Tests */, 235 | ); 236 | }; 237 | /* End PBXProject section */ 238 | 239 | /* Begin PBXResourcesBuildPhase section */ 240 | 1D21A7201ABC3C3000D4B18A /* Resources */ = { 241 | isa = PBXResourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | 1D21A7311ABC3C3000D4B18A /* Main.storyboard in Resources */, 245 | 1D21A7361ABC3C3000D4B18A /* LaunchScreen.xib in Resources */, 246 | 1D21A7591ABC3FEA00D4B18A /* SXImageCell.xib in Resources */, 247 | 1D21A7331ABC3C3000D4B18A /* Images.xcassets in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | 1D21A7391ABC3C3000D4B18A /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | /* End PBXResourcesBuildPhase section */ 259 | 260 | /* Begin PBXSourcesBuildPhase section */ 261 | 1D21A71E1ABC3C3000D4B18A /* Sources */ = { 262 | isa = PBXSourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | 1D21A72E1ABC3C3000D4B18A /* SXStackViewController.m in Sources */, 266 | 1D21A7511ABC3EAF00D4B18A /* SXCircleLayout.m in Sources */, 267 | 1D21A72B1ABC3C3000D4B18A /* AppDelegate.m in Sources */, 268 | 1D21A7541ABC3F1F00D4B18A /* SXStackLayout.m in Sources */, 269 | 1D21A74E1ABC3E7100D4B18A /* SXLineLayout.m in Sources */, 270 | 1D3213801ABC7392008070B6 /* SXCircleViewController.m in Sources */, 271 | 1D21A7571ABC3F8200D4B18A /* SXImageCell.m in Sources */, 272 | 1D21A7281ABC3C3000D4B18A /* main.m in Sources */, 273 | 1D32137D1ABC7026008070B6 /* SXLineViewController.m in Sources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 1D21A7371ABC3C3000D4B18A /* Sources */ = { 278 | isa = PBXSourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 1D21A7421ABC3C3000D4B18A /* _08_______Tests.m in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXSourcesBuildPhase section */ 286 | 287 | /* Begin PBXTargetDependency section */ 288 | 1D21A73D1ABC3C3000D4B18A /* PBXTargetDependency */ = { 289 | isa = PBXTargetDependency; 290 | target = 1D21A7211ABC3C3000D4B18A /* 108 - 特殊布局 */; 291 | targetProxy = 1D21A73C1ABC3C3000D4B18A /* PBXContainerItemProxy */; 292 | }; 293 | /* End PBXTargetDependency section */ 294 | 295 | /* Begin PBXVariantGroup section */ 296 | 1D21A72F1ABC3C3000D4B18A /* Main.storyboard */ = { 297 | isa = PBXVariantGroup; 298 | children = ( 299 | 1D21A7301ABC3C3000D4B18A /* Base */, 300 | ); 301 | name = Main.storyboard; 302 | sourceTree = ""; 303 | }; 304 | 1D21A7341ABC3C3000D4B18A /* LaunchScreen.xib */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 1D21A7351ABC3C3000D4B18A /* Base */, 308 | ); 309 | name = LaunchScreen.xib; 310 | sourceTree = ""; 311 | }; 312 | /* End PBXVariantGroup section */ 313 | 314 | /* Begin XCBuildConfiguration section */ 315 | 1D21A7431ABC3C3000D4B18A /* Debug */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ALWAYS_SEARCH_USER_PATHS = NO; 319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 320 | CLANG_CXX_LIBRARY = "libc++"; 321 | CLANG_ENABLE_MODULES = YES; 322 | CLANG_ENABLE_OBJC_ARC = YES; 323 | CLANG_WARN_BOOL_CONVERSION = YES; 324 | CLANG_WARN_CONSTANT_CONVERSION = YES; 325 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 326 | CLANG_WARN_EMPTY_BODY = YES; 327 | CLANG_WARN_ENUM_CONVERSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 330 | CLANG_WARN_UNREACHABLE_CODE = YES; 331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 332 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 333 | COPY_PHASE_STRIP = NO; 334 | DEBUG_INFORMATION_FORMAT = dwarf; 335 | ENABLE_STRICT_OBJC_MSGSEND = YES; 336 | GCC_C_LANGUAGE_STANDARD = gnu99; 337 | GCC_DYNAMIC_NO_PIC = NO; 338 | GCC_NO_COMMON_BLOCKS = YES; 339 | GCC_OPTIMIZATION_LEVEL = 0; 340 | GCC_PREPROCESSOR_DEFINITIONS = ( 341 | "DEBUG=1", 342 | "$(inherited)", 343 | ); 344 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 345 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 346 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 347 | GCC_WARN_UNDECLARED_SELECTOR = YES; 348 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 349 | GCC_WARN_UNUSED_FUNCTION = YES; 350 | GCC_WARN_UNUSED_VARIABLE = YES; 351 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 352 | MTL_ENABLE_DEBUG_INFO = YES; 353 | ONLY_ACTIVE_ARCH = YES; 354 | SDKROOT = iphoneos; 355 | }; 356 | name = Debug; 357 | }; 358 | 1D21A7441ABC3C3000D4B18A /* Release */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ALWAYS_SEARCH_USER_PATHS = NO; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BOOL_CONVERSION = YES; 367 | CLANG_WARN_CONSTANT_CONVERSION = YES; 368 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 369 | CLANG_WARN_EMPTY_BODY = YES; 370 | CLANG_WARN_ENUM_CONVERSION = YES; 371 | CLANG_WARN_INT_CONVERSION = YES; 372 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 373 | CLANG_WARN_UNREACHABLE_CODE = YES; 374 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 375 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 376 | COPY_PHASE_STRIP = NO; 377 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 378 | ENABLE_NS_ASSERTIONS = NO; 379 | ENABLE_STRICT_OBJC_MSGSEND = YES; 380 | GCC_C_LANGUAGE_STANDARD = gnu99; 381 | GCC_NO_COMMON_BLOCKS = YES; 382 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 383 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 384 | GCC_WARN_UNDECLARED_SELECTOR = YES; 385 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 386 | GCC_WARN_UNUSED_FUNCTION = YES; 387 | GCC_WARN_UNUSED_VARIABLE = YES; 388 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 389 | MTL_ENABLE_DEBUG_INFO = NO; 390 | SDKROOT = iphoneos; 391 | VALIDATE_PRODUCT = YES; 392 | }; 393 | name = Release; 394 | }; 395 | 1D21A7461ABC3C3000D4B18A /* Debug */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 399 | INFOPLIST_FILE = "108 - 特殊布局/Info.plist"; 400 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | }; 403 | name = Debug; 404 | }; 405 | 1D21A7471ABC3C3000D4B18A /* Release */ = { 406 | isa = XCBuildConfiguration; 407 | buildSettings = { 408 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 409 | INFOPLIST_FILE = "108 - 特殊布局/Info.plist"; 410 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 411 | PRODUCT_NAME = "$(TARGET_NAME)"; 412 | }; 413 | name = Release; 414 | }; 415 | 1D21A7491ABC3C3000D4B18A /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | BUNDLE_LOADER = "$(TEST_HOST)"; 419 | FRAMEWORK_SEARCH_PATHS = ( 420 | "$(SDKROOT)/Developer/Library/Frameworks", 421 | "$(inherited)", 422 | ); 423 | GCC_PREPROCESSOR_DEFINITIONS = ( 424 | "DEBUG=1", 425 | "$(inherited)", 426 | ); 427 | INFOPLIST_FILE = "108 - 特殊布局Tests/Info.plist"; 428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/108 - 特殊布局.app/108 - 特殊布局"; 431 | }; 432 | name = Debug; 433 | }; 434 | 1D21A74A1ABC3C3000D4B18A /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | BUNDLE_LOADER = "$(TEST_HOST)"; 438 | FRAMEWORK_SEARCH_PATHS = ( 439 | "$(SDKROOT)/Developer/Library/Frameworks", 440 | "$(inherited)", 441 | ); 442 | INFOPLIST_FILE = "108 - 特殊布局Tests/Info.plist"; 443 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/108 - 特殊布局.app/108 - 特殊布局"; 446 | }; 447 | name = Release; 448 | }; 449 | /* End XCBuildConfiguration section */ 450 | 451 | /* Begin XCConfigurationList section */ 452 | 1D21A71D1ABC3C3000D4B18A /* Build configuration list for PBXProject "108 - 特殊布局" */ = { 453 | isa = XCConfigurationList; 454 | buildConfigurations = ( 455 | 1D21A7431ABC3C3000D4B18A /* Debug */, 456 | 1D21A7441ABC3C3000D4B18A /* Release */, 457 | ); 458 | defaultConfigurationIsVisible = 0; 459 | defaultConfigurationName = Release; 460 | }; 461 | 1D21A7451ABC3C3000D4B18A /* Build configuration list for PBXNativeTarget "108 - 特殊布局" */ = { 462 | isa = XCConfigurationList; 463 | buildConfigurations = ( 464 | 1D21A7461ABC3C3000D4B18A /* Debug */, 465 | 1D21A7471ABC3C3000D4B18A /* Release */, 466 | ); 467 | defaultConfigurationIsVisible = 0; 468 | defaultConfigurationName = Release; 469 | }; 470 | 1D21A7481ABC3C3000D4B18A /* Build configuration list for PBXNativeTarget "108 - 特殊布局Tests" */ = { 471 | isa = XCConfigurationList; 472 | buildConfigurations = ( 473 | 1D21A7491ABC3C3000D4B18A /* Debug */, 474 | 1D21A74A1ABC3C3000D4B18A /* Release */, 475 | ); 476 | defaultConfigurationIsVisible = 0; 477 | defaultConfigurationName = Release; 478 | }; 479 | /* End XCConfigurationList section */ 480 | }; 481 | rootObject = 1D21A71A1ABC3C3000D4B18A /* Project object */; 482 | } 483 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. 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 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. 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 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/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 | 49 | 58 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "bd3eb13533fa828b9ec3dde4fe1f4134960a5ad0.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/1.imageset/bd3eb13533fa828b9ec3dde4fe1f4134960a5ad0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/1.imageset/bd3eb13533fa828b9ec3dde4fe1f4134960a5ad0.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/10.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "be83b9adec4066b6455b175c13335d4a.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/10.imageset/be83b9adec4066b6455b175c13335d4a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/10.imageset/be83b9adec4066b6455b175c13335d4a.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/11.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "u=622329262,4092570241&fm=56.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/11.imageset/u=622329262,4092570241&fm=56.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/11.imageset/u=622329262,4092570241&fm=56.jpeg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/12.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "u=3535393864,1777389478&fm=56.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/12.imageset/u=3535393864,1777389478&fm=56.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/12.imageset/u=3535393864,1777389478&fm=56.jpeg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/2.imageset/314e251f95cad1c841f319217c3e6709c93d5168.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/2.imageset/314e251f95cad1c841f319217c3e6709c93d5168.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "314e251f95cad1c841f319217c3e6709c93d5168.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/3.imageset/1e6b0cfb40c83b1e51ec8c7c9fe52abc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/3.imageset/1e6b0cfb40c83b1e51ec8c7c9fe52abc.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "1e6b0cfb40c83b1e51ec8c7c9fe52abc.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/4.imageset/7a899e510fb30f244e270105cb95d143ad4b0372.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/4.imageset/7a899e510fb30f244e270105cb95d143ad4b0372.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "7a899e510fb30f244e270105cb95d143ad4b0372.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/5.imageset/37d12f2eb9389b504227a1558635e5dde6116ed8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/5.imageset/37d12f2eb9389b504227a1558635e5dde6116ed8.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "37d12f2eb9389b504227a1558635e5dde6116ed8.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/6.imageset/3812b31bb051f819140e404dd9b44aed2e73e78a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/6.imageset/3812b31bb051f819140e404dd9b44aed2e73e78a.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "3812b31bb051f819140e404dd9b44aed2e73e78a.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/7.imageset/11385343fbf2b211aec79449c98065380dd78ecf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/7.imageset/11385343fbf2b211aec79449c98065380dd78ecf.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "11385343fbf2b211aec79449c98065380dd78ecf.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/8.imageset/060828381f30e9241999de364f086e061d95f7fc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/8.imageset/060828381f30e9241999de364f086e061d95f7fc.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "060828381f30e9241999de364f086e061d95f7fc.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "b06f4780e9832137c22977189785837b.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/9.imageset/b06f4780e9832137c22977189785837b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/108 - 特殊布局/108 - 特殊布局/Images.xcassets/9.imageset/b06f4780e9832137c22977189785837b.jpg -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.thoughtworks.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXCircleLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // SXCircleLayout.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXCircleLayout : UICollectionViewLayout 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXCircleLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXCircleLayout.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import "SXCircleLayout.h" 10 | 11 | @implementation SXCircleLayout 12 | 13 | /** 14 | * 决定cell怎么排布 15 | */ 16 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 17 | { 18 | NSMutableArray *array = [NSMutableArray array]; 19 | NSUInteger count = [self.collectionView numberOfItemsInSection:0]; 20 | for (int i = 0; i < count; i++) { 21 | // 创建i位置cell对应的indexPath 22 | NSIndexPath *path = [NSIndexPath indexPathForItem:i inSection:0]; 23 | 24 | // 创建i位置cell对应的布局属性 25 | UICollectionViewLayoutAttributes *attrs = [self layoutAttributesForItemAtIndexPath:path]; 26 | 27 | // 添加布局属性 28 | [array addObject:attrs]; 29 | } 30 | 31 | return array; 32 | } 33 | 34 | /** 35 | * 返回indexPath位置cell的布局属性 36 | */ 37 | - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath 38 | { 39 | // 半径 40 | CGFloat radius = 80; 41 | 42 | // 圆心 43 | CGFloat centerX = self.collectionView.frame.size.width * 0.5; 44 | CGFloat centerY = self.collectionView.frame.size.height * 0.5; 45 | 46 | // 创建i位置cell对应的布局属性 47 | UICollectionViewLayoutAttributes *attrs = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; 48 | attrs.size = CGSizeMake(60, 60); 49 | 50 | NSUInteger count = [self.collectionView numberOfItemsInSection:0]; 51 | 52 | if (count == 1) { 53 | attrs.center = CGPointMake(centerX, centerY); 54 | } else { 55 | CGFloat angle = 2 * M_PI / count * indexPath.item; 56 | CGFloat attrsCenterX = centerX - radius * cos(angle); 57 | CGFloat attrsCenterY = centerY - radius * sin(angle); 58 | attrs.center = CGPointMake(attrsCenterX, attrsCenterY); 59 | } 60 | 61 | // 用来控制cell的层叠顺序,zIndex越大,cell越在上面 62 | // attrs.zIndex = i; 63 | 64 | return attrs; 65 | } 66 | @end 67 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXCircleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SXVC.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXCircleViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXCircleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXVC.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import "SXCircleViewController.h" 10 | #import "SXCircleLayout.h" 11 | #import "SXImageCell.h" 12 | 13 | @interface SXCircleViewController () 14 | /** 所有的图片名 */ 15 | @property (nonatomic, strong) NSMutableArray *images; 16 | @property (nonatomic, weak) UICollectionView *collectionView; 17 | @end 18 | 19 | @implementation SXCircleViewController 20 | 21 | static NSString *const ID = @"image"; 22 | 23 | - (NSMutableArray *)images 24 | { 25 | if (!_images) { 26 | self.images = [[NSMutableArray alloc] init]; 27 | 28 | for (int i = 1; i<=12; i++) { 29 | [self.images addObject:[NSString stringWithFormat:@"%d", i]]; 30 | } 31 | } 32 | return _images; 33 | } 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | // 创建布局 39 | SXCircleLayout *layout = [[SXCircleLayout alloc] init]; 40 | 41 | // 创建collectionView 42 | UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 235) collectionViewLayout:layout]; 43 | collectionView.dataSource = self; 44 | collectionView.delegate = self; 45 | [collectionView registerNib:[UINib nibWithNibName:@"SXImageCell" bundle:nil] forCellWithReuseIdentifier:ID]; 46 | [self.view addSubview:collectionView]; 47 | self.collectionView = collectionView; 48 | } 49 | 50 | // ------这里是想尝试在点击时切换layout布局样式 但是没有成功。 51 | //- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 52 | //{ 53 | // if ([self.collectionView.collectionViewLayout isKindOfClass:[SXStackLayout class]]) { 54 | // [self.collectionView setCollectionViewLayout:[[SXCircleLayout alloc] init] animated:YES]; 55 | // } else { 56 | // [self.collectionView setCollectionViewLayout:[[SXStackLayout alloc] init] animated:YES]; 57 | // } 58 | //} 59 | 60 | #pragma mark - 61 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 62 | { 63 | return self.images.count; 64 | } 65 | 66 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 67 | { 68 | SXImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; 69 | cell.image = self.images[indexPath.item]; 70 | return cell; 71 | } 72 | 73 | #pragma mark - 74 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 75 | { 76 | // 删除图片名 77 | [self.images removeObjectAtIndex:indexPath.item]; 78 | 79 | // 刷新数据 80 | // [self.collectionView reloadData]; 81 | 82 | // 直接将cell删除 83 | [self.collectionView deleteItemsAtIndexPaths:@[indexPath]]; 84 | } 85 | 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXImageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SXImageCell.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXImageCell : UICollectionViewCell 12 | 13 | @property (nonatomic, copy) NSString *image; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXImageCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXImageCell.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import "SXImageCell.h" 10 | 11 | @interface SXImageCell() 12 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 13 | @end 14 | 15 | @implementation SXImageCell 16 | 17 | - (void)awakeFromNib { 18 | self.imageView.layer.borderWidth = 5; 19 | self.imageView.layer.borderColor = [UIColor whiteColor].CGColor; 20 | self.imageView.layer.cornerRadius = 5; 21 | self.imageView.clipsToBounds = YES; 22 | //// self.imageView.layer.masksToBounds = YES; 23 | } 24 | 25 | - (void)setImage:(NSString *)image 26 | { 27 | _image = [image copy]; 28 | 29 | self.imageView.image = [UIImage imageNamed:image]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXImageCell.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 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXLineLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // SXLineLayout.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXLineLayout : UICollectionViewFlowLayout 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXLineLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXLineLayout.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import "SXLineLayout.h" 10 | 11 | @implementation SXLineLayout 12 | 13 | - (instancetype)init 14 | { 15 | if (self = [super init]) { 16 | } 17 | return self; 18 | } 19 | 20 | /** 21 | * 准备操作:一般在这里设置一些初始化参数 22 | */ 23 | - (void)prepareLayout 24 | { 25 | // 必须要调用父类(父类也有一些准备操作) 26 | [super prepareLayout]; 27 | 28 | // 设置滚动方向(只有流水布局才有这个属性) 29 | self.scrollDirection = UICollectionViewScrollDirectionHorizontal; 30 | 31 | // 设置cell的大小 32 | CGFloat itemWH = self.collectionView.frame.size.height * 0.8; 33 | self.itemSize = CGSizeMake(itemWH, itemWH); 34 | 35 | // 设置内边距 36 | CGFloat inset = (self.collectionView.frame.size.width - itemWH) * 0.5; 37 | self.sectionInset = UIEdgeInsetsMake(0, inset, 0, inset); 38 | } 39 | 40 | /** 41 | * 决定了cell怎么排布 42 | */ 43 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 44 | { 45 | // 调用父类方法拿到默认的布局属性 46 | NSArray *array = [super layoutAttributesForElementsInRect:rect]; 47 | 48 | // 获得collectionView最中间的x值 49 | CGFloat centerX = self.collectionView.contentOffset.x + self.collectionView.frame.size.width * 0.5; 50 | 51 | // 在默认布局属性基础上进行微调 52 | for (UICollectionViewLayoutAttributes *attrs in array) { 53 | // 计算cell中点x 和 collectionView最中间x值 的差距 54 | CGFloat delta = ABS(centerX - attrs.center.x); 55 | 56 | // 利用差距计算出缩放比例(成反比) 57 | CGFloat scale = 1 - delta / (self.collectionView.frame.size.width + self.itemSize.width); 58 | attrs.transform = CGAffineTransformMakeScale(scale, scale); 59 | // attrs.transform3D = CATransform3DMakeRotation(scale * M_PI_4, 0, 1, 1); 60 | } 61 | 62 | return array; 63 | } 64 | 65 | /** 66 | * 当uicollectionView的bounds发生改变时,是否要刷新布局 67 | */ 68 | - (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds 69 | { 70 | return YES; 71 | } 72 | 73 | /** 74 | * targetContentOffset :通过修改后,collectionView最终的contentOffset(取决定情况) 75 | * proposedContentOffset :默认情况下,collectionView最终的contentOffset 76 | */ 77 | - (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity 78 | { 79 | // 计算最终的可见范围 80 | CGRect rect; 81 | rect.origin = proposedContentOffset; 82 | rect.size = self.collectionView.frame.size; 83 | 84 | // 取得cell的布局属性 85 | NSArray *array = [super layoutAttributesForElementsInRect:rect]; 86 | 87 | // 计算collectionView最终中间的x 88 | CGFloat centerX = proposedContentOffset.x + self.collectionView.frame.size.width * 0.5; 89 | 90 | // 计算最小的间距值 91 | CGFloat minDetal = MAXFLOAT; 92 | for (UICollectionViewLayoutAttributes *attrs in array) { 93 | if (ABS(minDetal) > ABS(attrs.center.x - centerX)) { 94 | minDetal = attrs.center.x - centerX; 95 | } 96 | } 97 | 98 | // 在原有offset的基础上进行微调 99 | return CGPointMake(proposedContentOffset.x + minDetal, proposedContentOffset.y); 100 | } 101 | @end 102 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXLineViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SXViewController.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXLineViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXLineViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXViewController.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import "SXLineViewController.h" 10 | #import "SXLineLayout.h" 11 | #import "SXImageCell.h" 12 | 13 | @interface SXLineViewController () 14 | /** 所有的图片名 */ 15 | @property (nonatomic, strong) NSMutableArray *images; 16 | @property (nonatomic, weak) UICollectionView *collectionView; 17 | @end 18 | 19 | @implementation SXLineViewController 20 | 21 | static NSString *const ID = @"image"; 22 | 23 | - (NSMutableArray *)images 24 | { 25 | if (!_images) { 26 | self.images = [[NSMutableArray alloc] init]; 27 | 28 | for (int i = 1; i<=12; i++) { 29 | [self.images addObject:[NSString stringWithFormat:@"%d", i]]; 30 | } 31 | } 32 | return _images; 33 | } 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | // 创建布局 39 | SXLineLayout *layout = [[SXLineLayout alloc] init]; 40 | 41 | // 创建collectionView 42 | UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200) collectionViewLayout:layout]; 43 | collectionView.dataSource = self; 44 | collectionView.delegate = self; 45 | [collectionView registerNib:[UINib nibWithNibName:@"SXImageCell" bundle:nil] forCellWithReuseIdentifier:ID]; 46 | [self.view addSubview:collectionView]; 47 | self.collectionView = collectionView; 48 | } 49 | 50 | #pragma mark - 51 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 52 | { 53 | return 1000; 54 | } 55 | 56 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 57 | { 58 | SXImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; 59 | cell.image = self.images[indexPath.item%(self.images.count)]; 60 | return cell; 61 | } 62 | 63 | #pragma mark - 64 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 65 | { 66 | [self.collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES]; 67 | } 68 | 69 | //- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView 70 | //{ 71 | // NSInteger index = (scrollView.contentOffset.x + self.collectionView.frame.size.width * 0.5) / (self.view.frame.size.width * 0.8 * 0.5) - 1; 72 | // NSLog(@"Current Index : %ld",index); 73 | // self.currentIndex = index; 74 | //} 75 | 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXStackLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // SXStackLayout.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXStackLayout : UICollectionViewLayout 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXStackLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXStackLayout.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import "SXStackLayout.h" 10 | 11 | @implementation SXStackLayout 12 | 13 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 14 | { 15 | NSMutableArray *array = [NSMutableArray array]; 16 | 17 | NSUInteger count = [self.collectionView numberOfItemsInSection:0]; 18 | for (int i = 0; i 4) { 39 | attrs.hidden = YES; 40 | return attrs; 41 | } 42 | 43 | // indexPath.item == [1, 2, 3, 4] 44 | NSArray *angles = @[@0, @(-0.2), @(0.2), @(-0.5), @(0.5)]; 45 | CGFloat angle = [angles[indexPath.item] doubleValue]; 46 | attrs.transform = CGAffineTransformMakeRotation(angle); 47 | 48 | return attrs; 49 | } 50 | 51 | @end 52 | 53 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXStackViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXStackViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/SXStackViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import "SXStackViewController.h" 10 | #import "SXStackLayout.h" 11 | #import "SXImageCell.h" 12 | 13 | @interface SXStackViewController () 14 | /** 所有的图片名 */ 15 | @property (nonatomic, strong) NSMutableArray *images; 16 | @property (nonatomic, weak) UICollectionView *collectionView; 17 | @end 18 | 19 | @implementation SXStackViewController 20 | 21 | static NSString *const ID = @"image"; 22 | 23 | - (NSMutableArray *)images 24 | { 25 | if (!_images) { 26 | self.images = [[NSMutableArray alloc] init]; 27 | 28 | for (int i = 1; i<=12; i++) { 29 | [self.images addObject:[NSString stringWithFormat:@"%d", i]]; 30 | } 31 | } 32 | return _images; 33 | } 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | // 创建布局 39 | SXStackLayout *layout = [[SXStackLayout alloc] init]; 40 | 41 | // 创建collectionView 42 | UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200) collectionViewLayout:layout]; 43 | collectionView.dataSource = self; 44 | collectionView.delegate = self; 45 | collectionView.backgroundColor = [UIColor clearColor]; 46 | [collectionView registerNib:[UINib nibWithNibName:@"SXImageCell" bundle:nil] forCellWithReuseIdentifier:ID]; 47 | [self.view addSubview:collectionView]; 48 | self.collectionView = collectionView; 49 | } 50 | 51 | #pragma mark - 52 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 53 | { 54 | return self.images.count; 55 | } 56 | 57 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 58 | { 59 | SXImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; 60 | cell.image = self.images[indexPath.item]; 61 | return cell; 62 | } 63 | 64 | #pragma mark - 65 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 66 | { 67 | // 删除图片名 68 | [self.images removeObjectAtIndex:indexPath.item]; 69 | 70 | // 刷新数据 71 | // [self.collectionView reloadData]; 72 | 73 | // 直接将cell删除 74 | [self.collectionView deleteItemsAtIndexPaths:@[indexPath]]; 75 | } 76 | 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 108 - 特殊布局 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. 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 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.thoughtworks.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /108 - 特殊布局/108 - 特殊布局Tests/_08_______Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // _08_______Tests.m 3 | // 108 - 特殊布局Tests 4 | // 5 | // Created by 董 尚先 on 15/3/20. 6 | // Copyright (c) 2015年 shangxianDante. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface _08_______Tests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation _08_______Tests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 董铂然 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SXPhotoShow 2 | 使用三种自定义布局做的照片秀 3 | 4 |
5 | ![image](https://github.com/dsxNiubility/SXPhotoShow/raw/master/screenshots/photo.gif) 6 | 7 | UICollectionViewFlowLayout流水布局 是当下collectionView中常用且普通的布局方式。本代码也写了三种好看的布局,其中LineLayout和流水布局有很大的相同点就直接继承UICollectionViewFlowLayout,然后StackLayout,CircleLayout这两种都是直接继承自最原始的UICollectionViewLayout 布局方案。 8 | 9 | ### SXStackLayout 10 | 类似于扑克牌错位叠在一起的布局,暂时能做到的是两边对称。点击cell删除或是cell的数量发生改变时会重新布局,角度也会随之更改产生动画效果。 11 | 12 | ### SXLineLayout 13 | 是一条直线的布局,但是拖动的过程中,cell的大小会根据自己位置的改变而改变,滑到中间时最大,两边时最小。并且做了处理有一个吸附的效果,每次快要停止时都会把最靠近中间的cell放在正中间不歪。 14 | 15 | ### SXCircleLayout 16 | 这是一个环形的布局,位置也是会随着整体数量的改变而改变的。demo设置的是可以点击删除的,亲可以试试在删最后5个的时候会有炫酷效果发生。 17 | 18 | #### 使用方法 19 | >1.建立自己需要的项目,里面要先有collectionView和collectionCell(demo里是最朴实的写法)

20 | 2.将项目中的`Layout`文件夹拖入项目中。 里面有三种布局,想用哪种就导入哪种的头文件。
21 | `#import "SXStackLayout.h"` -- 对应的是上图的顶部
`#import "SXLineLayout.h"` -- 对应的是上图的中间
`#import "SXCircleLayout.h"` -- 对应的是上图的下方

22 | 3.在ViewDidLoad方法中创建布局
23 | `SXCircleLayout *layout = [[SXCircleLayout alloc] init];`
24 | 并在collection的初始化方法中填上这个引入的布局
25 | `UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 235)) collectionViewLayout:layout];` -------------------------------------------------------------------------------- /screenshots/photo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXPhotoShow/570b6c4c10773d68fa3f9f875c0919f57ac2ed56/screenshots/photo.gif --------------------------------------------------------------------------------