swift sort array

Swift
var images : [imageFile] = []
images.sorted(by: { $0.fileID > $1.fileID })
let sortedUsers = users.sorted {
    $0.firstName < $1.firstName
}
Source

Also in Swift: