├── .DS_Store ├── AutoLayoutBasics.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── rick.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── rick.xcuserdatad │ └── xcschemes │ ├── AutoLayoutBasics.xcscheme │ └── xcschememanagement.plist ├── AutoLayoutBasics ├── .DS_Store ├── AppDelegate.swift ├── Base.lproj │ ├── .DS_Store │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Info.plist └── ViewController.swift ├── AutoLayoutBasicsTests ├── AutoLayoutBasicsTests.swift └── Info.plist ├── LICENSE └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/voyage11/AutoLayoutBasics/cdd81b87ce341be099ac8580eb1cb82512e1e70a/.DS_Store -------------------------------------------------------------------------------- /AutoLayoutBasics.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DCA0D4A19A9BC4B00998324 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DCA0D4919A9BC4B00998324 /* AppDelegate.swift */; }; 11 | 1DCA0D4C19A9BC4B00998324 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DCA0D4B19A9BC4B00998324 /* ViewController.swift */; }; 12 | 1DCA0D4F19A9BC4B00998324 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1DCA0D4D19A9BC4B00998324 /* Main.storyboard */; }; 13 | 1DCA0D5119A9BC4B00998324 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1DCA0D5019A9BC4B00998324 /* Images.xcassets */; }; 14 | 1DCA0D5D19A9BC4B00998324 /* AutoLayoutBasicsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DCA0D5C19A9BC4B00998324 /* AutoLayoutBasicsTests.swift */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | 1DCA0D5719A9BC4B00998324 /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = 1DCA0D3C19A9BC4B00998324 /* Project object */; 21 | proxyType = 1; 22 | remoteGlobalIDString = 1DCA0D4319A9BC4B00998324; 23 | remoteInfo = AutoLayoutBasics; 24 | }; 25 | /* End PBXContainerItemProxy section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 1DCA0D4419A9BC4B00998324 /* AutoLayoutBasics.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AutoLayoutBasics.app; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 1DCA0D4819A9BC4B00998324 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 1DCA0D4919A9BC4B00998324 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 31 | 1DCA0D4B19A9BC4B00998324 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 32 | 1DCA0D4E19A9BC4B00998324 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 33 | 1DCA0D5019A9BC4B00998324 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 34 | 1DCA0D5619A9BC4B00998324 /* AutoLayoutBasicsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AutoLayoutBasicsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 1DCA0D5B19A9BC4B00998324 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 1DCA0D5C19A9BC4B00998324 /* AutoLayoutBasicsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoLayoutBasicsTests.swift; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 1DCA0D4119A9BC4B00998324 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | 1DCA0D5319A9BC4B00998324 /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXFrameworksBuildPhase section */ 55 | 56 | /* Begin PBXGroup section */ 57 | 1DCA0D3B19A9BC4B00998324 = { 58 | isa = PBXGroup; 59 | children = ( 60 | 1DCA0D4619A9BC4B00998324 /* AutoLayoutBasics */, 61 | 1DCA0D5919A9BC4B00998324 /* AutoLayoutBasicsTests */, 62 | 1DCA0D4519A9BC4B00998324 /* Products */, 63 | ); 64 | sourceTree = ""; 65 | }; 66 | 1DCA0D4519A9BC4B00998324 /* Products */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 1DCA0D4419A9BC4B00998324 /* AutoLayoutBasics.app */, 70 | 1DCA0D5619A9BC4B00998324 /* AutoLayoutBasicsTests.xctest */, 71 | ); 72 | name = Products; 73 | sourceTree = ""; 74 | }; 75 | 1DCA0D4619A9BC4B00998324 /* AutoLayoutBasics */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 1DCA0D4919A9BC4B00998324 /* AppDelegate.swift */, 79 | 1DCA0D4B19A9BC4B00998324 /* ViewController.swift */, 80 | 1DCA0D4D19A9BC4B00998324 /* Main.storyboard */, 81 | 1DCA0D5019A9BC4B00998324 /* Images.xcassets */, 82 | 1DCA0D4719A9BC4B00998324 /* Supporting Files */, 83 | ); 84 | path = AutoLayoutBasics; 85 | sourceTree = ""; 86 | }; 87 | 1DCA0D4719A9BC4B00998324 /* Supporting Files */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 1DCA0D4819A9BC4B00998324 /* Info.plist */, 91 | ); 92 | name = "Supporting Files"; 93 | sourceTree = ""; 94 | }; 95 | 1DCA0D5919A9BC4B00998324 /* AutoLayoutBasicsTests */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 1DCA0D5C19A9BC4B00998324 /* AutoLayoutBasicsTests.swift */, 99 | 1DCA0D5A19A9BC4B00998324 /* Supporting Files */, 100 | ); 101 | path = AutoLayoutBasicsTests; 102 | sourceTree = ""; 103 | }; 104 | 1DCA0D5A19A9BC4B00998324 /* Supporting Files */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 1DCA0D5B19A9BC4B00998324 /* Info.plist */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | /* End PBXGroup section */ 113 | 114 | /* Begin PBXNativeTarget section */ 115 | 1DCA0D4319A9BC4B00998324 /* AutoLayoutBasics */ = { 116 | isa = PBXNativeTarget; 117 | buildConfigurationList = 1DCA0D6019A9BC4B00998324 /* Build configuration list for PBXNativeTarget "AutoLayoutBasics" */; 118 | buildPhases = ( 119 | 1DCA0D4019A9BC4B00998324 /* Sources */, 120 | 1DCA0D4119A9BC4B00998324 /* Frameworks */, 121 | 1DCA0D4219A9BC4B00998324 /* Resources */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = AutoLayoutBasics; 128 | productName = AutoLayoutBasics; 129 | productReference = 1DCA0D4419A9BC4B00998324 /* AutoLayoutBasics.app */; 130 | productType = "com.apple.product-type.application"; 131 | }; 132 | 1DCA0D5519A9BC4B00998324 /* AutoLayoutBasicsTests */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = 1DCA0D6319A9BC4B00998324 /* Build configuration list for PBXNativeTarget "AutoLayoutBasicsTests" */; 135 | buildPhases = ( 136 | 1DCA0D5219A9BC4B00998324 /* Sources */, 137 | 1DCA0D5319A9BC4B00998324 /* Frameworks */, 138 | 1DCA0D5419A9BC4B00998324 /* Resources */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | 1DCA0D5819A9BC4B00998324 /* PBXTargetDependency */, 144 | ); 145 | name = AutoLayoutBasicsTests; 146 | productName = AutoLayoutBasicsTests; 147 | productReference = 1DCA0D5619A9BC4B00998324 /* AutoLayoutBasicsTests.xctest */; 148 | productType = "com.apple.product-type.bundle.unit-test"; 149 | }; 150 | /* End PBXNativeTarget section */ 151 | 152 | /* Begin PBXProject section */ 153 | 1DCA0D3C19A9BC4B00998324 /* Project object */ = { 154 | isa = PBXProject; 155 | attributes = { 156 | LastUpgradeCheck = 0600; 157 | ORGANIZATIONNAME = Rick; 158 | TargetAttributes = { 159 | 1DCA0D4319A9BC4B00998324 = { 160 | CreatedOnToolsVersion = 6.0; 161 | }; 162 | 1DCA0D5519A9BC4B00998324 = { 163 | CreatedOnToolsVersion = 6.0; 164 | TestTargetID = 1DCA0D4319A9BC4B00998324; 165 | }; 166 | }; 167 | }; 168 | buildConfigurationList = 1DCA0D3F19A9BC4B00998324 /* Build configuration list for PBXProject "AutoLayoutBasics" */; 169 | compatibilityVersion = "Xcode 3.2"; 170 | developmentRegion = English; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | Base, 175 | ); 176 | mainGroup = 1DCA0D3B19A9BC4B00998324; 177 | productRefGroup = 1DCA0D4519A9BC4B00998324 /* Products */; 178 | projectDirPath = ""; 179 | projectRoot = ""; 180 | targets = ( 181 | 1DCA0D4319A9BC4B00998324 /* AutoLayoutBasics */, 182 | 1DCA0D5519A9BC4B00998324 /* AutoLayoutBasicsTests */, 183 | ); 184 | }; 185 | /* End PBXProject section */ 186 | 187 | /* Begin PBXResourcesBuildPhase section */ 188 | 1DCA0D4219A9BC4B00998324 /* Resources */ = { 189 | isa = PBXResourcesBuildPhase; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | 1DCA0D4F19A9BC4B00998324 /* Main.storyboard in Resources */, 193 | 1DCA0D5119A9BC4B00998324 /* Images.xcassets in Resources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | 1DCA0D5419A9BC4B00998324 /* Resources */ = { 198 | isa = PBXResourcesBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | /* End PBXResourcesBuildPhase section */ 205 | 206 | /* Begin PBXSourcesBuildPhase section */ 207 | 1DCA0D4019A9BC4B00998324 /* Sources */ = { 208 | isa = PBXSourcesBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | 1DCA0D4C19A9BC4B00998324 /* ViewController.swift in Sources */, 212 | 1DCA0D4A19A9BC4B00998324 /* AppDelegate.swift in Sources */, 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | }; 216 | 1DCA0D5219A9BC4B00998324 /* Sources */ = { 217 | isa = PBXSourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | 1DCA0D5D19A9BC4B00998324 /* AutoLayoutBasicsTests.swift in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXSourcesBuildPhase section */ 225 | 226 | /* Begin PBXTargetDependency section */ 227 | 1DCA0D5819A9BC4B00998324 /* PBXTargetDependency */ = { 228 | isa = PBXTargetDependency; 229 | target = 1DCA0D4319A9BC4B00998324 /* AutoLayoutBasics */; 230 | targetProxy = 1DCA0D5719A9BC4B00998324 /* PBXContainerItemProxy */; 231 | }; 232 | /* End PBXTargetDependency section */ 233 | 234 | /* Begin PBXVariantGroup section */ 235 | 1DCA0D4D19A9BC4B00998324 /* Main.storyboard */ = { 236 | isa = PBXVariantGroup; 237 | children = ( 238 | 1DCA0D4E19A9BC4B00998324 /* Base */, 239 | ); 240 | name = Main.storyboard; 241 | sourceTree = ""; 242 | }; 243 | /* End PBXVariantGroup section */ 244 | 245 | /* Begin XCBuildConfiguration section */ 246 | 1DCA0D5E19A9BC4B00998324 /* Debug */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_WARN_BOOL_CONVERSION = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 257 | CLANG_WARN_EMPTY_BODY = YES; 258 | CLANG_WARN_ENUM_CONVERSION = YES; 259 | CLANG_WARN_INT_CONVERSION = YES; 260 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 261 | CLANG_WARN_UNREACHABLE_CODE = YES; 262 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 263 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 264 | COPY_PHASE_STRIP = NO; 265 | ENABLE_STRICT_OBJC_MSGSEND = YES; 266 | GCC_C_LANGUAGE_STANDARD = gnu99; 267 | GCC_DYNAMIC_NO_PIC = NO; 268 | GCC_OPTIMIZATION_LEVEL = 0; 269 | GCC_PREPROCESSOR_DEFINITIONS = ( 270 | "DEBUG=1", 271 | "$(inherited)", 272 | ); 273 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 274 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 276 | GCC_WARN_UNDECLARED_SELECTOR = YES; 277 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 278 | GCC_WARN_UNUSED_FUNCTION = YES; 279 | GCC_WARN_UNUSED_VARIABLE = YES; 280 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 281 | MTL_ENABLE_DEBUG_INFO = YES; 282 | ONLY_ACTIVE_ARCH = YES; 283 | SDKROOT = iphoneos; 284 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 285 | }; 286 | name = Debug; 287 | }; 288 | 1DCA0D5F19A9BC4B00998324 /* Release */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 293 | CLANG_CXX_LIBRARY = "libc++"; 294 | CLANG_ENABLE_MODULES = YES; 295 | CLANG_ENABLE_OBJC_ARC = YES; 296 | CLANG_WARN_BOOL_CONVERSION = YES; 297 | CLANG_WARN_CONSTANT_CONVERSION = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 306 | COPY_PHASE_STRIP = YES; 307 | ENABLE_NS_ASSERTIONS = NO; 308 | ENABLE_STRICT_OBJC_MSGSEND = YES; 309 | GCC_C_LANGUAGE_STANDARD = gnu99; 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 317 | MTL_ENABLE_DEBUG_INFO = NO; 318 | SDKROOT = iphoneos; 319 | VALIDATE_PRODUCT = YES; 320 | }; 321 | name = Release; 322 | }; 323 | 1DCA0D6119A9BC4B00998324 /* Debug */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 327 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 328 | INFOPLIST_FILE = AutoLayoutBasics/Info.plist; 329 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 330 | PRODUCT_NAME = "$(TARGET_NAME)"; 331 | }; 332 | name = Debug; 333 | }; 334 | 1DCA0D6219A9BC4B00998324 /* Release */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 338 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 339 | INFOPLIST_FILE = AutoLayoutBasics/Info.plist; 340 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 341 | PRODUCT_NAME = "$(TARGET_NAME)"; 342 | }; 343 | name = Release; 344 | }; 345 | 1DCA0D6419A9BC4B00998324 /* Debug */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | BUNDLE_LOADER = "$(TEST_HOST)"; 349 | FRAMEWORK_SEARCH_PATHS = ( 350 | "$(SDKROOT)/Developer/Library/Frameworks", 351 | "$(inherited)", 352 | ); 353 | GCC_PREPROCESSOR_DEFINITIONS = ( 354 | "DEBUG=1", 355 | "$(inherited)", 356 | ); 357 | INFOPLIST_FILE = AutoLayoutBasicsTests/Info.plist; 358 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 359 | PRODUCT_NAME = "$(TARGET_NAME)"; 360 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AutoLayoutBasics.app/AutoLayoutBasics"; 361 | }; 362 | name = Debug; 363 | }; 364 | 1DCA0D6519A9BC4B00998324 /* Release */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | BUNDLE_LOADER = "$(TEST_HOST)"; 368 | FRAMEWORK_SEARCH_PATHS = ( 369 | "$(SDKROOT)/Developer/Library/Frameworks", 370 | "$(inherited)", 371 | ); 372 | INFOPLIST_FILE = AutoLayoutBasicsTests/Info.plist; 373 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 374 | PRODUCT_NAME = "$(TARGET_NAME)"; 375 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AutoLayoutBasics.app/AutoLayoutBasics"; 376 | }; 377 | name = Release; 378 | }; 379 | /* End XCBuildConfiguration section */ 380 | 381 | /* Begin XCConfigurationList section */ 382 | 1DCA0D3F19A9BC4B00998324 /* Build configuration list for PBXProject "AutoLayoutBasics" */ = { 383 | isa = XCConfigurationList; 384 | buildConfigurations = ( 385 | 1DCA0D5E19A9BC4B00998324 /* Debug */, 386 | 1DCA0D5F19A9BC4B00998324 /* Release */, 387 | ); 388 | defaultConfigurationIsVisible = 0; 389 | defaultConfigurationName = Release; 390 | }; 391 | 1DCA0D6019A9BC4B00998324 /* Build configuration list for PBXNativeTarget "AutoLayoutBasics" */ = { 392 | isa = XCConfigurationList; 393 | buildConfigurations = ( 394 | 1DCA0D6119A9BC4B00998324 /* Debug */, 395 | 1DCA0D6219A9BC4B00998324 /* Release */, 396 | ); 397 | defaultConfigurationIsVisible = 0; 398 | }; 399 | 1DCA0D6319A9BC4B00998324 /* Build configuration list for PBXNativeTarget "AutoLayoutBasicsTests" */ = { 400 | isa = XCConfigurationList; 401 | buildConfigurations = ( 402 | 1DCA0D6419A9BC4B00998324 /* Debug */, 403 | 1DCA0D6519A9BC4B00998324 /* Release */, 404 | ); 405 | defaultConfigurationIsVisible = 0; 406 | }; 407 | /* End XCConfigurationList section */ 408 | }; 409 | rootObject = 1DCA0D3C19A9BC4B00998324 /* Project object */; 410 | } 411 | -------------------------------------------------------------------------------- /AutoLayoutBasics.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AutoLayoutBasics.xcodeproj/project.xcworkspace/xcuserdata/rick.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/voyage11/AutoLayoutBasics/cdd81b87ce341be099ac8580eb1cb82512e1e70a/AutoLayoutBasics.xcodeproj/project.xcworkspace/xcuserdata/rick.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AutoLayoutBasics.xcodeproj/xcuserdata/rick.xcuserdatad/xcschemes/AutoLayoutBasics.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 | -------------------------------------------------------------------------------- /AutoLayoutBasics.xcodeproj/xcuserdata/rick.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AutoLayoutBasics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1DCA0D4319A9BC4B00998324 16 | 17 | primary 18 | 19 | 20 | 1DCA0D5519A9BC4B00998324 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AutoLayoutBasics/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/voyage11/AutoLayoutBasics/cdd81b87ce341be099ac8580eb1cb82512e1e70a/AutoLayoutBasics/.DS_Store -------------------------------------------------------------------------------- /AutoLayoutBasics/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AutoLayoutBasics 4 | // 5 | // Created by Rick-Server on 8/24/14. 6 | // Copyright (c) 2014 Rick. 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 | -------------------------------------------------------------------------------- /AutoLayoutBasics/Base.lproj/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/voyage11/AutoLayoutBasics/cdd81b87ce341be099ac8580eb1cb82512e1e70a/AutoLayoutBasics/Base.lproj/.DS_Store -------------------------------------------------------------------------------- /AutoLayoutBasics/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 1. Always at the Center of the SuperView 38 | - The Object has fixed Height and Weight 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 | 1. Always at the Center of the SuperView 76 | - The Object has fixed Width but with flexible Height 77 | 78 | 79 | 80 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 1. Always at the Center of the SuperView 138 | - The Object has fixed Height but with flexible Width 139 | - You only see the difference when the width is over 600 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 2. Always stick to the Top Layout Guide 190 | - The Object has fixed Height and Weight 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 2. Always stick to the Top Layout Guide 239 | - The Object has fixed Width but with flexible Height 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 2. Always stick to the Top Layout Guide 289 | - The Object has fixed Height but with flexible Width 290 | - You only see the difference when the width is over 600 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 3. Always stick to the Bottom Layout Guide 330 | - The Object has fixed Height and Weight 331 | 332 | 333 | 334 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 3. Always stick to the Bottom Layout Guide 379 | - The Object has fixed Width but with flexible Height 380 | 381 | 382 | 383 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 3. Always stick to the Bottom Layout Guide 429 | - The Object has fixed Height but with flexible Width 430 | - You only see the difference when the width is over 600 431 | 432 | 433 | 434 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 4. Always stick to the Left side of the SuperView 492 | - The Object has fixed Height and Weight 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 4. Always stick to the Left side of the SuperView 541 | - The Object has fixed Width but with flexible Height 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 4. Always stick to the Left side of the SuperView 592 | - The Object has fixed Height but with flexible Width 593 | - You only see the difference when the width is over 600 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 5. Always stick to the Right side of the SuperView 632 | - The Object has fixed Height and Weight 633 | 634 | 635 | 636 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 5. Always stick to the Right side of the SuperView 681 | - The Object has fixed Width but with flexible Height 682 | 683 | 684 | 685 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 5. Always stick to the Right side of the SuperView 732 | - The Object has fixed Height but with flexible Width 733 | - You only see the difference when the width is over 600 734 | 735 | 736 | 737 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | -------------------------------------------------------------------------------- /AutoLayoutBasics/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AutoLayoutBasics/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 | } -------------------------------------------------------------------------------- /AutoLayoutBasics/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | AutoLayoutBasics.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /AutoLayoutBasics/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AutoLayoutBasics 4 | // 5 | // Created by Rick-Server on 8/24/14. 6 | // Copyright (c) 2014 Rick. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /AutoLayoutBasicsTests/AutoLayoutBasicsTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoLayoutBasicsTests.swift 3 | // AutoLayoutBasicsTests 4 | // 5 | // Created by Rick-Server on 8/24/14. 6 | // Copyright (c) 2014 Rick. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class AutoLayoutBasicsTests: 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 | -------------------------------------------------------------------------------- /AutoLayoutBasicsTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | AutoLayoutBasics.$(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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ricky Chea 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 | The Basic 15 Auto Layout Position Guides on XCode 6 2 | ============== 3 | 4 | Before iPhone 6, basically we only have 2 screen sizes: 3.5 inches vs 4.0 inches. There 5 | are rumours that the are 2 sizes for iPhone 6: 4.7 inches and 5.5 inches. So starting from 6 | iOS 8 which will be released on late 2014, we might have 4 different screen sizes for 7 | iPhone. 8 | 9 | With the 2 new screen resolution sizes, to be able to develop iOS apps using Auto Layout 10 | on storyboard is more important than ever. All the iOS developers will have to learn it 11 | sooner or later. 12 | 13 | This Auto Layout project is a guide for iOS developers who are trying to learn Auto Layout. 14 | The project contains the most basic positions that one single object can be positioned 15 | inside a view controller. 16 | 17 | An object can have 3 different sizes:- 18 | - The Object has fixed Height and Weight 19 | - The Object has fixed Width but with flexible Height 20 | - The Object has fixed Height but with flexible Width 21 | 22 | The only potential object with flexible Width and flexible Height could be scrollview. 23 | To attach the scrollview using constraints is normally more straight forward compare with 24 | other objects. 25 | 26 | The object can be located in 5 different positions:- 27 | - Always at the Center of the SuperView 28 | - Always stick to the Top Layout Guide 29 | - Always stick to the Bottom Layout Guide 30 | - Always stick to the Left side of the SuperView 31 | - Always stick to the Right side of the SuperView 32 | 33 | So by doing the math, we will have an object with 3 potential sizes in 5 potential 34 | positions, so, we will have a total of 3 x 5 = 15 different potential auto layout guides 35 | for one single object in a single view. 36 | 37 | For more detail information about Auto Layout on XCode 6, please visit: [How to Use Auto Layout in XCode 6 for iOS 7 and 8 Development](https://mobileoop.com/how-to-use-auto-layout-in-xcode-6-for-ios-7-and-8-development "How to Use Auto Layout in XCode 6 for iOS 7 and 8 Development"). 38 | 39 | 40 | Personal Note 41 | ============== 42 | Currently, I am working as a [Senior iOS Developer in Singapore](https://mobileoop.com/ "Senior iOS Developer in Singapore"). I might not be free to keep this solution updated. Please check the changes on the latest iOS to make sure that the solutions works well. Thanks. 43 | 44 | 45 | Thanks. 46 | 47 | Ricky 48 | --------------------------------------------------------------------------------