Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

loop backwards swift

for index in stride(from: 10, to: 5, by: -1) {
    print(index)
}
//10, 9, 8, 7, 6, 5

for index in stride(from: 10, through: 5, by: -1) {
    print(index)
}

//10, 9, 8, 7, 6, 5
 
PREVIOUS NEXT
Tagged: #loop #swift
ADD COMMENT
Topic
Name
4+7 =