I have a class:
class Rates{
var price:Double?
}
Multidimensional Array:
var rates:[[Rates]] = [[],[],[],[],[]]
I am trying to sort every array in rates from smallest Double to Largest. Here is what I tried
for x in 0 ..< 4 {
self.shippingRates[x].sort({ (Rates, Rates2) -> Bool in
return Rates.price < Rates2.price
})
}
But for some reason the sort isn't working, when i display the data it doesn't show up sorted. What am I doing wrong?