iOS - Filter array of objects which contains today's date only

Viewed 4066

Basically my challenge is :

I got an array of objects . Each object has a date property . I want to get the array of objects which matches today's date.

So, I want to group the array based on date.

I want to show in history list by grouping objects from today, yesterday, last 7 days ,.....


I can sort array using sort function:

historylist.sort(by: {$0.createdDate! as Date > $1.createdDate! as Date })

But I need a filter function based on date. I want all the data in historicist which are created today only.

Any quick pseudo code .

Thanks.

2 Answers
Related