Book Image

Application Development in iOS 7

By : Kyle Begeman
Book Image

Application Development in iOS 7

By: Kyle Begeman

Overview of this book

Table of Contents (15 chapters)
Application Development in iOS 7
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Why you should use Auto Layout


Prior to Auto Layout, building applications to dynamically support multiple screen sizes and orientations required large amounts of work. Auto-resizing masks, springs, and struts are all examples of the tools that developers would commonly struggle to use. These tools did not always produce the correct result, so the typical next best action was to detect screen sizes in code and adjust the layout accordingly. When working on an application with many views and layouts, this can become frustrating.

With iOS 6, Apple introduced a new feature called Auto Layout. The premise was pretty straightforward: allow developers to define constraints on all visual elements in a storyboard in order to control the layout and flow of an application. Unfortunately, Auto Layout caused many headaches.

The main issue was related to the fact that Auto Layout required every object to have proper constraints attached to it. If you failed to provide a single constraint, Xcode would generate...