Lets say I have the following array of Bus objects:
var buses = [Bus]()
It's so simple by sort method in swift,
let sortedBuses = buses.sort({ $0.number > $1.number })
or
buses.sortInPlace({ $0.number > $1.number }) // this sorts arrays and saves it in self.