Type Safety and Aliases
Swift is type safe: a variable keeps its type. typealias names an existing type, and type inference keeps code short.
Example
typealias Score = Int
var s: Score = 90
let inferred = 3.5
print(s, type(of: inferred))Exercise
Name an existing type.
Id = IntQuiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.