maximumRange(of:)

The maximum range limits of the values that a given component can take on in the receive

iOS
8.0+
macOS
10.10+
tvOS
9.0+
watchOS
2.0+
func maximumRange(of component: Calendar.Component) -> Range<Int>?

Parameters

component

A component to calculate a range for.

Returns

The range, or nil if it could not be calculated.

As an example, in the Gregorian calendar the maximum range of values for the Day component is 1-31.