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

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

Requests an age range for the person signed in to iCloud on the device.

```
func requestAgeRange(ageGates threshold1: Int, _ threshold2: Int? = nil, _ threshold3: Int? = nil, in viewController: UIViewController) 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.

`viewController`

The view controller that anchors the system UI presentation. The system UI
appears modally over this view controller.

## Return Value

An [`AgeRangeService.Response`](/documentation/DeclaredAgeRange/AgeRangeService/Response) value containing either the person’s age range or an
indication that the person declined to share their age range.

## Discussion

Use [`requestAgeRange(ageGates:_:_:in:)`](/documentation/DeclaredAgeRange/AgeRangeService/requestAgeRange(ageGates:_:_:in:)-2go8c) to implement age-appropriate experiences in your app.
People who meet the minimum age requirements that you specify can access age-appropriate features and content.

This method presents a system-provided interface that explains what information a person shares with your app
and allows people to make an informed decision about providing their age range information to your app.

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)