---
title: "requestAgeRange(ageGates:_:_:in:)"
framework: declaredagerange
role: symbol
role_heading: Instance Method
path: "declaredagerange/agerangeservice/requestagerange(agegates:_:_:in:)-4yo3r"
---

# requestAgeRange(ageGates:_:_:in:)

Requests an age range for the person logged onto iCloud on the device.

## Declaration

```swift
func requestAgeRange(ageGates threshold1: Int, _ threshold2: Int? = nil, _ threshold3: Int? = nil, in window: NSWindow) async throws -> AgeRangeService.Response
```

## Parameters

- `threshold1`: The primary age threshold for your app.
- `threshold2`: An optional second age threshold that creates an additional age range.
- `threshold3`: An optional third age threshold that creates a final age range.
- `window`: The window that anchors the system UI presentation. The system UI appears as an interface or popover attached to this window.

## Return Value

Return Value An AgeRangeService.Response value indicating whether the person shared their age range.

## Discussion

Discussion This method presents a system-provided interface that allows people to share their age information with your app. The interface explains what information will be shared and gives people control over whether to provide this information. The system may return age ranges that override the age gates you specify based on the person’s location and applicable regulations. When local regulations require specific age gates, the returned age range reflects regulatory requirements rather than the bounds of your age gates. note: An AgeRangeService.Error when the request fails.

## See Also

### Getting the age range

- [AgeRangeService.AgeRangeDeclaration](declaredagerange/agerangeservice/agerangedeclaration.md)
- [AgeRangeService.AgeRange](declaredagerange/agerangeservice/agerange.md)
- [requestAgeRange(ageGates:_:_:in:)](declaredagerange/agerangeservice/requestagerange(agegates:_:_:in:)-2go8c.md)
- [AgeRangeService.Response](declaredagerange/agerangeservice/response.md)
- [AgeRangeService.ParentalControls](declaredagerange/agerangeservice/parentalcontrols.md)
