Sorting nil Dates to the end of an Array
Maybe not the cleanest solution, but you can do it in one step with nil-coalescing.
objectArray.sort{ ($0.date ?? .distantPast) > ($1.date ?? .distantPast) }
Maybe not the cleanest solution, but you can do it in one step with nil-coalescing.
objectArray.sort{ ($0.date ?? .distantPast) > ($1.date ?? .distantPast) }