April 2017
Intermediate to advanced
316 pages
9h 33m
English
In Swift, it is possible to annotate types, or in other words, explicitly specify the type of a variable or expression. Let's look at the following example:
let pi: Double = 3.14159 let piAndPhi: (Double, Double) = (3.14159, 1.618) func ourFunction(a: Int) { /* ... */ }
In this example, we define a constant (pi) annotated as Double, a tuple named piAndPhi annotated as (Double, Double), and a parameter of ourFunction as Int.
Read now
Unlock full access