5-Day Swift Coding Challenge: Day 1

Apr 21 2025 · Swift 6.0, iOS 18, Swift Playground 4.6

Lesson 01: Day 1: Meet the Swift Programming Language

Demo: Variables in Action

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

To get started, open up your Swift Playgrounds app. You’ll be presented with a few options to create a new playground. If you are on an iPad, tap the New Playground option and select the New Book option. On macOS, at the time, we don’t have access to create a new book. Instead, we need to do this from the menubar. Select File and the New Book option.

var greeting = "Hello World!"
print(greeting)
print(greet)
print(greeting)
print("🟢")
print("🟡")
print("🔴")
print("🟧🟧🟧")
print("🟧🔴🟧")
print("🟧🟡🟧")
print("🟧🟢🟧")
print("🟧🟧🟧")
var firstName = "Brian"
greeting = "Hello \(firstName)"
print(greeting)
greeting = "Hello \(1000 * -20)"
let lastName = "Moakley"
print("Hello \(firstName) \(lastName)")
lastName = "Einstein"
var number = 10
var decimal = 10.4
var trueOrFalse = true
var emoji = "🐰"
var number: Int = 10
var decimal: Double = 10.4
var trueOrFalse: Bool = true
var emoji: Character = "🐰"
var text: String = "Learning Swift rocks!"
let myInt = 10
let myDouble = 20.0
let myTotal = myInt + myDouble
let myTotal = myInt + Int(myDouble)
print(myTotal)
let myTotal = Double(myInt) + myDouble
See forum comments
Cinema mode Download course materials from Github
Previous: Swift Variables & Data Types Next: Working with Objects