Programming in Swift: Fundamentals

Oct 19 2021 · Swift 5.5, iOS 15, Xcode 13

Part 1: Core Concepts

01. Introduction

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Next episode: 02. Swift Playgrounds & Comments

Notes: 01. Introduction

Prerequisite: Your First iOS and SwiftUI App This course was originally recorded in 2019. It has been reviewed and all content and materials updated as of October 2021.

Transcript: 01. Introduction Hey everyone. I'm Katie. Welcome to the programming in Swift fundamentals course after building your first SwiftUI app, you're ready to get a little more familiar with the ins and outs of the swift language. Chris recorded this course in August of 2019 using Swift 5.1, the Swift concepts he covers in this course haven't changed since then. Still I've gone through this course myself in October of 2021 and check to make sure everything will still work for you in Swift 5.5 and Xcode 13 playgrounds. If you do run into any trouble, check the update notes below the video for that episode, for anything that might've changed, that's it. You are ready to go. So I'll hand you off to Chris and his most excellent shirt. Hey everybody, I'm Chris and welcome to programming in Swift. Now in this course, you'll gain a really solid understanding of how to program in the Swift language, but specifically you'll learn all of the fundamental concepts you need to know to program in Swift, such as operators, types, structures, classes, collections, optionals, functions, and even more before you begin the course though, I recommend you start by watching our, Your First iOS app course, if you haven't already. Now, that course is included with your raywenderlich.com subscription. And that gets you started with Swift and iOS development by making a simple but fun app and learning some basic Swift concepts along the way. Now, this course picks up where that course leaves off. If you've already completed the, Your First iOS App course, you've actually already learned a lot about Swift programming while building your app. And specifically you've learned about five of the major core concepts in Swift. Number one, you know how to use variables and Constance and what the difference is. Now remember, you use a VAR for Variables and let for Constance. Number two, you should know how to use data types like Int and Strings. For example, here's my age as an Int and my name as a String, note that these are written in the long form here for clarity, but you could use Swifts type inference to write these without the types, if you want it. Number three, you should know how to convert between one type and another, for example, to convert an Int to a String, just write String and then wrap the Int value in parentheses. Number four, you should know how to perform basic operations like adding numbers or incrementing numbers. For example, I can integrate my age with plus equals or add two numbers together with the plus operator. And finally, number five, you should know how to use if statements. Now here's an example of writing an if statement to check, if my dog mango is still a puppy, she may not be a puppy, but she's still cute. And if you still feel rusty on any of these concepts, you know, that's okay. You can always go back and review the previous course, or you can keep watching because I will continue to use these concepts throughout the course. In this first part of programming in Swift, I'm going to double your library of Swift core concepts by covering four new core concepts in Swift. You'll learn how to use playgrounds, a really cool tool from Apple that lets you test out code and see the results instantly and how to use comments to document your code, to make it easier to understand. You'll also learn about the Boolean data type, which stores a simple, true or false value and about a new set of operators called comparison operators that let you compare values to each other. I'll then show you how logical operators work and you use them to compare Boolean values. And also about the, if else statement. And finally you'll explore optionals, which let you declare variables and constants that may or may not have a value inside. You'll learn when and how to use optionals when you're not confident, the value actually will exist when your program runs. And one final note, this course is based on the first few chapters of our best-selling book, the Swift Apprentice, which was written by tutorial team members, Matt Galloway, Ehab Amer, Alexis Gallagher, Eli Ganim, Ben Morrow. And Cosmin Pupăză. if you like this course, please thank them for the great work and consider picking up their book, which is a tremendously handy reference. By the time you're done with this part of the course, you'll have built up a library of nine core concepts in Swift development, and you'll be ready to dive even deeper into Swift. Let's get started.