Assuming you want a field length of 2 with leading zeros you'd do this:
for myInt in 1...3 { println(String(format: "%02d", myInt)) } This requires import Foundation so technically it is not a part of the Swift language but a capability provided by the Foundation framework.