Setup and syntax
Use let, var, types and string interpolation in a Swift playground.
What you will be able to do
- Prefer let by default.
- Use \(value) for interpolation.
- Use playgrounds for quick experiments.
- Follow the Swift API design guidelines.
In plain English
Swift is expressive and type-safe. let declares a constant and var a variable. Type inference is strong; annotate when the type is not obvious. Use interpolation to build strings.
let name = "Ada"
var count = 0
count += 1
print("Hello, \(name)! Count: \(count)")Your turn
EasyInterpolate a value
Print "Lesson: CSS" using a title constant.
SWIFT · starter
let title = "CSS"Check your understanding before moving on.
Knowledge checkQuestion 1
Which keyword declares a constant?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.