Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

First Commit.

  • Loading branch information...
Justin Williams
Justin Williams committed Sep 15, 2015
0 parents commit d7212a2c618819f1e9e90661bfafbd0bb444767b
Showing with 8,998 additions and 0 deletions.
  1. +69 −0 Chapter 01 - Introduction/Chapter 01.md
  2. +227 −0 Chapter 02 - Introducing Auto Layout/Chapter 02.md
  3. +203 −0 Chapter 03 - Key Terminology/Chapter 03.md
  4. +83 −0 Chapter 04 - The Auto Layout Process/Chapter 04.md
  5. +372 −0 Chapter 05 - Our First Auto Layout Example (Finally)/Chapter 05.md
  6. +112 −0 Chapter 06 - More On Size Classes & The Size Inspector/Chapter 06.md
  7. +441 −0 Chapter 07 - Using Auto Layout In Code/Chapter 07.md
  8. +260 −0 Chapter 08 - Layout Guides and Margins/Chapter 08.md
  9. +239 −0 Chapter 09 - Animation and Auto Layout/Chapter 09 - Animation and Auto Layout.md
  10. +408 −0 Chapter 10 - Debugging Constraints/Chapter 10 - Debugging Constraints.md
  11. BIN Cover/Cover-Art.jpg
  12. BIN Cover/Cover-Art.pdf
  13. BIN Diagrams/Diagrams.graffle
  14. BIN Images/ch02-ss01.png
  15. BIN Images/ch02-ss02.png
  16. BIN Images/ch02-ss03.png
  17. BIN Images/ch02-ss04.png
  18. BIN Images/ch02-ss05.png
  19. BIN Images/ch03-ss01.png
  20. BIN Images/ch03-ss02.png
  21. BIN Images/ch05-ss01.png
  22. BIN Images/ch05-ss02.png
  23. BIN Images/ch05-ss03.png
  24. BIN Images/ch05-ss04.png
  25. BIN Images/ch05-ss05.jpg
  26. BIN Images/ch05-ss06.png
  27. BIN Images/ch05-ss08.png
  28. BIN Images/ch05-ss09.png
  29. BIN Images/ch05-ss10.png
  30. BIN Images/ch05-ss11.png
  31. BIN Images/ch06-ss01.png
  32. BIN Images/ch06-ss02.png
  33. BIN Images/ch06-ss03.png
  34. BIN Images/ch06-ss04.png
  35. BIN Images/ch06-ss05.png
  36. BIN Images/ch06-ss06.png
  37. BIN Images/ch07-ss01.png
  38. BIN Images/ch07-ss02.png
  39. BIN Images/ch07-ss03.png
  40. BIN Images/ch07-ss04.png
  41. BIN Images/ch07-ss05.png
  42. BIN Images/ch08-ss01.png
  43. BIN Images/ch08-ss02.png
  44. BIN Images/ch08-ss03.png
  45. BIN Images/ch08-ss04.png
  46. BIN Images/ch08-ss05.png
  47. BIN Images/ch08-ss06.png
  48. BIN Images/ch09-ss01.png
  49. BIN Images/ch09-ss02.png
  50. BIN Images/ch10-ss01.png
  51. BIN Images/ch10-ss02.png
  52. BIN Images/ch10-ss03.png
  53. BIN Images/ch10-ss04.png
  54. +12 −0 README.md
  55. +13 −0 ...pter 02 - Introducing Auto Layout/Dynamic Layout Example/Dynamic Layout Example/AppDelegate.swift
  56. +38 −0 ...ut/Dynamic Layout Example/Dynamic Layout Example/Assets.xcassets/AppIcon.appiconset/Contents.json
  57. +27 −0 ...cing Auto Layout/Dynamic Layout Example/Dynamic Layout Example/Base.lproj/LaunchScreen.storyboard
  58. +25 −0 ... Introducing Auto Layout/Dynamic Layout Example/Dynamic Layout Example/Base.lproj/Main.storyboard
  59. +40 −0 ...ode/Chapter 02 - Introducing Auto Layout/Dynamic Layout Example/Dynamic Layout Example/Info.plist
  60. +56 −0 ...r 02 - Introducing Auto Layout/Dynamic Layout Example/Dynamic Layout Example/ViewController.swift
  61. +290 −0 ...2 - Introducing Auto Layout/Static Layout Example/Static Layout Example.xcodeproj/project.pbxproj
  62. +7 −0 ...tatic Layout Example/Static Layout Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  63. +13 −0 ...hapter 02 - Introducing Auto Layout/Static Layout Example/Static Layout Example/AppDelegate.swift
  64. +38 −0 ...yout/Static Layout Example/Static Layout Example/Assets.xcassets/AppIcon.appiconset/Contents.json
  65. +27 −0 ...ducing Auto Layout/Static Layout Example/Static Layout Example/Base.lproj/LaunchScreen.storyboard
  66. +25 −0 ... - Introducing Auto Layout/Static Layout Example/Static Layout Example/Base.lproj/Main.storyboard
  67. +40 −0 ... Code/Chapter 02 - Introducing Auto Layout/Static Layout Example/Static Layout Example/Info.plist
  68. +57 −0 ...ter 02 - Introducing Auto Layout/Static Layout Example/Static Layout Example/ViewController.swift
  69. +297 −0 ...pter 05 - Interface Builder/Our First Auto Layout Example/DeveloperTown.xcodeproj/project.pbxproj
  70. +7 −0 ...ur First Auto Layout Example/DeveloperTown.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  71. +46 −0 ...Code/Chapter 05 - Interface Builder/Our First Auto Layout Example/DeveloperTown/AppDelegate.swift
  72. +68 −0 ...lder/Our First Auto Layout Example/DeveloperTown/Assets.xcassets/AppIcon.appiconset/Contents.json
  73. +27 −0 ... Interface Builder/Our First Auto Layout Example/DeveloperTown/Base.lproj/LaunchScreen.storyboard
  74. +84 −0 ...ter 05 - Interface Builder/Our First Auto Layout Example/DeveloperTown/Base.lproj/Main.storyboard
  75. +47 −0 Sample Code/Chapter 05 - Interface Builder/Our First Auto Layout Example/DeveloperTown/Info.plist
  76. +30 −0 ...e/Chapter 05 - Interface Builder/Our First Auto Layout Example/DeveloperTown/ViewController.swift
  77. +297 −0 ...er 06 - Size Classes/Adjusting For Different Size Classes/DeveloperTown.xcodeproj/project.pbxproj
  78. +7 −0 ...g For Different Size Classes/DeveloperTown.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  79. +38 −0 ...de/Chapter 06 - Size Classes/Adjusting For Different Size Classes/DeveloperTown/AppDelegate.swift
  80. +68 −0 ...justing For Different Size Classes/DeveloperTown/Assets.xcassets/AppIcon.appiconset/Contents.json
  81. +27 −0 ...ize Classes/Adjusting For Different Size Classes/DeveloperTown/Base.lproj/LaunchScreen.storyboard
  82. +120 −0 ...r 06 - Size Classes/Adjusting For Different Size Classes/DeveloperTown/Base.lproj/Main.storyboard
  83. +47 −0 Sample Code/Chapter 06 - Size Classes/Adjusting For Different Size Classes/DeveloperTown/Info.plist
  84. +12 −0 ...Chapter 06 - Size Classes/Adjusting For Different Size Classes/DeveloperTown/ViewController.swift
  85. +292 −0 ...er 07 - Auto Layout in Code/Constraint References In Code/DeveloperTown.xcodeproj/project.pbxproj
  86. +7 −0 ...onstraint References In Code/DeveloperTown.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  87. +46 −0 ...de/Chapter 07 - Auto Layout in Code/Constraint References In Code/DeveloperTown/AppDelegate.swift
  88. +68 −0 ...Code/Constraint References In Code/DeveloperTown/Assets.xcassets/AppIcon.appiconset/Contents.json
  89. +27 −0 ...uto Layout in Code/Constraint References In Code/DeveloperTown/Base.lproj/LaunchScreen.storyboard
  90. +118 −0 ...r 07 - Auto Layout in Code/Constraint References In Code/DeveloperTown/Base.lproj/Main.storyboard
  91. +47 −0 Sample Code/Chapter 07 - Auto Layout in Code/Constraint References In Code/DeveloperTown/Info.plist
  92. +34 −0 ...Chapter 07 - Auto Layout in Code/Constraint References In Code/DeveloperTown/ViewController.swift
  93. +297 −0 ...pter 07 - Auto Layout in Code/Our View Controller In Code/DeveloperTown.xcodeproj/project.pbxproj
  94. +7 −0 .../Our View Controller In Code/DeveloperTown.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  95. +13 −0 ...Code/Chapter 07 - Auto Layout in Code/Our View Controller In Code/DeveloperTown/AppDelegate.swift
  96. +68 −0 ...n Code/Our View Controller In Code/DeveloperTown/Assets.xcassets/AppIcon.appiconset/Contents.json
  97. +27 −0 ... Auto Layout in Code/Our View Controller In Code/DeveloperTown/Base.lproj/LaunchScreen.storyboard
  98. +26 −0 ...ter 07 - Auto Layout in Code/Our View Controller In Code/DeveloperTown/Base.lproj/Main.storyboard
  99. +47 −0 Sample Code/Chapter 07 - Auto Layout in Code/Our View Controller In Code/DeveloperTown/Info.plist
  100. +9 −0 ...hapter 07 - Auto Layout in Code/Our View Controller In Code/DeveloperTown/UIView+AutoLayout.swift
  101. +125 −0 ...e/Chapter 07 - Auto Layout in Code/Our View Controller In Code/DeveloperTown/ViewController.swift
  102. +290 −0 ... 08 - Layout Guides and Margins/Center Layout Group/Center Layout Group.xcodeproj/project.pbxproj
  103. +7 −0 ...ns/Center Layout Group/Center Layout Group.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  104. +46 −0 .../Chapter 08 - Layout Guides and Margins/Center Layout Group/Center Layout Group/AppDelegate.swift
  105. +38 −0 ... Margins/Center Layout Group/Center Layout Group/Assets.xcassets/AppIcon.appiconset/Contents.json
  106. +27 −0 ...out Guides and Margins/Center Layout Group/Center Layout Group/Base.lproj/LaunchScreen.storyboard
  107. +46 −0 ...08 - Layout Guides and Margins/Center Layout Group/Center Layout Group/Base.lproj/Main.storyboard
  108. +40 −0 ...le Code/Chapter 08 - Layout Guides and Margins/Center Layout Group/Center Layout Group/Info.plist
  109. +39 −0 ...apter 08 - Layout Guides and Margins/Center Layout Group/Center Layout Group/ViewController.swift
  110. +290 −0 ...pter 08 - Layout Guides and Margins/Even Distribution/Even Distribution.xcodeproj/project.pbxproj
  111. +7 −0 ...argins/Even Distribution/Even Distribution.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  112. +38 −0 ...Code/Chapter 08 - Layout Guides and Margins/Even Distribution/Even Distribution/AppDelegate.swift
  113. +38 −0 ... and Margins/Even Distribution/Even Distribution/Assets.xcassets/AppIcon.appiconset/Contents.json
  114. +27 −0 ... Layout Guides and Margins/Even Distribution/Even Distribution/Base.lproj/LaunchScreen.storyboard
  115. +73 −0 ...ter 08 - Layout Guides and Margins/Even Distribution/Even Distribution/Base.lproj/Main.storyboard
  116. +40 −0 Sample Code/Chapter 08 - Layout Guides and Margins/Even Distribution/Even Distribution/Info.plist
  117. +41 −0 ...e/Chapter 08 - Layout Guides and Margins/Even Distribution/Even Distribution/ViewController.swift
  118. +290 −0 ...de/Chapter 08 - Layout Guides and Margins/Layout Margins/Layout Margins.xcodeproj/project.pbxproj
  119. +7 −0 ... and Margins/Layout Margins/Layout Margins.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  120. +38 −0 Sample Code/Chapter 08 - Layout Guides and Margins/Layout Margins/Layout Margins/AppDelegate.swift
  121. +38 −0 ...Guides and Margins/Layout Margins/Layout Margins/Assets.xcassets/AppIcon.appiconset/Contents.json
  122. +27 −0 ...r 08 - Layout Guides and Margins/Layout Margins/Layout Margins/Base.lproj/LaunchScreen.storyboard
  123. +59 −0 ...e/Chapter 08 - Layout Guides and Margins/Layout Margins/Layout Margins/Base.lproj/Main.storyboard
  124. +40 −0 Sample Code/Chapter 08 - Layout Guides and Margins/Layout Margins/Layout Margins/Info.plist
  125. +12 −0 ...le Code/Chapter 08 - Layout Guides and Margins/Layout Margins/Layout Margins/ViewController.swift
  126. +290 −0 Sample Code/Chapter 09 - Animation/Animation Example/Animation Example.xcodeproj/project.pbxproj
  127. +7 −0 ...mation/Animation Example/Animation Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  128. +12 −0 Sample Code/Chapter 09 - Animation/Animation Example/Animation Example/AppDelegate.swift
  129. +38 −0 ... - Animation/Animation Example/Animation Example/Assets.xcassets/AppIcon.appiconset/Contents.json
  130. +27 −0 ...ode/Chapter 09 - Animation/Animation Example/Animation Example/Base.lproj/LaunchScreen.storyboard
  131. +25 −0 Sample Code/Chapter 09 - Animation/Animation Example/Animation Example/Base.lproj/Main.storyboard
  132. +40 −0 Sample Code/Chapter 09 - Animation/Animation Example/Animation Example/Info.plist
  133. +84 −0 Sample Code/Chapter 09 - Animation/Animation Example/Animation Example/ViewController.swift
  134. +311 −0 .../Chapter 10 - Debugging Constraints/Debugging Constraints/DeveloperTown.xcodeproj/project.pbxproj
  135. +7 −0 ...raints/Debugging Constraints/DeveloperTown.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  136. +46 −0 Sample Code/Chapter 10 - Debugging Constraints/Debugging Constraints/DeveloperTown/AppDelegate.swift
  137. +68 −0 ... Constraints/Debugging Constraints/DeveloperTown/Assets.xcassets/AppIcon.appiconset/Contents.json
  138. +27 −0 ...10 - Debugging Constraints/Debugging Constraints/DeveloperTown/Base.lproj/LaunchScreen.storyboard
  139. +84 −0 ...Chapter 10 - Debugging Constraints/Debugging Constraints/DeveloperTown/Base.lproj/Main.storyboard
  140. +5 −0 ...er 10 - Debugging Constraints/Debugging Constraints/DeveloperTown/DeveloperTown-Bridging-Header.h
  141. +47 −0 Sample Code/Chapter 10 - Debugging Constraints/Debugging Constraints/DeveloperTown/Info.plist
  142. +54 −0 ...0 - Debugging Constraints/Debugging Constraints/DeveloperTown/NSLayoutConstraint+Extensions.swift
  143. +11 −0 ...de/Chapter 10 - Debugging Constraints/Debugging Constraints/DeveloperTown/UIView+AZALExtensions.h
  144. +17 −0 ...de/Chapter 10 - Debugging Constraints/Debugging Constraints/DeveloperTown/UIView+AZALExtensions.m
  145. +30 −0 ... Code/Chapter 10 - Debugging Constraints/Debugging Constraints/DeveloperTown/ViewController.swift
  146. +4 −0 Sample Code/README.md
  147. +6 −0 TO COVER.md
  148. BIN WWDC Screengrabs/IMG_0244.jpg
  149. BIN WWDC Screengrabs/IMG_0245.jpg
  150. BIN WWDC Screengrabs/IMG_0246.jpg
  151. BIN WWDC Screengrabs/IMG_0248.jpg
  152. BIN WWDC Screengrabs/IMG_0249.jpg
  153. BIN WWDC Screengrabs/IMG_0250.jpg
  154. BIN WWDC Screengrabs/IMG_0251.jpg
  155. BIN WWDC Screengrabs/IMG_0252.jpg
  156. BIN WWDC Screengrabs/IMG_0253.jpg
  157. BIN WWDC Screengrabs/IMG_0254.jpg
  158. BIN WWDC Screengrabs/IMG_0261.jpg
  159. BIN WWDC Screengrabs/IMG_0262.jpg
  160. BIN WWDC Screengrabs/IMG_0263.jpg
  161. BIN WWDC Screengrabs/IMG_0264.jpg
  162. BIN WWDC Screengrabs/IMG_0265.jpg
  163. BIN WWDC Screengrabs/IMG_0266.jpg
  164. BIN WWDC Screengrabs/IMG_0267.jpg
  165. BIN WWDC Screengrabs/IMG_0268.jpg
  166. BIN WWDC Screengrabs/IMG_0269.jpg
  167. BIN ...Auto Layout improvements « Trifork Blog - Trifork- Enterprise Java, Open Source, software….webloc
  168. +66 −0 generate.rb
  169. BIN iBooks_Submission.itmsp/.docinfo
  170. BIN iBooks_Submission.itmsp/Achieving_Zen_with_Auto_Layout.epub
  171. BIN iBooks_Submission.itmsp/Cover-Art.jpg
  172. +485 −0 iBooks_Submission.itmsp/metadata.xml
  173. +7 −0 style.css
