lets say we have a custom class named imageFile and this class contains two properties.
class imageFile { var fileName = String() var fileID = Int(
In Swift 3.0
images.sort(by: { (first: imageFile, second: imageFile) -> Bool in first. fileID < second. fileID })