---
title: "dateSelection(_:didSelectDate:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicalendarselectionsingledatedelegate/dateselection(_:didselectdate:)"
---

# dateSelection(_:didSelectDate:)

Informs the delegate that a user selected a date represented by date components.

## Declaration

```swift
func dateSelection(_ selection: UICalendarSelectionSingleDate, didSelectDate dateComponents: DateComponents?)
```

## Parameters

- `selection`: An object that tracks a date that a user selects from a calendar view.
- `dateComponents`: Date components that represent a date the user selected, or nil if the user deselected a date.
