Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift By Example

You're reading from   Swift By Example

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785284700
Length 284 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Giordano Scalzo Giordano Scalzo
Author Profile Icon Giordano Scalzo
Giordano Scalzo
Arrow right icon
View More author details
Toc

Building a skeleton app

Let's start implementing the base structure on top of which we'll implement the entire app.

Implementing an empty app

Let's start creating a new app called Todolist using the Single View Application Xcode template. The app will be in portrait mode only, so you must uncheck Landscape from the allowed device orientations.

Although Apple has improved Interface Builder in Xcode 6, most developers still favor writing the layout in code instead of using Interface Builder. The common reasons, are that, with Interface Builder, it is more difficult to create reusable views, which makes work in a team difficult because of merging of the storyboard files; and in general, it is more difficult to debug a complex layout.

The main reason I prefer layout in code is that it is much easier to have everything under control if I use code. I can group the layout into functions, change the order of the constraints, add variables to them, and so on.

Although this may seem more...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image