I am filtering an array based on a set filter supplied to the view (this filter varies) but want to modify the function to allow for an empty filter, i.e return the original array un filtered. I feel like this should be a simple matter but I'm currently a bit lost - have looked at the .isEmpty modifier and a couple of different IF statements but I'm not "getting it"
var categoryFilter:String
var filteredCategoryTasks: [Task] {
modelData.tasks.filter { task in
(task.category == categoryFilter)
}
}