sort array of nsobjects in swift code example Example: swift sort array let sortedUsers = users.sorted { $0.firstName < $1.firstName }