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