I have an array of Contact objects:
Contact
var contacts:[Contact] = [Contact]()
Contact class:
Class Contact:NSOBjec
How about:
contacts.sort() { [$0.last, $0.first].lexicographicalCompare([$1.last, $1.first]) }