I have an array of Contact objects:
Contact
var contacts:[Contact] = [Contact]()
Contact class:
Class Contact:NSOBjec
that worked for my array[String] in Swift 3 and it seems in Swift 4 is ok
array = array.sorted{$0.compare($1, options: .numeric) == .orderedAscending}