Swift Tutorial II

Ok so in the first tutorial we covered let, which is the keyword for defining constants. let thisBeAConstant = 3.141 Now we are going to cover variables, which use the var keyword like so: var thisVariable = time Notice 2 things about Swift: 1) We don’t use ; at the end of a line.  That’s just weird 🙂 2) We don’t have to specify the type.  The type is inferred by whatever value you pass in, so: var someString = “this is a string” var someInteger = 5 So Swift is kinda smart.  Now let’s meet some old friends “Hao jiu bu juan” ARRAYS var energies = [“solar”, “wind”, “fossil”, “this is a… Read More

Continue Reading