---
title: "setSelectedDates(_:animated:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicalendarselectionmultidate/setselecteddates(_:animated:)"
---

# setSelectedDates(_:animated:)

Updates the array of date component objects that represent selected dates in a calendar view, with an option to animate the change.

## Declaration

```swift
func setSelectedDates(_ selectedDates: [DateComponents], animated: Bool)
```

## Parameters

- `selectedDates`: An array of date component objects that represent dates to select in a calendar view.
- `animated`: A Boolean value that indicates whether the calendar view should animate changing the selected dates.

## See Also

### Updating the selected dates

- [selectedDates](uikit/uicalendarselectionmultidate/selecteddates.md)
