---
title: UIDatePicker.Mode.yearAndMonth
framework: uikit
role: symbol
role_heading: Case
path: uikit/uidatepicker/mode/yearandmonth
---

# UIDatePicker.Mode.yearAndMonth

A mode that displays the date in months and years.

## Declaration

```swift
case yearAndMonth
```

## Discussion

Discussion The exact order of these items depends on the locale setting. An example of this mode is “November | 2007”. important: You can only use this mode with the date picker style UIDatePickerStyle.wheels, and can’t use it on Mac Catalyst with the UIUserInterfaceIdiom.mac user interface idiom; otherwise, UIDatePicker throws an exception.

## See Also

### Constants

- [UIDatePicker.Mode.time](uikit/uidatepicker/mode/time.md)
- [UIDatePicker.Mode.date](uikit/uidatepicker/mode/date.md)
- [UIDatePicker.Mode.dateAndTime](uikit/uidatepicker/mode/dateandtime.md)
- [UIDatePicker.Mode.countDownTimer](uikit/uidatepicker/mode/countdowntimer.md)
