I have a code that I need to run exactly n times in Swift. What is the shortest possible syntax for that?
n
I am currently using the for loop but
for
ABakerSmith's answer updated for Swift 4:
extension Int: Sequence { public func makeIterator() -> CountableRange.Iterator { return (0..
Use:
for i in 5 { //Performed 5 times }