I have array and need to reverse it without Array.reverse
method, only with a for
loop.
var names:[String] = ["Apple", "Microsoft", "Sony", "Lenovo", "Asus"]
I have array and need to reverse it without Array.reverse
method, only with a for
loop.
var names:[String] = ["Apple", "Microsoft", "Sony", "Lenovo", "Asus"]
Do it like this for reversed sorting.
I like simple codes.
var names:[String] = ["Apple", "Microsoft", "Sony", "Lenovo", "Asus"]
A more simple way :)
Swift 3:
Here is how I did it and there is no warning for Swift 3
or just simply
You can use the swift3 document: