Using NSSortDescriptor to sort Dates and nil values

Today I’ve been working on sorting tasks, as I’m using swiftUI and CoreData I use a FetchRequest with the following SortDescriptor: NSSortDescriptor(keyPath: \Task.targetDate, ascending: true) The idea being it will sort based on the task due date from smallest to the largest, meaning you’ll see the ones you should act on first at the top. …