Sort array in descending order

 Problem

I have an Array and want to sort its contents (numeric or lexicographically) in descending order.



 Recipe


// Initialize the Array
var a = [6,3,2,1,5,4]

// Sort (descending) its elements

a = a.sort { $0 > $1 }
print(a)
				


 Playground