<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeclaredAgeRange",
  "identifier" : "/documentation/DeclaredAgeRange/AgeRangeService/requestAgeRange(ageGates:_:_:in:)-4yo3r",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Declared Age Range"
    ],
    "preciseIdentifier" : "s:16DeclaredAgeRange0bC7ServiceV07requestbC08ageGates__2inAC8ResponseOSi_SiSgAISo8NSWindowCtYaKF"
  },
  "title" : "requestAgeRange(ageGates:_:_:in:)"
}
-->

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

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

```
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

An [`AgeRangeService.Response`](/documentation/DeclaredAgeRange/AgeRangeService/Response) value indicating whether the person shared their age range.

## 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.

> Throws: An ``doc://com.apple.declaredagerange/documentation/DeclaredAgeRange/AgeRangeService/Error`` when the request fails.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)