Swift Integer Array – Sort in Increasing Order
To sort an integer array in increasing order in Swift, call
sort() method on this array.
sort() method sorts this array in place, and by default, in ascending order.
In the following program, we will take an array of integers and sort them in increasing order using sort() method.
var arr = [2, 8, 1, 9, 4, 7] arr.sort() print(arr)
In this Swift Tutorial, we learned how to sort an Integer Array in increasing order using sort() method.