---
title: "calendarView(_:didSelectDate:at:sender:)"
framework: CareKit
role: symbol
role_heading: Instance Method
platforms: [iOS 13.0+, Mac Catalyst 13.0+, watchOS 7.0+]
path: "carekit/ockweekcalendarpageviewcontroller/calendarview(_:didselectdate:at:sender:)"
---

# calendarView(_:didSelectDate:at:sender:)

Notifies the delegate that a date has been selected in the calendar view.

## Declaration

```swift
func calendarView(_ calendarView: UIView & OCKCalendarDisplayable, didSelectDate date: Date, at index: Int, sender: Any?)
```

## Parameters

- `calendarView  `: The view that displays the calendar.
- `date  `: The date that you selected in the calendar.
- `index  `: The index of the date that you select, with respect to the collection of days in the current dateInterval.
- `sender  `: The object that initiated the selection.

## See Also

### Handling Calendar Changes

- [selectDate(_:animated:)](carekit/ockweekcalendarpageviewcontroller/selectdate(_:animated:).md)
