Labeled Statements
Target outer loops with named labels.
What Is a Label
A statement label names a loop so you can target it precisely with break or continue.
outer: for i in 1...3 {
print("row", i)
}Label Syntax
Write the label name followed by a colon directly before the loop keyword.
search: for n in 1...5 {
print(n)
if n == 3 { break search }
}