Sweet Loops
for section in sections {
var foundTheMagicalRow = false
for row in rows {
if row.isMagical {
foundTheMagicalRow = true
break
}
}
if foundTheMagicalRow {
//We found the magical row!
//No need to continue looping through our sections now.
break
}
}
is the same as:
sectionLoop: for section in sections {
rowLoop: for row in rows {
if row.isMagical {
break sectionLoop
}
}
}
from:
http://krakendev.io/