Welcome to YTUnity

One free SpiderTaz Network account works across every network site.

Featured creators

Creators on the SpiderTaz Network

Become a creator →

Swift Variables, Constants & Data Types Explained for Beginners

CodeWithChris Guide 15 days ago

Description

To make our Quiz App interactive, we need to understand how Swift stores and works with data.

In this beginner Swift lesson, you'll learn variables with var, constants with let, and common Swift data types including String, Int, Double and Bool.

We'll practice these concepts in a Swift Playground first so you can understand them in isolation before we use them inside the app.

If you've never programmed before, this lesson is designed to start from the beginning.

📦 Get the free Module 1 resources:
https://codewithchris.com/foundations-m1/

▶ Watch the complete free iOS Foundations playlist:
https://www.youtube.com/playlist?list=PLUiEVrjEWTLw

🚀 Continue the complete iOS Foundations course:
https://cwc.to/foundations27

0:00 Introduction
0:23 Quiz app overview
0:19 Welcome back and recap
0:50 What is a playground?
1:02 Opening a playground in Xcode
1:10 Playground as a scratch pad
1:29 Playground interface walkthrough
1:51 Console and debug area
2:10 Clearing the console
2:27 Playground boilerplate code explained
5:26 Introduction to variables
6:01 Back to the playground
6:10 Declaring a variable
8:29 Data types in Swift
9:05 Variables are locked to a data type
10:21 Integer variable example
10:56 Constants and the let keyword
13:13 Recap and next steps