Swift coreData - formate a data e use-a no predicado

H. Eu tenho uma entidade chamada Agendadate e uma chamada AgendaEvent. AgendaEvent tem uma relação de muitos para muitos com AgendaDate (agendaDates).

no meu AgendaDate eu tenho um objeto datas (do tipo Data).

Estou usando um predicado assim:

fetchRequest.predicate = NSPredicate(format: "ANY agendaDates.dates == %@", date as CVarArg)

Estou tentando formatar datas para ter isso:

"dd MM aaaa" em vez de "aaaa MM dd hh: mm: ss"

Eu preciso comparar no predicado duas datas, mas sem o tempo? é possível?

ATUALIZAÇÃO ----- Aqui está minha função atualizada conforme você sugeriu:

func agendaEventsWithDate(date: Date) -> NSFetchRequest<AgendaEvent>
{
    // create a fetch request that will retrieve all the AgendaEvents.
    let fetchRequest = NSFetchRequest<AgendaEvent>(entityName: "AgendaEvent")

    // set the predicate to only keep AgendaEvents where the related AgendaDate's date matches the passed in date.
    let cal = Calendar.current
    let startOfDay = cal.startOfDay(for: eventDate)
    let endOfDay = cal.date(byAdding: .day, value: 1, to: startOfDay)!
    print(startOfDay)
    print(endOfDay)
    // fetchRequest.predicate = NSPredicate(format: "ANY agendaDates.agendaDates == %@", date as CVarArg)
     fetchRequest.predicate = NSPredicate(format: "SUBQUERY(agendaDates, $a, $a.dates >= %@ AND $a.dates < %@).@count > 0",
                                startOfDay as NSDate, endOfDay as NSDate)

    return fetchRequest
}

e aqui está a função que deve configurar a célula e receber apenas os eventos que têm a mesma data da data selecionada:

func configuringCell(cell: CalendarAgendaCell, indexPath: IndexPath) {
    for dates in calendar.selectedDates {
        for dateOfEvent in myEventDate {
            formatter.dateFormat = "dd MM yyyy"
            let dateToCompare = formatter.string(from: dates)
            formatter.dateFormat = "dd-MM-yyyy"
            let comparingDate = formatter.date(from: dateToCompare)!
            if dateOfEvent == dateToCompare {
                myTempEvents = try! context.fetch(agendaEventsWithDate(date: comparingDate))
                let myEvent = myTempEvents[indexPath.row]
                cell.configureCell(agendaEvent: myEvent)

            } else {
               // the array is empty

            }
        }
    }
}

questionAnswers(1)

yourAnswerToTheQuestion