├── .DS_Store ├── .gitignore ├── README.md ├── iOS8DynamicTypeDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── iOS8DynamicTypeDemo ├── AppDelegate.swift ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── seinfeld_jerry-1.png │ │ ├── seinfeld_jerry-2.png │ │ └── seinfeld_jerry.png │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Info.plist ├── Quote.swift ├── QuoteTableViewCell.swift └── QuotesTableViewController.swift └── iOS8DynamicTypeDemoTests ├── Info.plist └── iOS8DynamicTypeDemoTests.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NatashaTheRobot/iOS8DynamicTypeDemo/5069499ae2f1517af694f1bc0881c7a2c60252ea/.DS_Store -------------------------------------------------------------------------------- /.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 | .DS_Store 20 | 21 | # CocoaPods 22 | # 23 | # We recommend against adding the Pods directory to your .gitignore. However 24 | # you should judge for yourself, the pros and cons are mentioned at: 25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 26 | # 27 | # Pods/ 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | iOS8DynamicTypeDemo 2 | =================== 3 | 4 | Simple Seinfeld Quotes app build in iOS8 and Swift, with self sizing cells and Dynamic Type 5 | 6 | Blog post: http://natashatherobot.com/ios-8-self-sizing-table-view-cells-with-dynamic-type/ 7 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FACC8F12197A864F00F057B6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACC8F11197A864F00F057B6 /* AppDelegate.swift */; }; 11 | FACC8F17197A864F00F057B6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FACC8F15197A864F00F057B6 /* Main.storyboard */; }; 12 | FACC8F19197A864F00F057B6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FACC8F18197A864F00F057B6 /* Images.xcassets */; }; 13 | FACC8F25197A864F00F057B6 /* iOS8DynamicTypeDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACC8F24197A864F00F057B6 /* iOS8DynamicTypeDemoTests.swift */; }; 14 | FACC8F2F197A873A00F057B6 /* QuotesTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACC8F2E197A873A00F057B6 /* QuotesTableViewController.swift */; }; 15 | FACC8F31197A892A00F057B6 /* Quote.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACC8F30197A892A00F057B6 /* Quote.swift */; }; 16 | FACC8F33197A8C5400F057B6 /* QuoteTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACC8F32197A8C5400F057B6 /* QuoteTableViewCell.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | FACC8F1F197A864F00F057B6 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = FACC8F04197A864F00F057B6 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = FACC8F0B197A864F00F057B6; 25 | remoteInfo = iOS8DynamicTypeDemo; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | FACC8F0C197A864F00F057B6 /* iOS8DynamicTypeDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOS8DynamicTypeDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | FACC8F10197A864F00F057B6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | FACC8F11197A864F00F057B6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33 | FACC8F16197A864F00F057B6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | FACC8F18197A864F00F057B6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 35 | FACC8F1E197A864F00F057B6 /* iOS8DynamicTypeDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iOS8DynamicTypeDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | FACC8F23197A864F00F057B6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | FACC8F24197A864F00F057B6 /* iOS8DynamicTypeDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOS8DynamicTypeDemoTests.swift; sourceTree = ""; }; 38 | FACC8F2E197A873A00F057B6 /* QuotesTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuotesTableViewController.swift; sourceTree = ""; }; 39 | FACC8F30197A892A00F057B6 /* Quote.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Quote.swift; sourceTree = ""; }; 40 | FACC8F32197A8C5400F057B6 /* QuoteTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuoteTableViewCell.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | FACC8F09197A864F00F057B6 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | FACC8F1B197A864F00F057B6 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | FACC8F03197A864F00F057B6 = { 62 | isa = PBXGroup; 63 | children = ( 64 | FACC8F0E197A864F00F057B6 /* iOS8DynamicTypeDemo */, 65 | FACC8F21197A864F00F057B6 /* iOS8DynamicTypeDemoTests */, 66 | FACC8F0D197A864F00F057B6 /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | FACC8F0D197A864F00F057B6 /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | FACC8F0C197A864F00F057B6 /* iOS8DynamicTypeDemo.app */, 74 | FACC8F1E197A864F00F057B6 /* iOS8DynamicTypeDemoTests.xctest */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | FACC8F0E197A864F00F057B6 /* iOS8DynamicTypeDemo */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | FACC8F11197A864F00F057B6 /* AppDelegate.swift */, 83 | FACC8F15197A864F00F057B6 /* Main.storyboard */, 84 | FACC8F2E197A873A00F057B6 /* QuotesTableViewController.swift */, 85 | FACC8F32197A8C5400F057B6 /* QuoteTableViewCell.swift */, 86 | FACC8F30197A892A00F057B6 /* Quote.swift */, 87 | FACC8F18197A864F00F057B6 /* Images.xcassets */, 88 | FACC8F0F197A864F00F057B6 /* Supporting Files */, 89 | ); 90 | path = iOS8DynamicTypeDemo; 91 | sourceTree = ""; 92 | }; 93 | FACC8F0F197A864F00F057B6 /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | FACC8F10197A864F00F057B6 /* Info.plist */, 97 | ); 98 | name = "Supporting Files"; 99 | sourceTree = ""; 100 | }; 101 | FACC8F21197A864F00F057B6 /* iOS8DynamicTypeDemoTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | FACC8F24197A864F00F057B6 /* iOS8DynamicTypeDemoTests.swift */, 105 | FACC8F22197A864F00F057B6 /* Supporting Files */, 106 | ); 107 | path = iOS8DynamicTypeDemoTests; 108 | sourceTree = ""; 109 | }; 110 | FACC8F22197A864F00F057B6 /* Supporting Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | FACC8F23197A864F00F057B6 /* Info.plist */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | FACC8F0B197A864F00F057B6 /* iOS8DynamicTypeDemo */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = FACC8F28197A864F00F057B6 /* Build configuration list for PBXNativeTarget "iOS8DynamicTypeDemo" */; 124 | buildPhases = ( 125 | FACC8F08197A864F00F057B6 /* Sources */, 126 | FACC8F09197A864F00F057B6 /* Frameworks */, 127 | FACC8F0A197A864F00F057B6 /* Resources */, 128 | ); 129 | buildRules = ( 130 | ); 131 | dependencies = ( 132 | ); 133 | name = iOS8DynamicTypeDemo; 134 | productName = iOS8DynamicTypeDemo; 135 | productReference = FACC8F0C197A864F00F057B6 /* iOS8DynamicTypeDemo.app */; 136 | productType = "com.apple.product-type.application"; 137 | }; 138 | FACC8F1D197A864F00F057B6 /* iOS8DynamicTypeDemoTests */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = FACC8F2B197A864F00F057B6 /* Build configuration list for PBXNativeTarget "iOS8DynamicTypeDemoTests" */; 141 | buildPhases = ( 142 | FACC8F1A197A864F00F057B6 /* Sources */, 143 | FACC8F1B197A864F00F057B6 /* Frameworks */, 144 | FACC8F1C197A864F00F057B6 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | FACC8F20197A864F00F057B6 /* PBXTargetDependency */, 150 | ); 151 | name = iOS8DynamicTypeDemoTests; 152 | productName = iOS8DynamicTypeDemoTests; 153 | productReference = FACC8F1E197A864F00F057B6 /* iOS8DynamicTypeDemoTests.xctest */; 154 | productType = "com.apple.product-type.bundle.unit-test"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | FACC8F04197A864F00F057B6 /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastUpgradeCheck = 0600; 163 | ORGANIZATIONNAME = NatashaTheRobot; 164 | TargetAttributes = { 165 | FACC8F0B197A864F00F057B6 = { 166 | CreatedOnToolsVersion = 6.0; 167 | }; 168 | FACC8F1D197A864F00F057B6 = { 169 | CreatedOnToolsVersion = 6.0; 170 | TestTargetID = FACC8F0B197A864F00F057B6; 171 | }; 172 | }; 173 | }; 174 | buildConfigurationList = FACC8F07197A864F00F057B6 /* Build configuration list for PBXProject "iOS8DynamicTypeDemo" */; 175 | compatibilityVersion = "Xcode 3.2"; 176 | developmentRegion = English; 177 | hasScannedForEncodings = 0; 178 | knownRegions = ( 179 | en, 180 | Base, 181 | ); 182 | mainGroup = FACC8F03197A864F00F057B6; 183 | productRefGroup = FACC8F0D197A864F00F057B6 /* Products */; 184 | projectDirPath = ""; 185 | projectRoot = ""; 186 | targets = ( 187 | FACC8F0B197A864F00F057B6 /* iOS8DynamicTypeDemo */, 188 | FACC8F1D197A864F00F057B6 /* iOS8DynamicTypeDemoTests */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXResourcesBuildPhase section */ 194 | FACC8F0A197A864F00F057B6 /* Resources */ = { 195 | isa = PBXResourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | FACC8F17197A864F00F057B6 /* Main.storyboard in Resources */, 199 | FACC8F19197A864F00F057B6 /* Images.xcassets in Resources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | FACC8F1C197A864F00F057B6 /* Resources */ = { 204 | isa = PBXResourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | /* End PBXResourcesBuildPhase section */ 211 | 212 | /* Begin PBXSourcesBuildPhase section */ 213 | FACC8F08197A864F00F057B6 /* Sources */ = { 214 | isa = PBXSourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | FACC8F33197A8C5400F057B6 /* QuoteTableViewCell.swift in Sources */, 218 | FACC8F2F197A873A00F057B6 /* QuotesTableViewController.swift in Sources */, 219 | FACC8F31197A892A00F057B6 /* Quote.swift in Sources */, 220 | FACC8F12197A864F00F057B6 /* AppDelegate.swift in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | FACC8F1A197A864F00F057B6 /* Sources */ = { 225 | isa = PBXSourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | FACC8F25197A864F00F057B6 /* iOS8DynamicTypeDemoTests.swift in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXTargetDependency section */ 235 | FACC8F20197A864F00F057B6 /* PBXTargetDependency */ = { 236 | isa = PBXTargetDependency; 237 | target = FACC8F0B197A864F00F057B6 /* iOS8DynamicTypeDemo */; 238 | targetProxy = FACC8F1F197A864F00F057B6 /* PBXContainerItemProxy */; 239 | }; 240 | /* End PBXTargetDependency section */ 241 | 242 | /* Begin PBXVariantGroup section */ 243 | FACC8F15197A864F00F057B6 /* Main.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | FACC8F16197A864F00F057B6 /* Base */, 247 | ); 248 | name = Main.storyboard; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | FACC8F26197A864F00F057B6 /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 259 | CLANG_CXX_LIBRARY = "libc++"; 260 | CLANG_ENABLE_MODULES = YES; 261 | CLANG_ENABLE_OBJC_ARC = YES; 262 | CLANG_WARN_BOOL_CONVERSION = YES; 263 | CLANG_WARN_CONSTANT_CONVERSION = YES; 264 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 265 | CLANG_WARN_EMPTY_BODY = YES; 266 | CLANG_WARN_ENUM_CONVERSION = YES; 267 | CLANG_WARN_INT_CONVERSION = YES; 268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 272 | COPY_PHASE_STRIP = NO; 273 | ENABLE_STRICT_OBJC_MSGSEND = YES; 274 | GCC_C_LANGUAGE_STANDARD = gnu99; 275 | GCC_DYNAMIC_NO_PIC = NO; 276 | GCC_OPTIMIZATION_LEVEL = 0; 277 | GCC_PREPROCESSOR_DEFINITIONS = ( 278 | "DEBUG=1", 279 | "$(inherited)", 280 | ); 281 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 282 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 283 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 284 | GCC_WARN_UNDECLARED_SELECTOR = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 286 | GCC_WARN_UNUSED_FUNCTION = YES; 287 | GCC_WARN_UNUSED_VARIABLE = YES; 288 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 289 | MTL_ENABLE_DEBUG_INFO = YES; 290 | ONLY_ACTIVE_ARCH = YES; 291 | SDKROOT = iphoneos; 292 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 293 | }; 294 | name = Debug; 295 | }; 296 | FACC8F27197A864F00F057B6 /* Release */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ALWAYS_SEARCH_USER_PATHS = NO; 300 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 301 | CLANG_CXX_LIBRARY = "libc++"; 302 | CLANG_ENABLE_MODULES = YES; 303 | CLANG_ENABLE_OBJC_ARC = YES; 304 | CLANG_WARN_BOOL_CONVERSION = YES; 305 | CLANG_WARN_CONSTANT_CONVERSION = YES; 306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 307 | CLANG_WARN_EMPTY_BODY = YES; 308 | CLANG_WARN_ENUM_CONVERSION = YES; 309 | CLANG_WARN_INT_CONVERSION = YES; 310 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 311 | CLANG_WARN_UNREACHABLE_CODE = YES; 312 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 313 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 314 | COPY_PHASE_STRIP = YES; 315 | ENABLE_NS_ASSERTIONS = NO; 316 | ENABLE_STRICT_OBJC_MSGSEND = YES; 317 | GCC_C_LANGUAGE_STANDARD = gnu99; 318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 320 | GCC_WARN_UNDECLARED_SELECTOR = YES; 321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 322 | GCC_WARN_UNUSED_FUNCTION = YES; 323 | GCC_WARN_UNUSED_VARIABLE = YES; 324 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 325 | MTL_ENABLE_DEBUG_INFO = NO; 326 | SDKROOT = iphoneos; 327 | VALIDATE_PRODUCT = YES; 328 | }; 329 | name = Release; 330 | }; 331 | FACC8F29197A864F00F057B6 /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | buildSettings = { 334 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 335 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 336 | INFOPLIST_FILE = iOS8DynamicTypeDemo/Info.plist; 337 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 338 | PRODUCT_NAME = "$(TARGET_NAME)"; 339 | }; 340 | name = Debug; 341 | }; 342 | FACC8F2A197A864F00F057B6 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 346 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 347 | INFOPLIST_FILE = iOS8DynamicTypeDemo/Info.plist; 348 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 349 | PRODUCT_NAME = "$(TARGET_NAME)"; 350 | }; 351 | name = Release; 352 | }; 353 | FACC8F2C197A864F00F057B6 /* Debug */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/iOS8DynamicTypeDemo.app/iOS8DynamicTypeDemo"; 357 | FRAMEWORK_SEARCH_PATHS = ( 358 | "$(SDKROOT)/Developer/Library/Frameworks", 359 | "$(inherited)", 360 | ); 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | INFOPLIST_FILE = iOS8DynamicTypeDemoTests/Info.plist; 366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | TEST_HOST = "$(BUNDLE_LOADER)"; 369 | }; 370 | name = Debug; 371 | }; 372 | FACC8F2D197A864F00F057B6 /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/iOS8DynamicTypeDemo.app/iOS8DynamicTypeDemo"; 376 | FRAMEWORK_SEARCH_PATHS = ( 377 | "$(SDKROOT)/Developer/Library/Frameworks", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = iOS8DynamicTypeDemoTests/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | TEST_HOST = "$(BUNDLE_LOADER)"; 384 | }; 385 | name = Release; 386 | }; 387 | /* End XCBuildConfiguration section */ 388 | 389 | /* Begin XCConfigurationList section */ 390 | FACC8F07197A864F00F057B6 /* Build configuration list for PBXProject "iOS8DynamicTypeDemo" */ = { 391 | isa = XCConfigurationList; 392 | buildConfigurations = ( 393 | FACC8F26197A864F00F057B6 /* Debug */, 394 | FACC8F27197A864F00F057B6 /* Release */, 395 | ); 396 | defaultConfigurationIsVisible = 0; 397 | defaultConfigurationName = Release; 398 | }; 399 | FACC8F28197A864F00F057B6 /* Build configuration list for PBXNativeTarget "iOS8DynamicTypeDemo" */ = { 400 | isa = XCConfigurationList; 401 | buildConfigurations = ( 402 | FACC8F29197A864F00F057B6 /* Debug */, 403 | FACC8F2A197A864F00F057B6 /* Release */, 404 | ); 405 | defaultConfigurationIsVisible = 0; 406 | defaultConfigurationName = Release; 407 | }; 408 | FACC8F2B197A864F00F057B6 /* Build configuration list for PBXNativeTarget "iOS8DynamicTypeDemoTests" */ = { 409 | isa = XCConfigurationList; 410 | buildConfigurations = ( 411 | FACC8F2C197A864F00F057B6 /* Debug */, 412 | FACC8F2D197A864F00F057B6 /* Release */, 413 | ); 414 | defaultConfigurationIsVisible = 0; 415 | defaultConfigurationName = Release; 416 | }; 417 | /* End XCConfigurationList section */ 418 | }; 419 | rootObject = FACC8F04197A864F00F057B6 /* Project object */; 420 | } 421 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // iOS8DynamicTypeDemo 4 | // 5 | // Created by Natasha Murashev on 7/19/14. 6 | // Copyright (c) 2014 NatashaTheRobot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication!) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication!) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication!) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication!) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication!) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/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 | 28 | 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 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "seinfeld_jerry-2.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "40x40", 11 | "idiom" : "iphone", 12 | "filename" : "seinfeld_jerry-1.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "60x60", 17 | "idiom" : "iphone", 18 | "filename" : "seinfeld_jerry.png", 19 | "scale" : "2x" 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/Images.xcassets/AppIcon.appiconset/seinfeld_jerry-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NatashaTheRobot/iOS8DynamicTypeDemo/5069499ae2f1517af694f1bc0881c7a2c60252ea/iOS8DynamicTypeDemo/Images.xcassets/AppIcon.appiconset/seinfeld_jerry-1.png -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/Images.xcassets/AppIcon.appiconset/seinfeld_jerry-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NatashaTheRobot/iOS8DynamicTypeDemo/5069499ae2f1517af694f1bc0881c7a2c60252ea/iOS8DynamicTypeDemo/Images.xcassets/AppIcon.appiconset/seinfeld_jerry-2.png -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/Images.xcassets/AppIcon.appiconset/seinfeld_jerry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NatashaTheRobot/iOS8DynamicTypeDemo/5069499ae2f1517af694f1bc0881c7a2c60252ea/iOS8DynamicTypeDemo/Images.xcassets/AppIcon.appiconset/seinfeld_jerry.png -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.natashatherobot.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | Quotes 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/Quote.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Quote.swift 3 | // iOS8DynamicTypeDemo 4 | // 5 | // Created by Natasha Murashev on 7/19/14. 6 | // Copyright (c) 2014 NatashaTheRobot. All rights reserved. 7 | // 8 | 9 | class Quote { 10 | 11 | let content: String 12 | let scenario: String 13 | 14 | class func allQuotes() -> [Quote] { 15 | let quotes = [ 16 | Quote(content: "Sometimes the road less traveled is less traveled for a reason.", scenario: "Jerry in The Baby Shower"), 17 | Quote(content: "I can't go to a bad movie by myself. What, am I gonna make sarcastic remarks to strangers?", scenario: "Jerry in The Chinese Restaurant"), 18 | Quote(content: "You know the message you're sending out to the world with these sweatpants? You're telling the world, 'I give up. I can't compete in normal society. I'm miserable, so I might as well be comfortable.", scenario: "Jerry in The Pilot"), 19 | Quote(content: "Man, it's the nineties... It's Hammer time!", scenario: "Kramer in The Parking Space"), 20 | Quote(content: "Why is nice bad? What kind of a sick society are we living in when nice is bad?", scenario: "George in The Cafe"), 21 | Quote(content: "When you look annoyed all the time, people think that you're busy.", scenario: "George in The Hot Tub"), 22 | Quote(content: "I would drape myself in velvet if it were socially acceptable.", scenario: "George in The Label Maker"), 23 | Quote(content: "You know what they say, 'You don't sell the steak, you sell the sizzle.'", scenario: "Kramer in The Bizzaro Jerry"), 24 | Quote(content: "直往前走!左/右拐弯到直往前走左/右拐弯到直往前走!左/右拐弯到!直往前走!左/右拐弯到", scenario: "Jerry learning Chinese") 25 | ] 26 | return quotes 27 | } 28 | 29 | init(content: String, scenario: String) { 30 | self.content = content 31 | self.scenario = scenario 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/QuoteTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QuoteTableViewCell.swift 3 | // iOS8DynamicTypeDemo 4 | // 5 | // Created by Natasha Murashev on 7/19/14. 6 | // Copyright (c) 2014 NatashaTheRobot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class QuoteTableViewCell: UITableViewCell { 12 | 13 | @IBOutlet weak var quoteContentLabel: UILabel! 14 | @IBOutlet weak var scenarioLabel: UILabel! 15 | 16 | override func awakeFromNib() { 17 | super.awakeFromNib() 18 | 19 | } 20 | 21 | func configure(#quote: Quote) { 22 | 23 | quoteContentLabel.font = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline) 24 | 25 | quoteContentLabel.text = quote.content 26 | quoteContentLabel.accessibilityLabel = "Quote Content" 27 | quoteContentLabel.accessibilityValue = quote.content 28 | 29 | scenarioLabel.text = "- \(quote.scenario)" 30 | scenarioLabel.accessibilityLabel = "Quote Scenario" 31 | scenarioLabel.accessibilityValue = quote.scenario 32 | 33 | 34 | quoteContentLabel.font = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline) 35 | 36 | quoteContentLabel.font = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline) 37 | scenarioLabel.font = UIFont.preferredFontForTextStyle(UIFontTextStyleSubheadline) 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemo/QuotesTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QuotesTableViewController.swift 3 | // iOS8DynamicTypeDemo 4 | // 5 | // Created by Natasha Murashev on 7/19/14. 6 | // Copyright (c) 2014 NatashaTheRobot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class QuotesTableViewController: UITableViewController { 12 | 13 | let quotes = Quote.allQuotes() 14 | let quoteCellIdentifier = "QuoteTableViewCell" 15 | 16 | required init(coder aDecoder: NSCoder) { 17 | super.init(coder: aDecoder) 18 | 19 | NSNotificationCenter.defaultCenter().addObserver(self, 20 | selector: "onContentSizeChange:", 21 | name: UIContentSizeCategoryDidChangeNotification, object:nil) 22 | } 23 | 24 | override func viewDidLoad() { 25 | 26 | super.viewDidLoad() 27 | 28 | tableView.estimatedRowHeight = 89 29 | tableView.rowHeight = UITableViewAutomaticDimension 30 | 31 | } 32 | 33 | override func viewDidDisappear(animated: Bool) { 34 | super.viewDidDisappear(animated) 35 | 36 | NSNotificationCenter.defaultCenter().removeObserver(self) 37 | } 38 | 39 | func onContentSizeChange(notification: NSNotification) { 40 | tableView.reloadData() 41 | } 42 | 43 | // MARK: - Table view data source 44 | 45 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 46 | return quotes.count 47 | } 48 | 49 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 50 | let cell = tableView.dequeueReusableCellWithIdentifier(quoteCellIdentifier) as QuoteTableViewCell 51 | 52 | cell.configure(quote: quotes[indexPath.row]) 53 | 54 | return cell 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.natashatherobot.${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 | -------------------------------------------------------------------------------- /iOS8DynamicTypeDemoTests/iOS8DynamicTypeDemoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iOS8DynamicTypeDemoTests.swift 3 | // iOS8DynamicTypeDemoTests 4 | // 5 | // Created by Natasha Murashev on 7/19/14. 6 | // Copyright (c) 2014 NatashaTheRobot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class iOS8DynamicTypeDemoTests: 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 | --------------------------------------------------------------------------------