---
title: "setSelected(_:animated:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicalendarselectionweekofyear/setselected(_:animated:)"
---

# setSelected(_:animated:)

Updates the date component object that represents a selected week in a calendar view, with an option to animate the change.

## Declaration

```swift
func setSelected(_ selectedWeekOfYear: DateComponents?, animated: Bool)
```

## See Also

### Updating the selected week

- [selectedWeekOfYear](uikit/uicalendarselectionweekofyear/selectedweekofyear.md)
