11.2. Decreasing order
//function to compare two values to find which if value1 is greater than value2...
func decreasing(value1:Int, value2:Int)->Bool{
return value1 > value2
}var arrayOfInt:[Int] = [1,56,89,23,4,6]
//sort the array by using the comparator function decreasing...
arrayOfInt.sort(by: decreasing)
print(arrayOfInt)
//prints: [89, 56, 23, 6, 4, 1]Do it using closures (not functions)
Last updated