@@ -0,0 +1,69 @@
Chapter 01 - Introduction
====================================

We’ve all been there. Apple announces an all new technology at their annual Worldwide Developer’s Conference. It’s designed to replace something that you’ve been using since you started down the road as an OS X or iOS programmer. The demos in the session look great. You can’t wait to get home and try this new stuff out!

And then you get home and realize, “Oh, this isn’t as easy as I thought.”
As software developers, we’re used to adapting to a learning curve whenever we try to implement a new technology in our products; it’s just part of the job. Unfortunately, some technologies have a steeper curve than others. One of the technologies that has had the biggest learning curve over the last few years is Auto Layout.

This book is designed to help you get over that hurdle with Auto Layout.

### Who Is This Book For?

For the three years I have been giving a talk around the United States called "Achieving Zen With Auto Layout" that is aimed at developers who have tried to use Auto Layout in the past, but have struggled for some reason or another and gone back to doing layout the old way.

If that’s you, this book is for you.

If you haven’t even started using Auto Layout yet, but Apple’s announcements at WWDC 2014 have you in fear that you’re being left behind, I’ll have you up to speed in no time as well.

### Prerequisites

This book presumes that you are a seasoned OS X or iOS developer using Objective-C or Swift. If this is the first time you’ve ever heard the words Objective-C or Swift, you might want to start with another book that teaches you the fundamentals. These are books and authors I recommend:

