Going from Tutorials to Your First Real Swift App: First Steps
If you want to learn iOS development, there are many places for you to learn. Hacking with Swift has two free 100 day courses for learning iOS development, one with UIKit and one with SwiftUI.
Getting started with iOS development normally isn’t the big issue. Go through a book or course, and you’ll learn the basics of iOS programming. The trouble starts when you finish a book or course and start to make your first app on your own. You feel stuck and don’t know where to start. You share some of the following feelings:
- “I’m a little lost as to where to go next. I’ve completed Swift for Beginners courses on at least four different sites, and if I build one more My First App I may cry.”
- “I just am having a hard time finding the tutorials/courses I specifically need to acquire the skills I need for MY project. I’m frankly not even sure I know what skills I actually need because so much of the information I’m seeing is so outdated that I’m not sure it’s relevant to me or if I’ll begin working on it only to find it’s no longer the way things are done or that there’s a better way after I’ve put in a lot of effort.”
- “Making the jump from basic concepts to actual coding is hard.”
- “Basic lessons have very basic concepts but when I look at the code being used in other projects, they use methods and syntax I’ve never seen.”
- “I watched almost every video (Stanford course) and I did everything that professor do. I built them all. But when I’m trying to build apps alone, even the things I built earlier I can’t do anything. I know Swift syntax and other stuff but I just can’t program.”
Why Do You Feel Stuck?
When you were following the book, course, or tutorial, you were doing the equivalent of watching someone make an app. You weren’t making the app. When you try to make your own app, you get stuck because you don’t have the book, course, or tutorial telling you what to do.
To apply to what you learned, you have to make an app on your own. And there’s a lot less material on going from beginner to making your first real app than there is on getting started.
Step 1: Choose a Suitable Project
The first step you have to take when creating an app is choosing the app to make. When choosing an app to make, you must balance the following:
- Making something small enough that you can finish.
- Making something that interests you.
A big mistake many new iOS developers make is starting with a huge app. They want to make something like Uber or a social media app with realtime chat, something that requires people to sign up for an account to use the app. Making a social media app requires you to have a backend server with a database to store all the data. No iOS development tutorial or book is going to teach you things like that. No wonder people feel stuck.
For your first app make something small and relatively simple. Make an app that uses only Apple technologies. Make something that you have a chance to finish. Once you finish your first app, choose something more ambitious as your next project.
But you also have to make an app that interests you. If you choose an app that bores you, you’ll stop making it.
Step 2: Learn the Necessary Frameworks to Make Your App
You may be able to skip this step if you pick a simple enough app to make. But most projects force you to learn some additional frameworks to make the app.
If you open Xcode’s documentation window (choose Help > Developer Documentation in Xcode), you’ll see that Apple has dozens of frameworks for iOS developers. There’s no way for you to learn them all. Use your choice of project to determine the frameworks you need to learn.
- A fitness app may use HealthKit.
- An app that uses locations may use MapKit.
- A text editing app uses TextKit. You may even need to learn about
UIDocument
and making document-based apps. - A drawing app may use PencilKit and Quartz2D.
- An app that generates PDF files uses PDFKit and possibly Quartz2D.
Step 3: Do a Little Planning
You may be tempted to create a new project in Xcode and start writing code. But development will go more smoothly if you do some planning before you start writing code. You don’t have to plan everything upfront, but doing the following will help you:
- Draw the screens for the app on paper
- Make a list of the app’s must-have features
- Make a list of the types of data your app uses
Once you do some planning, pick the simplest feature you can implement and work on that. When you get a small part working, you’ll feel good and use that energy to move on to the next part of the app. Build the app piece by piece, and you’ll eventually finish your first app.
Are You Doing It Right?
You may be wondering as you develop your app if you’re doing things the right way. I can’t tell you if you are, but it’s software, not something physical. Code can be changed and improved. If you find out you’re doing things wrong, you can change the code so you’re doing thing the right way.
I recommend placing your project under version control. Using version control makes your code easier to change. If you make a bunch of mistakes, you can go back to a working version of your code. When you create a project in Xcode, there’s a checkbox to place your project under version control. You can place an existing Xcode project under version control by choosing Source Control > Create Git Repositories.