If you’re completely new to Swift and iOS development (or need a brush-up), this is the series for you.
The iOS Apprentice is a series of epic-length tutorials for beginners where you’ll learn how to build four complete apps from scratch.
Each new app will be a little more advanced than the one before, and together they cover everything you need to know to make your own apps. By the end of the series you’ll be experienced enough to turn your ideas into real apps that you can sell on the App Store.
These tutorials have easy to follow step-by-step instructions, and consist of more than 1,100 pages and 500 illustrations! You also get full source code, image files, and other resources you can re-use for your own projects.
If you’re new to iOS and Swift, or to programming in general, learning how to write an app can seem incredibly overwhelming.
That’s why you need a guide that:
Shows you how to write an app step-by-step
With tons of illustrations and screenshots to make everything clear
In a fun and easygoing manner!
We’ll start at the very beginning. The first tutorial assumes absolutely zero programming knowledge but still shows you how to build an entire game from scratch.
The iOS Apprentice series doesn’t cover every single feature of iOS – it just focuses on the absolutely essential ones that you need to know.
Instead of just covering a list of features, the iOS Apprentice series does something much more important: it explains how all the different building blocks fit together and what is involved in building real apps.
You’re not going to create quick example programs that demonstrate how to accomplish a single feature. Instead, you’ll develop complete, fully-formed apps that are good enough to submit to the App Store!
Want to try a sample for free?
Sign up for the raywenderlich.com newsletter and you’ll receive the entire first section of the book to try out:
This section introduces you to the first of the five apps you’ll build throughout this book: Bullseye. It’s a simple game that challenges the user to move a slider to a specific position without any hints or markers. While it won’t make you an App Store millionaire, the exercise of writing it will introduce you to the basics of writing iOS apps.
This section will introduce you to several things you’ll use when coding apps. You’ll be introduced to Xcode, the integrated development environment for writing programs for Apple devices. You’ll also be introduced to Swift, Apple’s programming language, which has grown to become one of the most popular among programmers because it’s simple, powerful, and fun.
Finally, you’ll get your first taste of something that even the most experienced iOS developers haven’t had much time to try: SwiftUI. It’s the new way to build user interfaces for Apple platforms, and like the programming language from which it takes its name, it’s simple and powerful. The first two apps that you’ll make in this book will give you a great head start in building interfaces with SwiftUI.
This section aims to be beginner-friendly, and you may be tempted to skip it. Please don’t, especially if you’re new to iOS development. You’ll need the fundamentals introduced in this section for later parts of the book, and you’ll miss out on the basics of the all-new SwiftUI.
In this book, you're about to deep dive into the latest and greatest Swift and iOS best practices. Throughout this five-section book, you will build four iOS projects using both UIKit and SwiftUI. Good luck!
At this point, you have created a fully functional game, wow! It's time to take a step back and look at best practices in the industry. It's time to clean up some code and make it more readable for the future!
To finish our game we will add some animations, an icon, and display name ready for the App Store!
In this section, you’ll build Checklists. As you may have gathered from the name, it’s a TODO app that lets the user create, manage, and track items in one or more lists. Lists are a key part of many apps, and the lessons you’ll learn while building Checklists will serve you well when you start coding your creations.
You’ll make a multi-screen app, which will teach you the concepts of navigating from screen to screen, and sharing information between screens. You’ll see how SwiftUI makes it easy to display lists of data. You’ll also learn about data models (how data is represented in a program) and data persistence (saving data). And finally, you’ll use local notifications to present the user with timely reminders and important messages that appear at the top of the screen. By the end of this section, you’ll be able to write some basic (but useful) productivity apps.
It's time to start your next iOS project. Are you ready for the challenge? In this chapter, we will commence our next app using SwiftUI, Checklists. Prepare for NavigationView, Arrays, Loops and removing items from the list.
In this final chapter for your TODO list app, you will learn about data persistence. Right now all the items are hardcoded so it's time to persist and go!
Getting Started with UIKit
In this section, you’ll learn about UIKit, which is an alternative way to build the UI of your app. UIKit has been around since the first iOS and is currently powering all of the existing iOS apps in the App Store. UIKit is the foundation on which most of SwiftUI is built upon.
You’re about to create Bullseye again but this time using UIKit so you can see the differences between using SwiftUI and UIKit. We feel like SwiftUI is the future of iOS development but we truly think a programmer learning iOS you should have a good grasp of both.
You’ll start by creating a basic view to understand how UIKit works, how it places UI elements on the screen and how to interact with them. You’ll also read about the most common design pattern used when building apps using UIKit. You’ll then go on to create Bullseye!
You'll be well on your way of noticing the differences between building an app using SwiftUI and now UIKit. In this chapter you will deal with random numbers, adding rounds to the game and calculating the points scored.
TableViews are fundamental in the UIKit toolbox. In this chapter, you will learn about data sources, delegates, and general TableView best practices. Be sure to take this knowledge in your future iOS career.
UINavigationControllers are super important in an iOS app. In this chapter, you will learn about adding a NavigationController, which will help present the high scores view. You will also add the functionality to delete rows from the TableView.
Phew! You have successfully created Bullseye using UIKit. In this final chapter of this section you will learn about supporting different device sizes and add some beautiful animations.
With this fourth section and the MyLocations app, you get into Swift programming in earnest.
Sure you’ve already done coding in the previous sections, but this section starts with a good review of all the Swift coding principles you’ve learned so far and added to it by introducing some new concepts, too. In addition to that, you learn about using GPS coordinates, displaying data on maps, and using the iOS image picker to take photos using your camera or to pick existing images from your photo album. There’s a lot of valuable general information on Swift development as well as specific information about building location-aware apps.
You have made great progress. You have built your first app using UIKit which is some achievement. Whilst we have been writing the apps using Swift, you will need some additional theory to level up your knowledge. In this chapter, we will go into details about some of the Swift language, such as Variables, Constants, Types, Methods & Functions, Loops, and Objects.
This question will most likely crop up in your next iOS interview. It's time to put the toolbox down and learn some theory. Expect to learn about classes, inheritance, overriding methods and casting an object.
Now that you can persist the data to Core Data, we're going to explore displaying this data in the TableView. Learn about TableView sections, NSFetchedResults and add functionality to delete tagged locations.
UIKit comes with a built-in view controller, UIImagePickerController that lets users take new photos or select existing ones. In this chapter explore this controller and how best to display the image on the screen.
You have made it this far! It's time to give MyLocations a complete makeover. Prepare your pixel paintbrush for this chapter and let's get your creative flair at the ready. In this chapter you will cover the map screen improvements by adding icons, polishing the main screen and adding some cool effects to the app.
The final section of the book covers iPad support in more detail via the Store Search app.
Store Search shows you how to have separate custom screens both for specific orientations (landscape vs. portrait) as well as for specific platforms (iPhone vs. iPad). This section covers networking, working with remote API endpoints to fetch data needed by your app, and how to parse the fetched data. If that wasn’t enough, this section also takes you through the full application life cycle — from developing the code, testing it, and all the way to submitting to Apple. So don’t skip this section thinking that you know all about iOS development after the last few sections!
One of the most common tasks for mobile apps is to talk to a server. In this final UIKit app you will build StoreSearch. In this chapter, you will build the first screens, add fake searches and create the data models.
Before your app can search the iTunes store for real, we need to make the app look visually appealing. In this chapter, you will cover custom table view cells and nibs. Learn a little more about using git and the debugger right inside Xcode.
Phew! You will rarely want to block the main thread with a network request. In this chapter, we will explore asynchronous networking and finally showing an activity indicated to let the user know something is loading.
The iOS toolbox and the Swift language has many tools for our disposal, including URLSession. In this chapter, we will explore URLSession and it's many benefits. Downloading the iTunes artwork and how best to merge your git changes.
We're about to get the polish back out again. The detail pop-up view is working well but we can display the information better. Learn about dynamic types, gradients for the background and let's explore adding some more animations.
Users expect apps to work in both portrait and landscape. They also expect the app to look great in both orientations. In this chapter, we will learn about adding a completely different user interface for landscape vs. portrait.
The final app is looking great. You should put your feet up and grab a coffee! Programming is all about building new pretty features but when you join an existing company with an existing code-base you have to learn about the best ways to refactor existing code. Let's go!
So far our app works great in English. But if you want your app to go international you must support multiple languages and formats. In this chapter, you will explore adding support for a new language and look at regional settings.
Even though the app works _OK_ on the iPad, but it's not exactly optimized for the iPad. In this chapter, we're going to explore universal apps, the split view controller functionality, and dark mode support.
Are you ready to ship to the App Store? Finally, you will learn the key fundamentals on how to ship the app to the App Store, including the Apple Developer Program, beta testing using TestFlight and finally submitting to the App Store.