* [iOS Programming: The Big Nerd Ranch Guide][bnr]
* [Cocoa Programming for OS X][osx]
* [Programming iOS 8][oreilly]

I’m also going to make the assumption that you are targeting at least iOS 9 or OS X El Capitan with your products and using the latest version of Xcode 7.0 and Swift 2.0, where appropriate. I’ll do my best to point out some tricks that can help with backwards compatibility to previous operating system releases.

### Organization of This Book

I have broken down the book into four sections, or levels of "Zen." The first section of the book will explore a lot of the under the hood plumbing of Auto Layout. My goal is to build a foundation of understanding of what Auto Layout is actually doing, so that you know _why_ you're coding something rather than just _what_ you're coding.

The second section of the book will cover working with Interface Builder and Xcode. The third section will cover working with constraints in code, custom views, and animations. The final section will be the more advanced topics such as debugging constraints, scroll views, and other pain points developers may run into.

### My Writing Style

The style of this book is slightly different than other technology books you may have read. Most books are ‘project oriented’ where you start with a foundation project that you build on throughout the book.

I don’t believe that’s the best way to tackle a singular technology like Auto Layout. Instead, I’m going to spend the first part of this book building a foundation of knowledge about the core concepts of the technology so that you understand why Auto Layout is doing what it’s doing. From there, we’ll start looking at how to implement it in real world, practical use cases.

