Engineering

How To Learn Swift

A guide for beginners

Learning a new programming language can be a very challenging concept to most if you haven’t done it before. In today’s day and age, there are a plethora of resources that provide some level of training or practice. But where do you get started? Well, you’ve come to the right place! The ideal reader for this post is someone who has heard all kinds of nice things about Swift and the Apple ecosystem and wants to get started learning the language. By the end of this post, you should have a structured approach to learning Swift while also being provided suggested tools and resources to assist in the process.

So, you have finally decided that you are ready to learn! Now what? In order to help make this post applicable to as many people as possible, I am going to detail how I learned Swift with the hopes that you will be able to pick and choose what works for you. The techniques listed can be applied to Swift or any other programming language.

What’s your learning style?

When taking on the challenge of learning a new programming language, one of the first things you should do is establish or figure out your learning style. By investigating the way you learn best, you’ll be able to fine-tune your learning and get the most out of it. If you’re like me, you might be picking up the new language while working a full-time job and time is of the essence. This means you need to be very pragmatic with your time and effort. I discovered early on that I am a very visual learner, so I focused my efforts on finding video content that taught the core concepts of Swift with examples. I came to this discovery because of how frustrated I was when I read docs and they didn’t make sense to me. I was missing the ability to connect the dots. However, when I watched video content, I was able to pick up on other cues that helped me develop a connection between the theoretical and the practical use case.

If you are unsure about your learning style, there are several tools that can assist with this. While doing some research for this post I found the Learning Style Assessment and it confirmed for me everything I already knew about myself. I highly suggest completing the assessment if you are having trouble determining your learning style. Once complete, you will be presented with your learning style as well as suggestions for how you should study or consume content.

Resources to learn from

When I identified my learning style, I started on my journey to find resources that best complemented this style. My initial reasoning for learning Swift was to build impactful and useful apps. With that in mind, I started with project-based learning. One thing to be mindful of is there is a difference between learning Swift and learning iOS. On one hand, you are learning a programming language, on the other, you are learning how to use frameworks and libraries using that language. Over the past few years, Swift has become useful for things like scripting, server-side use, as well as IoT (Raspberry Pi, Arduino) use cases. When deciding which resources are best, keep in mind the end goal of how you would like to use Swift.

Below are some of the resources I’ve used:

Hacking With Swift

Hacking With Swift run by Paul Hudson is one of the most comprehensive sites there is when it comes to learning swift. He has several books that are free and paid as well as the 100 Days Of Swift challenge. What I like the most about the 100 Days of Swift are the corresponding quizzes. It’s fairly easy to just read through something and think that you understand it, so taking a quiz on the subject ensures you’ve retained the knowledge.

We Heart Swift

I found this cool little tool when I was searching for ways to learn Swift and I found it very helpful because they have lessons and quizzes that you can take.

Udemy

This is one of my favorite resources because of the variety and cost of courses provided. Although I had issues with the mobile app, it was one of the only apps with offline access to videos. This feature alone kept me on the platform because I could download the content and watch it on the train when I had little to no internet access. I used Udemy mostly for the project-based learning approach where I will find a course that has interesting projects but also has very good “Swift language” concepts as part of the course. Here are some of my criteria when deciding which course to purchase on Udemy:

What is the star rating and how many students have left ratings? Regarding this, you have to be careful because it can be misleading. Some instructors have 4 or 5-star ratings but a very small sample size. If their sample size is small, be sure to read the actual text of the ratings to get a better idea of the quality of the course.

Evaluate the Table of Contents Is this course going to teach me Swift, iOS, or both? Depending on where you are in your journey, you may have already learned the basics of Swift and are looking to supplement your learning by building actual projects. Some courses focus simply on projects while others include a section solely dedicated to learning the Swift programming language. As I stated above, there is a difference between learning Swift the programming language, and something like UIKit to create your user interface and such. If it’s a comprehensive course, this will be called out in the outline or table of contents.

Use focused search terms If you are looking for a course that is focused on teaching Swift, be sure to use that plus the version in your search term. At the time of writing this post, the current version of Swift is Swift 5.

Youtube

I made heavy use of youtube during my early learning days and still do. My favorite aspect of Youtube are the sheer number of videos available and the recommendation engine that suggests certain videos after completing one. I discovered several new channels in this way. Below are a few of my favorites for folks that are new to iOS and Swift:

Unwrap

This is a cool open sourced app created by Paul Hudson and is the perfect tool for learning on the go. I believe when learning a programming language you need to CODE EVERY DAY. Depending on your circumstance, it may not always be easy to sit in front of a computer. In those cases, apps like this one are really straightforward and give you a concise means of focusing on learning the Swift language. This app has video and text-based content with interactive quizzes and lessons.

Mimo

This is another one of my favorites when it comes to passively learn in those moments where you cannot be in front of a computer. The interesting part of this app is that it’s not specific to Swift and has several other programming languages available to learn.

The 5 sources method

In the process of learning, I came across a methodology that still serves me well to this day. I learned about this in a roundabout way while purchasing several Udemy courses. I noticed a pattern that with each course I took, there were certain topics that an instructor would teach, that made absolutely no sense to me, but then I’d visit another course, and it would be explained in such a way that made perfect sense. It was then that I realized that anytime I don’t understand something, it’s not my fault, it’s the instructors’ fault. What I mean by this is that your brain works the way it works, and your learning style is what it is. Unfortunately, everyone’s teaching style may not match your learning style. This is not a knock on the instructor per se, you just need another angle.

My solution to this problem was to always find 5 sources of competing information when studying a topic. These sources don’t need to be from the same platform but you can do that if it is easier for you. For example, let’s say I’m learning about for loops, the goal would be to find 5 competing resources that teach for loops and just that alone. What I would be searching for is how to make the information I’ve found compete with each other. I would search for similarities in the teaching and what the core concepts that they each share. By doing that, I would have a much more well-rounded understanding of the subject at hand.

Summary

Learning a new programming language and can be fun and stressful at the same time. I found that what worked for me was to first figure out my learning style and then use the techniques mentioned above to really maximize my study time. As stated above, the key is to have a very regular study schedule and code every day. In order to achieve that, you need the right type of resources to fill in the gap. If you apply the 5 sources method, you’ll have a multitude of resources that you can pick from to enhance your learning. In times where you are on-the-go, be sure to try out the mobile apps listed above to keep the knowledge fresh in your mind while testing how well you retain it.