UIKit
Apprentice
First Edition
By Fahim Farook & Matthijs Hollemans
UIKit Apprentice, First Edition
Fahim Farook & Matthijs Hollemans.
Copyright 2020 Razeware LLC.
Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text, images, or source code) may be reproduced or distributed by any means without prior written permission of the copyright owner.
Notice of Liability
This book and all corresponding materials (such as source code) are provided on an as is basis, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in action of contract, tort or otherwise, arising from, out of or in connection with the software or the use of other dealing in the software.
Trademarks
All trademarks and registered trademarks appearing in this book are the property of their own respective owners.
Dedications
"For my parents and my wife."
Fahim Farook
"To Floortje, my familiar. Thanks for all the cuddles!"
Matthijs Hollemans
About the team
Matthijs Hollemans is the author of this book. He is a mystic who lives at the top of a mountain where he spends all of his days and nights coding up awesome apps. Actually he lives below sea level in the Netherlands and is pretty down-to-earth but he does spend too much time in Xcode. Check out his website at www.matthijshollemans.com.
Fahim Farook is the author of this book. He is a developer with over 30 years of experience in developing in over a dozen different languages. Fahims current focus is on mobile development with over 100+ iOS apps, 10+ macOS apps, a few Android apps, and several Flutter apps under his belt. He has lived in Sri Lanka, USA, Saudi Arabia, New Zealand, Singapore, Malaysia, France, the UAE, Spain, and Canada, and enjoys science fiction and fantasy novels, TV shows, and movies. You can follow Fahim on Twitter at @FahimFarook.
Book license
By purchasing UIKit Apprentice, you have the following license:
You are allowed to use and/or modify the source code in UIKit Apprentice in as many apps as you want, with no attribution required.
You are allowed to use and/or modify all art, images and designs that are included in UIKit Apprentice in as many apps as you want, but must include this attribution line somewhere inside your app: Artwork/images/designs: from UIKit Apprentice, available at www.raywenderlich.com.
The source code included in UIKit Apprentice is for your personal use only. You are NOT allowed to distribute or sell the source code in UIKit Apprentice without prior authorization.
This book is for your personal use only. You are NOT allowed to sell this book without prior authorization, or distribute it to friends, coworkers or students; they would need to purchase their own copies.
All materials provided with this book are provided on an as is basis, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
All trademarks and registered trademarks appearing in this guide are the properties of their respective owners.
Before You Begin
This section tells you a few things you need to know before you get started, such as what youll need for hardware and software, where to find the project files for this book and more.
What You Need
To follow along with this book, youll need the following:
A Mac computer with an Intel/ARM processor. Any Mac that youve bought in the last few years will do, even a Mac mini or MacBook Air.
Xcode 12 and Swift 5.3: Xcode is the main development tool for writing code in Swift. You'll need Xcode 12 at a minimum, since that version includes Swift 5.3. You can download the latest version of Xcode for free from the Mac App Store.
Optionally, an iPhone, iPad, or iPod touch running iOS 14.
Book Source Code & Forums
Book source code
The materials for this book are all available in the GitHub repository here:
You can download the entire set of materials for the book from that page.
Forum
Weve also set up an official forum for the book at forums.raywenderlich.com. This is a great place to ask questions about the book or to submit any errors you may find.
About the Cover
Striped dolphins live to about 55-60 years of age, can travel in pods numbering in the thousands and can dive to depths of 700 m to feed on fish, cephalopods and crustaceans. Baby dolphins don't sleep for a full a month after theyre born. That puts two or three sleepless nights spent debugging code into perspective, doesn't it?
Section 1: Getting Started
This section introduces you to the first of the four apps you'll build over the course of this book Bull's Eye.
As you progress through building the Bull's Eye app, the section will teach you how to think like a programmer and how to plan your programming tasks. In addition, you'll also learn how to use Xcode, Interface Builder, and even the basics of coding for iOS.
While some of the concepts in this section might seem a bit basic, please do not skip this section if you are new to iOS development you will learn some fundamentals which act as the building blocks for what you learn later.
Chapter 1: Introduction
Hi, welcome to The UIKit Apprentice: Beginning iOS Development with Swift, First Edition, the swiftest way if you'll pardon the pun to iOS development mastery!
In this book, you'll learn how to make your own iPhone and iPad apps using Apples Swift programming language (and Xcode 12) and the iOS UIKit framework, by building four interesting iOS apps.
Everybody likes games, right? So, youll start by building a simple but fun iPhone game named Bulls Eye. It will teach you the basics of iPhone programming, and the other apps will build on what you learn there.
Taken together, the four apps that you'll build cover everything you need to know to make your own apps. By the end of the book, youll be experienced enough to turn your ideas into real apps that you can put on the App Store!
Next page