---
title: maximumAllowedDuration
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hksampletype/maximumallowedduration
---

# maximumAllowedDuration

The maximum duration if the sample type has a restricted duration.

## Declaration

```swift
var maximumAllowedDuration: TimeInterval { get }
```

## Return Value

Return Value The maximum time interval between the sample’s startDate and endDate properties.

## Discussion

Discussion This method throws an exception if isMaximumDurationRestricted is false.

## See Also

### Checking the Duration Restriction

- [isMinimumDurationRestricted](healthkit/hksampletype/isminimumdurationrestricted.md)
- [minimumAllowedDuration](healthkit/hksampletype/minimumallowedduration.md)
- [isMaximumDurationRestricted](healthkit/hksampletype/ismaximumdurationrestricted.md)
