Skip to content

Instantly share code, notes, and snippets.

View lockwooddev's full-sized avatar
🐍
*productive hissing*

Carlo Smouter lockwooddev

🐍
*productive hissing*
View GitHub Profile
@lockwooddev
lockwooddev / gist:c5e0ff8887ab539502e7
Last active August 29, 2015 14:14
Swift: Functions
// Functions in Swift
func say(name: String) -> String {
return name
}
say("Hello World")
// Multiple parameters
// for loop value range smaller then
for i in 0..<10 {
println(i)
}
println()
// regular style for loop
for var a = 0; a < 10; a++ {
println(a)
var first = 0
var second = 1
var result = 0
do {
result = first + second
first = second
second = result
println(result)
} while result < 1000000000000