To answer your specific question, the
: is used to specify the type of a variable, as in
var i : Int. Swift is pretty good at inferring the type of a variable, but, sometimes needs a little help, so you sometimes have to explicitly state the type of the variable, or, sometimes you explicitly type the variable to remind yourself. Another example is in
var x = 3, where you really want
x to be a
Double. The compiler is going to infer that
x is actually an
Int so that you have to do something like
var x : Double = 3 to get what you want.
= is an operator used to set an initial value, in the context of your question. So,
let i : Int = 3 explicitly states that
i is unequivocally an
Int with an initial value of 3. You could also write
let i = 3 and the compiler will do some more work to infer that the type of
i is an
But, as @xAlien95 stated about, the Swift Programming Language book goes into a lot more detail about variables, types, properties, initialization, and related topics. It is going to be your new best friend when it comes to Swift.