<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "visionOS: 1.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDatePicker/Mode/yearAndMonth",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UIDatePickerMode@UIDatePickerModeYearAndMonth"
  },
  "title" : "UIDatePicker.Mode.yearAndMonth"
}
-->

# UIDatePicker.Mode.yearAndMonth

A mode that displays the date in months and years.

```
case yearAndMonth
```

## 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 ``doc://com.apple.uikit/documentation/UIKit/UIDatePickerStyle/wheels``, and can’t use it on Mac Catalyst with the ``doc://com.apple.uikit/documentation/UIKit/UIUserInterfaceIdiom/mac`` user interface idiom; otherwise, ``doc://com.apple.uikit/documentation/UIKit/UIDatePicker`` throws an exception.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)