Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift ui for loop high to low

for index in stride(from: 5, to: 1, by: -1) {
    print(index)
}
//prints 5, 4, 3, 2

for index in stride(from: 5, through: 1, by: -1) {
    print(index)
}
//prints 5, 4, 3, 2, 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #ui #loop #high
ADD COMMENT
Topic
Name
8+4 =