To create a loop from 1 to 100 in Swift, you can use a for loop. The syntax for a for loop in Swift is as follows:
main.swift51 chars4 lines
To loop from 1 to 100, you can set the starting value of index
to 1 and the ending value to 100:
main.swift47 chars4 lines
You can then add your desired code inside the curly braces {}
to be executed in each iteration of the loop.
gistlibby LogSnag