Changes

Jump to: navigation, search

An Introduction to Auto Layout in iOS 8

136 bytes added, 04:21, 10 November 2016
Three Ways to Create Constraints
{{#pagetitle: An Introduction to Auto Layout in iOS 10 }}
<seo title="An Introduction to Auto Layout in iOS 10" titlemode="replace" keywords="ios 10, swift 3, auto layout, xcode 8" description="An introduction to the use of the Auto Layout features of Xcode 8 and iOS 10 to create adaptive user interfaces"></seo>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[Understanding Creating an Interactive iOS 8 Views, Windows and the View HierarchyApp (Swift)|Previous]]<td align="center">[[iOS 8 App Development Essentials|Table of Contents]]<td width="20%" align="right">[[Working with iOS 8 Auto Layout Constraints in Interface Builder|Next]]</td>
<tr>
<td width="20%">Understanding Creating an Interactive iOS 8 Views, Windows and the View Hierarchy10 App<td align="center"><td width="20%" align="right">Working with iOS 8 10 Auto Layout Constraints in Interface Builder</td>
</table>
<hr>
<htmlet>ios10</htmlet>
== Three Ways to Create Constraints ==
<htmlet>adsdaqbox_flow</htmlet>
There are three ways in which constraints in a user interface layout can be created:
• '''Interface Builder''' – Interface Builder has been modified extensively to provide support for the visual implementation of Auto Layout constraints in user interface designs. Examples of using this approach are covered in the [[Working with iOS 8 Auto Layout Constraints in Interface Builder|Working with iOS Auto Layout Constraints in Interface Builder]] and [[An iOS 8 Auto Layout Example|An iOS 10 Auto Layout Example]] chapters of this book.
• '''Visual Format Language''' – The visual format language defines a syntax that allows constraints to be declared using a sequence of ASCII characters that visually approximate the nature of the constraint being created with the objective of making constraints in code both easier to write and understand. Use of the visual format language is documented in the chapter entitled [[Understanding the iOS 8 Auto Layout Visual Format Language in Swift|Understanding the iOS Auto Layout Visual Format]] Language.
• '''Writing API code''' – This approach involves directly writing code to create constraints using the standard programming API calls, the topic of this is covered in [[Implementing iOS 8 Auto Layout Constraints in Swift Code|Implementing iOS Auto Layout Constraints in Code]].
Wherever possible, Interface Builder is the recommended approach to creating constraints. When creating constraints in code, the visual format language is generally recommended over the API based approach.
== Constraints in more Detail ==
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[Understanding Creating an Interactive iOS 8 Views, Windows and the View HierarchyApp (Swift)|Previous]]<td align="center">[[iOS 8 App Development Essentials|Table of Contents]]<td width="20%" align="right">[[Working with iOS 8 Auto Layout Constraints in Interface Builder|Next]]</td>
<tr>
<td width="20%">Understanding Creating an Interactive iOS 8 Views, Windows and the View Hierarchy10 App<td align="center"><td width="20%" align="right">Working with iOS 8 10 Auto Layout Constraints in Interface Builder</td>
</table>

Navigation menu