I have an array of tuple, tuple contains array of struct Bill
let billDetails = [(name:String, bills:[Bill])]()
struct Bill {
var date: Date
}
The inner array bills is already sorted by the date property. Now I want to sort the outer array based on the inner array's first object's date property.
How to do this without force unwrapping?
billDetails = billDetails.sorted(by: { $0.bills.first!.date < $1.bills.first!.date })
$0.bills.first != nil && $.bills.first != nilisn't?Int.minandInt.max. Didn't know aboutdistantPastanddistantFuture. Thanks