Returns the date components representing a given date.
- iOS 2.0+
- macOS 10.4+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The components into which to decompose
The date for which to perform the calculation.
NSDate object containing
date decomposed into the components specified by
date falls outside of the defined range of the receiver or if the computation cannot be performed.
The Weekday ordinality, when requested, refers to the next larger (than Week) of the requested units. Some computations can take a relatively long time.
The following example shows how to use this method to determine the current year, month, and day, using an existing calendar (