---
title: "maximumRange(of:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nscalendar/maximumrange(of:)"
---

# maximumRange(of:)

Returns the maximum range limits of the values that a given unit can take on.

## Declaration

```swift
func maximumRange(of unit: NSCalendar.Unit) -> NSRange
```

## Parameters

- `unit`: The unit for which the maximum range is returned.

## Return Value

Return Value The maximum range limits of the values that the unit specified by unit can take on in the receiver.

## Discussion

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

## See Also

### Getting Calendar Information

- [calendarIdentifier](foundation/nscalendar/calendaridentifier.md)
- [firstWeekday](foundation/nscalendar/firstweekday.md)
- [locale](foundation/nscalendar/locale.md)
- [timeZone](foundation/nscalendar/timezone.md)
- [minimumRange(of:)](foundation/nscalendar/minimumrange(of:).md)
- [minimumDaysInFirstWeek](foundation/nscalendar/minimumdaysinfirstweek.md)
- [ordinality(of:in:for:)](foundation/nscalendar/ordinality(of:in:for:).md)
- [range(of:in:for:)](foundation/nscalendar/range(of:in:for:).md)
- [range(of:start:interval:for:)](foundation/nscalendar/range(of:start:interval:for:).md)
- [range(ofWeekendStart:interval:containing:)](foundation/nscalendar/range(ofweekendstart:interval:containing:).md)
- [NSCalendar.Unit](foundation/nscalendar/unit.md)
