├── .gitignore ├── DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── DynamicCollectionViewCellWithAutoLayout-Demo.xccheckout │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── ZhangHonghao.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── angelvazquez.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── ZhangHonghao.xcuserdatad │ └── xcschemes │ │ ├── DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme │ │ └── xcschememanagement.plist │ ├── angelvazquez.xcuserdatad │ └── xcschemes │ │ ├── DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme │ │ └── xcschememanagement.plist │ └── honghaozhang.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme │ └── xcschememanagement.plist ├── DynamicCollectionViewCellWithAutoLayout-Demo ├── AppDelegate.swift ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Info.plist ├── Main.storyboard ├── MyCollectionViewCell.swift ├── MyCollectionViewCell.xib └── ViewController.swift ├── DynamicCollectionViewCellWithAutoLayout-DemoTests ├── DynamicCollectionViewCellWithAutoLayout_DemoTests.swift └── Info.plist ├── LICENSE.md ├── README.md ├── Screenshots ├── cell.png ├── contentCell.png ├── contentCell2.png └── titleCell.png ├── iOS Simulator Screen Shot1.png └── iOS Simulator Screen Shot2.png /.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata/ -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 47; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E783D5AA1C2DC6B900570E73 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E783D5A91C2DC6B900570E73 /* Main.storyboard */; }; 11 | FA099E1219D6205200D9F6B9 /* MyCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA099E1019D6205200D9F6B9 /* MyCollectionViewCell.swift */; }; 12 | FA099E1319D6205200D9F6B9 /* MyCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = FA099E1119D6205200D9F6B9 /* MyCollectionViewCell.xib */; }; 13 | FA4391B319D4E74600CA06C4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4391B219D4E74600CA06C4 /* AppDelegate.swift */; }; 14 | FA4391B519D4E74600CA06C4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4391B419D4E74600CA06C4 /* ViewController.swift */; }; 15 | FA4391BA19D4E74600CA06C4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA4391B919D4E74600CA06C4 /* Images.xcassets */; }; 16 | FA4391C919D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout_DemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4391C819D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout_DemoTests.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | FA4391C319D4E74600CA06C4 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = FA4391A519D4E74600CA06C4 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = FA4391AC19D4E74600CA06C4; 25 | remoteInfo = "DynamicCollectionViewCellWithAutoLayout-Demo"; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | E783D5A91C2DC6B900570E73 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 31 | FA099E1019D6205200D9F6B9 /* MyCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyCollectionViewCell.swift; sourceTree = ""; }; 32 | FA099E1119D6205200D9F6B9 /* MyCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyCollectionViewCell.xib; sourceTree = ""; }; 33 | FA4391AD19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DynamicCollectionViewCellWithAutoLayout-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | FA4391B119D4E74600CA06C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | FA4391B219D4E74600CA06C4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 36 | FA4391B419D4E74600CA06C4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 37 | FA4391B919D4E74600CA06C4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 38 | FA4391C219D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DynamicCollectionViewCellWithAutoLayout-DemoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | FA4391C719D4E74600CA06C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | FA4391C819D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout_DemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicCollectionViewCellWithAutoLayout_DemoTests.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | FA4391AA19D4E74600CA06C4 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | FA4391BF19D4E74600CA06C4 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | E7CD6B811C2DD2470036C6E3 /* Cell */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | FA099E1019D6205200D9F6B9 /* MyCollectionViewCell.swift */, 65 | FA099E1119D6205200D9F6B9 /* MyCollectionViewCell.xib */, 66 | ); 67 | name = Cell; 68 | sourceTree = ""; 69 | }; 70 | FA4391A419D4E74600CA06C4 = { 71 | isa = PBXGroup; 72 | children = ( 73 | FA4391AF19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo */, 74 | FA4391C519D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-DemoTests */, 75 | FA4391AE19D4E74600CA06C4 /* Products */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | FA4391AE19D4E74600CA06C4 /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | FA4391AD19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo.app */, 83 | FA4391C219D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-DemoTests.xctest */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | FA4391AF19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | FA4391B219D4E74600CA06C4 /* AppDelegate.swift */, 92 | FA4391B419D4E74600CA06C4 /* ViewController.swift */, 93 | E783D5A91C2DC6B900570E73 /* Main.storyboard */, 94 | E7CD6B811C2DD2470036C6E3 /* Cell */, 95 | FA4391B919D4E74600CA06C4 /* Images.xcassets */, 96 | FA4391B019D4E74600CA06C4 /* Supporting Files */, 97 | ); 98 | path = "DynamicCollectionViewCellWithAutoLayout-Demo"; 99 | sourceTree = ""; 100 | }; 101 | FA4391B019D4E74600CA06C4 /* Supporting Files */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | FA4391B119D4E74600CA06C4 /* Info.plist */, 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | FA4391C519D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-DemoTests */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | FA4391C819D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout_DemoTests.swift */, 113 | FA4391C619D4E74600CA06C4 /* Supporting Files */, 114 | ); 115 | path = "DynamicCollectionViewCellWithAutoLayout-DemoTests"; 116 | sourceTree = ""; 117 | }; 118 | FA4391C619D4E74600CA06C4 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | FA4391C719D4E74600CA06C4 /* Info.plist */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | FA4391AC19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = FA4391CC19D4E74600CA06C4 /* Build configuration list for PBXNativeTarget "DynamicCollectionViewCellWithAutoLayout-Demo" */; 132 | buildPhases = ( 133 | FA4391A919D4E74600CA06C4 /* Sources */, 134 | FA4391AA19D4E74600CA06C4 /* Frameworks */, 135 | FA4391AB19D4E74600CA06C4 /* Resources */, 136 | ); 137 | buildRules = ( 138 | ); 139 | dependencies = ( 140 | ); 141 | name = "DynamicCollectionViewCellWithAutoLayout-Demo"; 142 | productName = "DynamicCollectionViewCellWithAutoLayout-Demo"; 143 | productReference = FA4391AD19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo.app */; 144 | productType = "com.apple.product-type.application"; 145 | }; 146 | FA4391C119D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-DemoTests */ = { 147 | isa = PBXNativeTarget; 148 | buildConfigurationList = FA4391CF19D4E74600CA06C4 /* Build configuration list for PBXNativeTarget "DynamicCollectionViewCellWithAutoLayout-DemoTests" */; 149 | buildPhases = ( 150 | FA4391BE19D4E74600CA06C4 /* Sources */, 151 | FA4391BF19D4E74600CA06C4 /* Frameworks */, 152 | FA4391C019D4E74600CA06C4 /* Resources */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | FA4391C419D4E74600CA06C4 /* PBXTargetDependency */, 158 | ); 159 | name = "DynamicCollectionViewCellWithAutoLayout-DemoTests"; 160 | productName = "DynamicCollectionViewCellWithAutoLayout-DemoTests"; 161 | productReference = FA4391C219D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-DemoTests.xctest */; 162 | productType = "com.apple.product-type.bundle.unit-test"; 163 | }; 164 | /* End PBXNativeTarget section */ 165 | 166 | /* Begin PBXProject section */ 167 | FA4391A519D4E74600CA06C4 /* Project object */ = { 168 | isa = PBXProject; 169 | attributes = { 170 | LastSwiftUpdateCheck = 0720; 171 | LastUpgradeCheck = 1000; 172 | ORGANIZATIONNAME = HonghaoZ; 173 | TargetAttributes = { 174 | FA4391AC19D4E74600CA06C4 = { 175 | CreatedOnToolsVersion = 6.0; 176 | }; 177 | FA4391C119D4E74600CA06C4 = { 178 | CreatedOnToolsVersion = 6.0; 179 | TestTargetID = FA4391AC19D4E74600CA06C4; 180 | }; 181 | }; 182 | }; 183 | buildConfigurationList = FA4391A819D4E74600CA06C4 /* Build configuration list for PBXProject "DynamicCollectionViewCellWithAutoLayout-Demo" */; 184 | compatibilityVersion = "Xcode 6.3"; 185 | developmentRegion = English; 186 | hasScannedForEncodings = 0; 187 | knownRegions = ( 188 | en, 189 | Base, 190 | ); 191 | mainGroup = FA4391A419D4E74600CA06C4; 192 | productRefGroup = FA4391AE19D4E74600CA06C4 /* Products */; 193 | projectDirPath = ""; 194 | projectRoot = ""; 195 | targets = ( 196 | FA4391AC19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo */, 197 | FA4391C119D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-DemoTests */, 198 | ); 199 | }; 200 | /* End PBXProject section */ 201 | 202 | /* Begin PBXResourcesBuildPhase section */ 203 | FA4391AB19D4E74600CA06C4 /* Resources */ = { 204 | isa = PBXResourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | E783D5AA1C2DC6B900570E73 /* Main.storyboard in Resources */, 208 | FA4391BA19D4E74600CA06C4 /* Images.xcassets in Resources */, 209 | FA099E1319D6205200D9F6B9 /* MyCollectionViewCell.xib in Resources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | FA4391C019D4E74600CA06C4 /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | FA4391A919D4E74600CA06C4 /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | FA4391B519D4E74600CA06C4 /* ViewController.swift in Sources */, 228 | FA4391B319D4E74600CA06C4 /* AppDelegate.swift in Sources */, 229 | FA099E1219D6205200D9F6B9 /* MyCollectionViewCell.swift in Sources */, 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | FA4391BE19D4E74600CA06C4 /* Sources */ = { 234 | isa = PBXSourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | FA4391C919D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout_DemoTests.swift in Sources */, 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | /* End PBXSourcesBuildPhase section */ 242 | 243 | /* Begin PBXTargetDependency section */ 244 | FA4391C419D4E74600CA06C4 /* PBXTargetDependency */ = { 245 | isa = PBXTargetDependency; 246 | target = FA4391AC19D4E74600CA06C4 /* DynamicCollectionViewCellWithAutoLayout-Demo */; 247 | targetProxy = FA4391C319D4E74600CA06C4 /* PBXContainerItemProxy */; 248 | }; 249 | /* End PBXTargetDependency section */ 250 | 251 | /* Begin XCBuildConfiguration section */ 252 | FA4391CA19D4E74600CA06C4 /* Debug */ = { 253 | isa = XCBuildConfiguration; 254 | buildSettings = { 255 | ALWAYS_SEARCH_USER_PATHS = NO; 256 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 257 | CLANG_CXX_LIBRARY = "libc++"; 258 | CLANG_ENABLE_MODULES = YES; 259 | CLANG_ENABLE_OBJC_ARC = YES; 260 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 261 | CLANG_WARN_BOOL_CONVERSION = YES; 262 | CLANG_WARN_COMMA = YES; 263 | CLANG_WARN_CONSTANT_CONVERSION = YES; 264 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 265 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 266 | CLANG_WARN_EMPTY_BODY = YES; 267 | CLANG_WARN_ENUM_CONVERSION = YES; 268 | CLANG_WARN_INFINITE_RECURSION = YES; 269 | CLANG_WARN_INT_CONVERSION = YES; 270 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 271 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 272 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 273 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 274 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 275 | CLANG_WARN_STRICT_PROTOTYPES = YES; 276 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 277 | CLANG_WARN_UNREACHABLE_CODE = YES; 278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 279 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 280 | COPY_PHASE_STRIP = NO; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | ENABLE_TESTABILITY = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_DYNAMIC_NO_PIC = NO; 285 | GCC_NO_COMMON_BLOCKS = YES; 286 | GCC_OPTIMIZATION_LEVEL = 0; 287 | GCC_PREPROCESSOR_DEFINITIONS = ( 288 | "DEBUG=1", 289 | "$(inherited)", 290 | ); 291 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 299 | MTL_ENABLE_DEBUG_INFO = YES; 300 | ONLY_ACTIVE_ARCH = YES; 301 | SDKROOT = iphoneos; 302 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | }; 305 | name = Debug; 306 | }; 307 | FA4391CB19D4E74600CA06C4 /* Release */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | ALWAYS_SEARCH_USER_PATHS = NO; 311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 312 | CLANG_CXX_LIBRARY = "libc++"; 313 | CLANG_ENABLE_MODULES = YES; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_COMMA = YES; 318 | CLANG_WARN_CONSTANT_CONVERSION = YES; 319 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INFINITE_RECURSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 326 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 327 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 329 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 330 | CLANG_WARN_STRICT_PROTOTYPES = YES; 331 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 332 | CLANG_WARN_UNREACHABLE_CODE = YES; 333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 335 | COPY_PHASE_STRIP = YES; 336 | ENABLE_NS_ASSERTIONS = NO; 337 | ENABLE_STRICT_OBJC_MSGSEND = YES; 338 | GCC_C_LANGUAGE_STANDARD = gnu99; 339 | GCC_NO_COMMON_BLOCKS = YES; 340 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 341 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 342 | GCC_WARN_UNDECLARED_SELECTOR = YES; 343 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 344 | GCC_WARN_UNUSED_FUNCTION = YES; 345 | GCC_WARN_UNUSED_VARIABLE = YES; 346 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 347 | MTL_ENABLE_DEBUG_INFO = NO; 348 | SDKROOT = iphoneos; 349 | SWIFT_COMPILATION_MODE = wholemodule; 350 | TARGETED_DEVICE_FAMILY = "1,2"; 351 | VALIDATE_PRODUCT = YES; 352 | }; 353 | name = Release; 354 | }; 355 | FA4391CD19D4E74600CA06C4 /* Debug */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 359 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 360 | CODE_SIGN_IDENTITY = "iPhone Developer"; 361 | INFOPLIST_FILE = "DynamicCollectionViewCellWithAutoLayout-Demo/Info.plist"; 362 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 363 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 364 | PRODUCT_BUNDLE_IDENTIFIER = "com.honghaoz.$(PRODUCT_NAME:rfc1034identifier)"; 365 | PRODUCT_NAME = "$(TARGET_NAME)"; 366 | SWIFT_VERSION = 4.2; 367 | }; 368 | name = Debug; 369 | }; 370 | FA4391CE19D4E74600CA06C4 /* Release */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 375 | CODE_SIGN_IDENTITY = "iPhone Developer"; 376 | INFOPLIST_FILE = "DynamicCollectionViewCellWithAutoLayout-Demo/Info.plist"; 377 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 378 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 379 | PRODUCT_BUNDLE_IDENTIFIER = "com.honghaoz.$(PRODUCT_NAME:rfc1034identifier)"; 380 | PRODUCT_NAME = "$(TARGET_NAME)"; 381 | SWIFT_VERSION = 4.2; 382 | }; 383 | name = Release; 384 | }; 385 | FA4391D019D4E74600CA06C4 /* Debug */ = { 386 | isa = XCBuildConfiguration; 387 | buildSettings = { 388 | BUNDLE_LOADER = "$(TEST_HOST)"; 389 | FRAMEWORK_SEARCH_PATHS = ( 390 | "$(SDKROOT)/Developer/Library/Frameworks", 391 | "$(inherited)", 392 | ); 393 | GCC_PREPROCESSOR_DEFINITIONS = ( 394 | "DEBUG=1", 395 | "$(inherited)", 396 | ); 397 | INFOPLIST_FILE = "DynamicCollectionViewCellWithAutoLayout-DemoTests/Info.plist"; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 399 | PRODUCT_BUNDLE_IDENTIFIER = "com.honghaoz.$(PRODUCT_NAME:rfc1034identifier)"; 400 | PRODUCT_NAME = "$(TARGET_NAME)"; 401 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DynamicCollectionViewCellWithAutoLayout-Demo.app/DynamicCollectionViewCellWithAutoLayout-Demo"; 402 | }; 403 | name = Debug; 404 | }; 405 | FA4391D119D4E74600CA06C4 /* Release */ = { 406 | isa = XCBuildConfiguration; 407 | buildSettings = { 408 | BUNDLE_LOADER = "$(TEST_HOST)"; 409 | FRAMEWORK_SEARCH_PATHS = ( 410 | "$(SDKROOT)/Developer/Library/Frameworks", 411 | "$(inherited)", 412 | ); 413 | INFOPLIST_FILE = "DynamicCollectionViewCellWithAutoLayout-DemoTests/Info.plist"; 414 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 415 | PRODUCT_BUNDLE_IDENTIFIER = "com.honghaoz.$(PRODUCT_NAME:rfc1034identifier)"; 416 | PRODUCT_NAME = "$(TARGET_NAME)"; 417 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DynamicCollectionViewCellWithAutoLayout-Demo.app/DynamicCollectionViewCellWithAutoLayout-Demo"; 418 | }; 419 | name = Release; 420 | }; 421 | /* End XCBuildConfiguration section */ 422 | 423 | /* Begin XCConfigurationList section */ 424 | FA4391A819D4E74600CA06C4 /* Build configuration list for PBXProject "DynamicCollectionViewCellWithAutoLayout-Demo" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | FA4391CA19D4E74600CA06C4 /* Debug */, 428 | FA4391CB19D4E74600CA06C4 /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | FA4391CC19D4E74600CA06C4 /* Build configuration list for PBXNativeTarget "DynamicCollectionViewCellWithAutoLayout-Demo" */ = { 434 | isa = XCConfigurationList; 435 | buildConfigurations = ( 436 | FA4391CD19D4E74600CA06C4 /* Debug */, 437 | FA4391CE19D4E74600CA06C4 /* Release */, 438 | ); 439 | defaultConfigurationIsVisible = 0; 440 | defaultConfigurationName = Release; 441 | }; 442 | FA4391CF19D4E74600CA06C4 /* Build configuration list for PBXNativeTarget "DynamicCollectionViewCellWithAutoLayout-DemoTests" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | FA4391D019D4E74600CA06C4 /* Debug */, 446 | FA4391D119D4E74600CA06C4 /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | /* End XCConfigurationList section */ 452 | }; 453 | rootObject = FA4391A519D4E74600CA06C4 /* Project object */; 454 | } 455 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.xcworkspace/xcshareddata/DynamicCollectionViewCellWithAutoLayout-Demo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 70C1FFB8-21B5-4B74-9FF2-6AAC26A9F439 9 | IDESourceControlProjectName 10 | DynamicCollectionViewCellWithAutoLayout-Demo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 5904F8FEC045172C5F57522F596A3206AC11944D 14 | https://github.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo.git 15 | 16 | IDESourceControlProjectPath 17 | DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 5904F8FEC045172C5F57522F596A3206AC11944D 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 5904F8FEC045172C5F57522F596A3206AC11944D 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 5904F8FEC045172C5F57522F596A3206AC11944D 36 | IDESourceControlWCCName 37 | Dynamic-Collection-View-Cell-With-Auto-Layout-Demo 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.xcworkspace/xcuserdata/ZhangHonghao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.xcworkspace/xcuserdata/ZhangHonghao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.xcworkspace/xcuserdata/angelvazquez.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/project.xcworkspace/xcuserdata/angelvazquez.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/xcuserdata/ZhangHonghao.xcuserdatad/xcschemes/DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/xcuserdata/ZhangHonghao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | FA4391AC19D4E74600CA06C4 16 | 17 | primary 18 | 19 | 20 | FA4391C119D4E74600CA06C4 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/xcuserdata/angelvazquez.xcuserdatad/xcschemes/DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/xcuserdata/angelvazquez.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | FA4391AC19D4E74600CA06C4 16 | 17 | primary 18 | 19 | 20 | FA4391C119D4E74600CA06C4 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/xcuserdata/honghaozhang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/xcuserdata/honghaozhang.xcuserdatad/xcschemes/DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo.xcodeproj/xcuserdata/honghaozhang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DynamicCollectionViewCellWithAutoLayout-Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | FA4391AC19D4E74600CA06C4 16 | 17 | primary 18 | 19 | 20 | FA4391C119D4E74600CA06C4 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DynamicCollectionViewCellWithAutoLayout-Demo 4 | // 5 | // Created by Honghao Zhang on 2014-09-25. 6 | // Copyright (c) 2014 HonghaoZ. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | func applicationWillResignActive(_ application: UIApplication) { 22 | // 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. 23 | // 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. 24 | } 25 | 26 | func applicationDidEnterBackground(_ application: UIApplication) { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | func applicationWillEnterForeground(_ application: UIApplication) { 32 | // 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. 33 | } 34 | 35 | func applicationDidBecomeActive(_ application: UIApplication) { 36 | // 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. 37 | } 38 | 39 | func applicationWillTerminate(_ application: UIApplication) { 40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 41 | } 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "8.0", 8 | "subtype" : "736h", 9 | "scale" : "3x" 10 | }, 11 | { 12 | "orientation" : "landscape", 13 | "idiom" : "iphone", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "8.0", 16 | "subtype" : "736h", 17 | "scale" : "3x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "iphone", 22 | "extent" : "full-screen", 23 | "minimum-system-version" : "8.0", 24 | "subtype" : "667h", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "orientation" : "portrait", 29 | "idiom" : "iphone", 30 | "extent" : "full-screen", 31 | "minimum-system-version" : "7.0", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "orientation" : "portrait", 36 | "idiom" : "iphone", 37 | "extent" : "full-screen", 38 | "minimum-system-version" : "7.0", 39 | "subtype" : "retina4", 40 | "scale" : "2x" 41 | }, 42 | { 43 | "orientation" : "portrait", 44 | "idiom" : "ipad", 45 | "extent" : "full-screen", 46 | "minimum-system-version" : "7.0", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "orientation" : "landscape", 51 | "idiom" : "ipad", 52 | "extent" : "full-screen", 53 | "minimum-system-version" : "7.0", 54 | "scale" : "1x" 55 | }, 56 | { 57 | "orientation" : "portrait", 58 | "idiom" : "ipad", 59 | "extent" : "full-screen", 60 | "minimum-system-version" : "7.0", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "orientation" : "landscape", 65 | "idiom" : "ipad", 66 | "extent" : "full-screen", 67 | "minimum-system-version" : "7.0", 68 | "scale" : "2x" 69 | }, 70 | { 71 | "orientation" : "portrait", 72 | "idiom" : "iphone", 73 | "extent" : "full-screen", 74 | "scale" : "1x" 75 | }, 76 | { 77 | "orientation" : "portrait", 78 | "idiom" : "iphone", 79 | "extent" : "full-screen", 80 | "scale" : "2x" 81 | }, 82 | { 83 | "orientation" : "portrait", 84 | "idiom" : "iphone", 85 | "extent" : "full-screen", 86 | "subtype" : "retina4", 87 | "scale" : "2x" 88 | }, 89 | { 90 | "orientation" : "portrait", 91 | "idiom" : "ipad", 92 | "extent" : "to-status-bar", 93 | "scale" : "1x" 94 | }, 95 | { 96 | "orientation" : "portrait", 97 | "idiom" : "ipad", 98 | "extent" : "full-screen", 99 | "scale" : "1x" 100 | }, 101 | { 102 | "orientation" : "landscape", 103 | "idiom" : "ipad", 104 | "extent" : "to-status-bar", 105 | "scale" : "1x" 106 | }, 107 | { 108 | "orientation" : "landscape", 109 | "idiom" : "ipad", 110 | "extent" : "full-screen", 111 | "scale" : "1x" 112 | }, 113 | { 114 | "orientation" : "portrait", 115 | "idiom" : "ipad", 116 | "extent" : "to-status-bar", 117 | "scale" : "2x" 118 | }, 119 | { 120 | "orientation" : "portrait", 121 | "idiom" : "ipad", 122 | "extent" : "full-screen", 123 | "scale" : "2x" 124 | }, 125 | { 126 | "orientation" : "landscape", 127 | "idiom" : "ipad", 128 | "extent" : "to-status-bar", 129 | "scale" : "2x" 130 | }, 131 | { 132 | "orientation" : "landscape", 133 | "idiom" : "ipad", 134 | "extent" : "full-screen", 135 | "scale" : "2x" 136 | } 137 | ], 138 | "info" : { 139 | "version" : 1, 140 | "author" : "xcode" 141 | } 142 | } -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | Main 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/MyCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MyCollectionViewCell.swift 3 | // DynamicCollectionViewCellWithAutoLayout-Demo 4 | // 5 | // Created by Honghao Zhang on 2014-09-26. 6 | // Copyright (c) 2014 HonghaoZ. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // Check System Version 12 | let isIOS7: Bool = !isIOS8 13 | let isIOS8: Bool = floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1 14 | 15 | class MyCollectionViewCell: UICollectionViewCell { 16 | 17 | @IBOutlet weak var titleLabel: UILabel! 18 | @IBOutlet weak var contentLabel: UILabel! 19 | 20 | let kLabelVerticalInsets: CGFloat = 8.0 21 | let kLabelHorizontalInsets: CGFloat = 8.0 22 | 23 | override func awakeFromNib() { 24 | super.awakeFromNib() 25 | // Initialization code 26 | if isIOS7 { 27 | // Need set autoresizingMask to let contentView always occupy this view's bounds, key for iOS7 28 | self.contentView.autoresizingMask = [.flexibleHeight, .flexibleWidth] 29 | } 30 | self.layer.masksToBounds = true 31 | } 32 | 33 | // In layoutSubViews, need set preferredMaxLayoutWidth for multiple lines label 34 | override func layoutSubviews() { 35 | super.layoutSubviews() 36 | // Set what preferredMaxLayoutWidth you want 37 | contentLabel.preferredMaxLayoutWidth = self.bounds.width - 2 * kLabelHorizontalInsets 38 | } 39 | 40 | func configCell(title: String, content: String, titleFont: String, contentFont: String) { 41 | titleLabel.text = title 42 | contentLabel.text = content 43 | 44 | titleLabel.font = UIFont(name: titleFont, size: 18) 45 | contentLabel.font = UIFont(name: contentFont, size: 16) 46 | self.setNeedsLayout() 47 | self.layoutIfNeeded() 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/MyCollectionViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-Demo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // DynamicCollectionViewCellWithAutoLayout-Demo 4 | // 5 | // Created by Honghao Zhang on 2014-09-25. 6 | // Copyright (c) 2014 HonghaoZ. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { 12 | 13 | @IBOutlet weak var collectionView: UICollectionView! 14 | 15 | let kCellIdentifier = "MyCell" 16 | 17 | let kHorizontalInsets: CGFloat = 10.0 18 | let kVerticalInsets: CGFloat = 10.0 19 | 20 | var exampleTitle: String = "Steve Jobs, BMW & eBay" 21 | 22 | var exampleContent: String = "And you know what? He’s right.\nThe world doesn’t need another Dell or HP. It doesn’t need another manufacturer of plain, beige, boring PCs. If that’s all we’re going to do, then we should really pack up now.\nBut we’re lucky, because Apple has a purpose. Unlike anyone in the industry, people want us to make products that they love. In fact, more than love. Our job is to make products that people lust for. That’s what Apple is meant to be.\nWhat’s BMW’s market share of the auto market? Does anyone know? Well, it’s less than 2%, but no one cares. Why? Because either you drive a BMW or you stare at the new one driving by. If we do our job, we’ll make products that people lust after, and no one will care about our market share.\nApple is a start-up. Granted, it’s a startup with $6B in revenue, but that can and will go in an instant. If you are here for a cushy 9-to-5 job, then that’s OK, but you should go. We’re going to make sure everyone has stock options, and that they are oriented towards the long term. If you need a big salary and bonus, then that’s OK, but you should go. This isn’t going to be that place. There are plenty of companies like that in the Valley. This is going to be hard work, possibly the hardest you’ve ever done. But if we do it right, it’s going to be worth it.\n" 23 | 24 | var numberOfSections = 1 25 | var numberOfCells = 3 26 | var titleData = [String]() 27 | var contentData = [String]() 28 | var fontArray = UIFont.familyNames 29 | 30 | // A dictionary of offscreen cells that are used within the sizeForItemAtIndexPath method to handle the size calculations. These are never drawn onscreen. The dictionary is in the format: 31 | // { NSString *reuseIdentifier : UICollectionViewCell *offscreenCell, ... } 32 | var offscreenCells = Dictionary() 33 | 34 | override func viewDidLoad() { 35 | super.viewDidLoad() 36 | 37 | // Register cells 38 | collectionView.dataSource = self 39 | collectionView.delegate = self 40 | let myCellNib = UINib(nibName: "MyCollectionViewCell", bundle: nil) 41 | collectionView.register(myCellNib, forCellWithReuseIdentifier: kCellIdentifier) 42 | 43 | for _ in 0..<3 { 44 | self.addNewOne() 45 | } 46 | } 47 | 48 | func addNewOne() { 49 | var randomNumber1 = Int(arc4random_uniform(UInt32(exampleContent.count))) 50 | var randomNumber2 = Int(arc4random_uniform(UInt32(exampleContent.count))) 51 | let range1 = NSRange(location: min(randomNumber1, randomNumber2), length: abs(randomNumber1 - randomNumber2)) 52 | var text = (exampleContent as NSString).substring(with: range1) 53 | contentData.append(text) 54 | 55 | randomNumber1 = Int(arc4random_uniform(UInt32(exampleTitle.count))) 56 | randomNumber2 = Int(arc4random_uniform(UInt32(exampleTitle.count))) 57 | let range2 = NSRange(location: min(randomNumber1, randomNumber2), length: abs(randomNumber1 - randomNumber2)) 58 | text = (exampleTitle as NSString).substring(with: range2) 59 | titleData.append(text) 60 | } 61 | 62 | override func didReceiveMemoryWarning() { 63 | super.didReceiveMemoryWarning() 64 | // Dispose of any resources that can be recreated. 65 | } 66 | 67 | // MARK: - UICollectionViewDataSource 68 | func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { 69 | return 1 70 | } 71 | 72 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 73 | return contentData.count 74 | } 75 | 76 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 77 | let cell: MyCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: kCellIdentifier, for: indexPath) as! MyCollectionViewCell 78 | 79 | cell.configCell(title: titleData[indexPath.item], content: contentData[indexPath.item], titleFont: fontArray[indexPath.item], contentFont: fontArray[indexPath.item]) 80 | 81 | // Make sure layout subviews 82 | cell.layoutIfNeeded() 83 | return cell 84 | } 85 | 86 | // MARK: - UICollectionViewFlowLayout Delegate 87 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 88 | // Set up desired width 89 | let targetWidth: CGFloat = (self.collectionView.bounds.width - 3 * kHorizontalInsets) / 2 90 | 91 | // Use fake cell to calculate height 92 | let reuseIdentifier = kCellIdentifier 93 | var cell: MyCollectionViewCell? = self.offscreenCells[reuseIdentifier] as? MyCollectionViewCell 94 | if cell == nil { 95 | if let cells = Bundle.main.loadNibNamed("MyCollectionViewCell", owner: self, options: nil), let c = cells[0] as? MyCollectionViewCell { 96 | cell = c 97 | self.offscreenCells[reuseIdentifier] = c 98 | } 99 | } 100 | 101 | // Config cell and let system determine size 102 | cell!.configCell(title: titleData[indexPath.item], content: contentData[indexPath.item], titleFont: fontArray[indexPath.item], contentFont: fontArray[indexPath.item]) 103 | 104 | // Cell's size is determined in nib file, need to set it's width (in this case), and inside, use this cell's width to set label's preferredMaxLayoutWidth, thus, height can be determined, this size will be returned for real cell initialization 105 | cell!.bounds = CGRect(x: 0, y: 0, width: targetWidth, height: cell!.bounds.height) 106 | cell!.contentView.bounds = cell!.bounds 107 | 108 | // Layout subviews, this will let labels on this cell to set preferredMaxLayoutWidth 109 | cell!.setNeedsLayout() 110 | cell!.layoutIfNeeded() 111 | 112 | var size = cell!.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) 113 | // Still need to force the width, since width can be smalled due to break mode of labels 114 | size.width = targetWidth 115 | return size 116 | } 117 | 118 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { 119 | return UIEdgeInsets(top: kVerticalInsets, left: kHorizontalInsets, bottom: kVerticalInsets, right: kHorizontalInsets) 120 | } 121 | 122 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { 123 | return kHorizontalInsets 124 | } 125 | 126 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { 127 | return kVerticalInsets 128 | } 129 | 130 | @discardableResult 131 | func shuffle( _ list: inout Array) -> Array { 132 | for i in 0.. 0 { titleData.removeLast() } 149 | if contentData.count > 0 { contentData.removeLast() } 150 | self.shuffle(&fontArray) 151 | collectionView.reloadData() 152 | collectionView.collectionViewLayout.invalidateLayout() 153 | } 154 | 155 | // MARK: - Rotation 156 | // iOS7 157 | override func willRotate(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval) { 158 | collectionView.collectionViewLayout.invalidateLayout() 159 | } 160 | 161 | // iOS8 162 | override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { 163 | collectionView.collectionViewLayout.invalidateLayout() 164 | } 165 | } 166 | 167 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-DemoTests/DynamicCollectionViewCellWithAutoLayout_DemoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicCollectionViewCellWithAutoLayout_DemoTests.swift 3 | // DynamicCollectionViewCellWithAutoLayout-DemoTests 4 | // 5 | // Created by Honghao Zhang on 2014-09-25. 6 | // Copyright (c) 2014 HonghaoZ. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class DynamicCollectionViewCellWithAutoLayout_DemoTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /DynamicCollectionViewCellWithAutoLayout-DemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Honghao Zhang 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dynamic-Collection-View-Cell-With-Auto-Layout-Demo 2 | 3 | Demo for Collection View on iOS with auto layout in UICollectionViewCell to create cells with dynamic heights 4 | 5 | Works on iOS7, iOS8 and iOS9. 6 | 7 | ## Updated 8 | 9 | Updated to Swift 2.1.1 10 | Demo can now be displayed in all iPhone screen sizes. 11 | 12 | For off screen cells, there's a new dynamic collection view which will handle it gracefully. Check it out! 13 | [ZHDynamicCollectionView](https://github.com/honghaoz/ZHDynamicCollectionView) 14 | 15 | ## Explanation 16 | 17 | Cell is created in xib file, can be also created in code. 18 | 19 | Cell is a basic cell with a title label and a content label. Title label has 1 line text and content label has multiple lines text. 20 | 21 | ### Interface builder 22 | 23 | There are totally 7 constraints for two labels: 24 | 25 | ![](https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/master/Screenshots/cell.png?token=3926785__eyJzY29wZSI6IlJhd0Jsb2I6aG9uZ2hhb3ovRHluYW1pYy1Db2xsZWN0aW9uLVZpZXctQ2VsbC1XaXRoLUF1dG8tTGF5b3V0LURlbW8vbWFzdGVyL1NjcmVlbnNob3RzL2NlbGwucG5nIiwiZXhwaXJlcyI6MTQxMjQ1NTM5NX0%3D--9553b945bbfa038d86f226060b3bdb7fcb1424d1) 26 | 27 | For the title label, there are top, leading, trailing spacing with superView. 28 | For the content label, there are bottom, leading, trailing spacing with superView. 29 | And there is a fixed vertical spacing between the bottom of the title label with the top of the content label 30 | 31 | All of these 7 constraints have 1000 priority 32 | 33 | For two labels, set their Content Hugging Priority and Content Compression Resistance Priority same as following pic: 34 | 35 | Title label 36 | ![](https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/master/Screenshots/titleCell.png?token=3926785__eyJzY29wZSI6IlJhd0Jsb2I6aG9uZ2hhb3ovRHluYW1pYy1Db2xsZWN0aW9uLVZpZXctQ2VsbC1XaXRoLUF1dG8tTGF5b3V0LURlbW8vbWFzdGVyL1NjcmVlbnNob3RzL3RpdGxlQ2VsbC5wbmciLCJleHBpcmVzIjoxNDEyNDU1NjYwfQ%3D%3D--055be4ca8a998efa8ca3a65b187817c1f6516711) 37 | 38 | Content label 39 | ![](https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/master/Screenshots/contentCell.png?token=3926785__eyJzY29wZSI6IlJhd0Jsb2I6aG9uZ2hhb3ovRHluYW1pYy1Db2xsZWN0aW9uLVZpZXctQ2VsbC1XaXRoLUF1dG8tTGF5b3V0LURlbW8vbWFzdGVyL1NjcmVlbnNob3RzL2NvbnRlbnRDZWxsLnBuZyIsImV4cGlyZXMiOjE0MTI0NTU2NzJ9--181cc53d91087c5d51527ee2f4c21acb1b965e17) 40 | 41 | ### In code 42 | 43 | #### UICollectionViewCell 44 | 45 | Subclassing this UICollectionViewCell 46 | 47 | In `awakeFromNib()`, for iOS7 remember to set 48 | 49 | ``` 50 | self.contentView.autoresizingMask = [.FlexibleHeight, .FlexibleWidth] 51 | ``` 52 | 53 | and in `layoutSubviews()` 54 | 55 | Set `contentLabel.preferredMaxLayoutWidth` to a preferred value, like `contentLabel.preferredMaxLayoutWidth = self.bounds.width - 2 * kLabelHorizontalInsets` 56 | 57 | You may also need a configure function, make sure in this function, call `self.setNeedsLayout()` and `self.layoutIfNeeded()` 58 | 59 | #### View Controller of UICollectionView 60 | 61 | In collectionView's view controller, two key delegate methods are `collectionView:layout:sizeForItemAtIndexPath:` and `cellForItemAtIndexPath:` 62 | 63 | Since `collectionView:layout:sizeForItemAtIndexPath:` is called before `cellForItemAtIndexPath:`, so we need to initialize a cell and let system use auto layout to calculate height for us. To avoid memory leak, we use a dictionary to cache the cells that are off screen (not shown on screen) 64 | 65 | The dictionary variable is `var offscreenCells = Dictionary()` 66 | 67 | In `collectionView:layout:sizeForItemAtIndexPath:`, first create or retrieve a cell 68 | 69 | ``` 70 | var cell: MyCollectionViewCell? = self.offscreenCells[reuseIdentifier] as? MyCollectionViewCell 71 | if cell == nil { 72 | cell = NSBundle.mainBundle().loadNibNamed("MyCollectionViewCell", owner: self, options: nil)[0] as? MyCollectionViewCell 73 | self.offscreenCells[reuseIdentifier] = cell 74 | } 75 | ``` 76 | Once a cell is initialized, its size is determined by size in xib file, thus, we need configure texts in cell and layoutSubviews, this will let system recalculate the size of cell 77 | 78 | ``` 79 | // Config cell and let system determine size 80 | cell!.configCell(titleData[indexPath.item], content: contentData[indexPath.item], titleFont: fontArray[indexPath.item] as String, contentFont: fontArray[indexPath.item] as String) 81 | // Cell's size is determined in nib file, need to set it's width (in this case), and inside, use this cell's width to set label's preferredMaxLayoutWidth, thus, height can be determined, this size will be returned for real cell initialization 82 | cell!.bounds = CGRectMake(0, 0, targetWidth, cell!.bounds.height) 83 | cell!.contentView.bounds = cell!.bounds 84 | 85 | // Layout subviews, this will let labels on this cell to set preferredMaxLayoutWidth 86 | cell!.setNeedsLayout() 87 | cell!.layoutIfNeeded() 88 | ``` 89 | 90 | Once cell is updated, call `var size = cell!.contentView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize)` to get the size for this cell. 91 | 92 | In `cellForItemAtIndexPath:`, cell also need configured and layout its subviews 93 | 94 | 95 | ## Screen shots 96 | ![](https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/master/iOS%20Simulator%20Screen%20Shot1.png?token=3926785__eyJzY29wZSI6IlJhd0Jsb2I6aG9uZ2hhb3ovRHluYW1pYy1Db2xsZWN0aW9uLVZpZXctQ2VsbC1XaXRoLUF1dG8tTGF5b3V0LURlbW8vbWFzdGVyL2lPUyBTaW11bGF0b3IgU2NyZWVuIFNob3QxLnBuZyIsImV4cGlyZXMiOjE0MTI0NTQ1NTR9--22eb7f8d1e6f45646ad1e043034f0603ca1329ba) 97 | 98 | 99 | ![](https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/master/iOS%20Simulator%20Screen%20Shot2.png?token=3926785__eyJzY29wZSI6IlJhd0Jsb2I6aG9uZ2hhb3ovRHluYW1pYy1Db2xsZWN0aW9uLVZpZXctQ2VsbC1XaXRoLUF1dG8tTGF5b3V0LURlbW8vbWFzdGVyL2lPUyBTaW11bGF0b3IgU2NyZWVuIFNob3QyLnBuZyIsImV4cGlyZXMiOjE0MTI0NTQ2MDl9--438f993f9a552dba2ceddb1836005d7b464d9ccf) 100 | 101 | ## The MIT License (MIT) 102 | 103 | Copyright (c) 2014 Honghao Zhang 104 | 105 | Permission is hereby granted, free of charge, to any person obtaining a copy 106 | of this software and associated documentation files (the "Software"), to deal 107 | in the Software without restriction, including without limitation the rights 108 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 109 | copies of the Software, and to permit persons to whom the Software is 110 | furnished to do so, subject to the following conditions: 111 | 112 | The above copyright notice and this permission notice shall be included in all 113 | copies or substantial portions of the Software. 114 | 115 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 116 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 117 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 118 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 119 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 120 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 121 | SOFTWARE. 122 | 123 | 124 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/honghaoz/dynamic-collection-view-cell-with-auto-layout-demo/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 125 | 126 | -------------------------------------------------------------------------------- /Screenshots/cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/Screenshots/cell.png -------------------------------------------------------------------------------- /Screenshots/contentCell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/Screenshots/contentCell.png -------------------------------------------------------------------------------- /Screenshots/contentCell2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/Screenshots/contentCell2.png -------------------------------------------------------------------------------- /Screenshots/titleCell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/Screenshots/titleCell.png -------------------------------------------------------------------------------- /iOS Simulator Screen Shot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/iOS Simulator Screen Shot1.png -------------------------------------------------------------------------------- /iOS Simulator Screen Shot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo/64603801033b636d3bbf6078d0831668de27ed53/iOS Simulator Screen Shot2.png --------------------------------------------------------------------------------