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
About the Author
About the Reviewers

Applying constraints

Our menu view features two buttons to navigate to separate areas of the application. We want the buttons to always be in alignment with one another, so let's add some constraints to our buttons to make that happen.

One way to add a constraint between two objects is the control drag from one object to the other. Hold down the control key on your keyboard and then click-and-drag from the Add New button to the My Foods button. A new pop up will show these multiple options to add constraints. Each of these items can be selected and will provide the respective constraints between the two objects. Holding down the shift key will allow you to select more than one option at a time.

From the menu, select Horizontal Spacing. You will notice an orange outline appear around the Add New button, and a horizontal I-shaped line will appear between the two buttons, as shown in the following screenshot:

In order for Auto Layout to properly calculate the position of our views, it must have...