Programming in Swift: Functions & Types

Jan 4 2022 Swift 5.5, iOS 15, Xcode 13

Part 1: Functions

1. Introduction

Lesson Complete

Play Next Lesson
Next
Save for later
About this episode
See versions

See course reviews

See forum comments
Cinema mode Mark as Complete Download course materials
Next episode: 2. Review Functions

Programming in Swift: Fundamentals

Update Notes: This course was originally recorded in 2019. It has been reviewed and all content and materials updated as of October 2021.

Hey! I’m Catie, and I’ll be your guide throughout this course: Programming in Swift: Functions and Types!

If you’re working your way through our iOS & Swift for Beginners learning path, you’ve already written a lot of Swift code! You’ve learned how to use fundamental data types that Swift provides for you, several methods of control flow, and you’ve started learning how to write your own types.

You can get a lot done with what you already know. But, there is still so much more you can learn about this amazing, expressive language that can help you build iOS apps faster and with greater confidence.

You’ll find information here that will help you understand and use Apple’s frameworks and integrate them with your own Swift code. That’s true whether you move on to build apps with UIKit, SwiftUI, or both,

If you aren’t following along with our learning path, I suggest you at least work through the Programming in Swift: Fundamentals course before starting this one.

The beginning of this course is about compound types. Specifically, this course will start off with a brief overview of what you already know about functions. Then you’ll move on to some more advanced features of functions, and see how they’re really just another Swift data type!

In part 2, you’ll spend a lot of time with closures. Closures and functions are very similar creatures in Swift. So, we’ll do some comparing and contrasting. You’ll also learn how closures can give you super powers when dealing with collections like arrays and dictionaries.

All of that knowledge will be helpful as you move into the rest of the course, which focuses on Named Types. In part three, you’ll start off with a new one: the Enumeration! If Swift isn’t your first programming language, you might be surprised at how much Enumerations can do in Swift.

Part 4 of this course will delve into some concepts that can be used across all named types in Swift - Properties and Methods!

Then, you’ll wrap up the course with a look at some features unique to classes, and an introduction to the final named type: the Protocol.

We’ll be working entirely in Xcode Playground in this course. To get the most out of it, I recommend you download the “Begin” playground for each part of the course and write Swift along with me! It will have a dedicated page for each episode, and sometimes some starter code for us to review or use.

Throughout the course, I’ll be giving you challenges to try all these new concepts out on your own. All of the challenge instructions and hints will also be in the downloadable Playgrounds.

Some of the challenges in this course are more open-ended, meaning there’s not one “correct” solution. They’re really there to help you practice writing code, so, please give the challenges a try before you watch the solutions!

I’m so excited to share all of this Swift knowledge with you! But before we jump into shiny new things things, meet me in the next episode for a quick review of what you’ve already learned about functions.