### Code Samples

Throughout the book there are several snippets of code explaining how to accomplish different tasks using Auto Layout. Where appropriate I am also providing a sample Xcode project or Playground that fully implements the feature. You should have received a zip file of these samples when you made your purchase.

All of the code samples were written using Xcode 7 and targeted towards OS X El Capitan and iOS 9 respectively.

### Errata and Issues

If you notice something missing or incorrect or factually inaccurate in the book, please file an issue on the public GitHub repository.

[https://github.com/secondgear/Achieving-Zen-With-Auto-Layout][gh]

### Feedback and Questions

If you have any feedback, questions, or topics you wish I had covered in this book, the best way to get in touch with me is via email.

My goal is to update this book on an ongoing basis with new content when possible, so if you feel like I should have covered a topic, please let me know and I’ll see what I can do. Digital publishing offers the benefit of making books become living documents rather than just a moment in time.

- Email me: [justin@secondgear.io](mailto:justin@secondgear.io)

[bnr]: http://www.bignerdranch.com/we-write/ios-programming.html

[oreilly]: http://shop.oreilly.com/product/0636920034261.do

[osx]: http://www.bignerdranch.com/we-write/cocoa-programming.html

[gh]: https://github.com/secondgear/Achieving-Zen-With-Auto-Layout

\pagebreak

0 comments on commit d7212a2

Please sign in to comment.
You can’t perform that action at this time.