Skip to content

Instance Method

maximumRange(of:)

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
The maximum range limits of the values that a given component can take on.
func maximumRange(of component: Calendar.Component) -> Range<Int>?

Parameters

component

A component to calculate a range for.

Return Value

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

Discussion

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