How do you sort an array of structs in swift
Sort within the same array variable Sort functions bellow are exactly the same, the only difference how short and expressive they are: Full declaration: myArr.sort { (lhs: EntryStruct, rhs: EntryStruct) -> Bool in // you can have additional code here return lhs.deadline < rhs.deadline } Shortened closure declaration: myArr.sort { (lhs:EntryStruct, rhs:EntryStruct) in return lhs.deadline … Read more