swift sorted(by:) code example Example: swift how to sort array var images : [imageFile] = [] images.sorted(by: { $0.fileID > $1.fileID })