One Logo Pool Ball
DeclaredAgeRange · IOS API REFERENCE

AgeRangeService

struct · iOS 26.0+ · SDK 27.1

struct AgeRangeService

A request for the age range of a person logged onto the current device. Use `AgeRangeService` to request a person's age range and manage their access to content on your app. This service enables you to create age-appropriate experiences while respecting people's privacy and meeting regulatory requirements. The system presents an interface that describes the data you're requesting and asks people to grant permission to share their age range with your app. The following code demonstrates how to request a person's age range and determine what content to display on your app's landing page based on their age group: @TabNavigator { @Tab("SwiftUI") { ```swift import SwiftUI import DeclaredAgeRange @Environment(\.requestAgeRange) var requestAgeRange func checkAgeRange() async { guard let response = try? await requestAgeRange(ageGates: 13, 15, 18), case let .sharing(ageRange) = response else { return // Person declined sharing, or other error. } guard let lowerBound = ageRange.lowerBound else { // Person is under 13; enable age-appropriate experience. return } if lowerBound >= 18 { // Enable features for age 18 and older. } else if lowerBound >= 15 { // Enable features for ages 15-17. } else { // Enable features for ages 13-14. } } ``` } @Tab("UIKit and AppKit") { ```swift // import UIKit for iOS and iPadOS. // import AppKit for macOS. import DeclaredAgeRange func checkAgeRange() async { guard let response = try? await requestAgeRange( ageGates: 13, 15, 18, in: viewControllerOrWindow // Use UIViewController in UIKit or NSWindow in AppKit. ), case let .sharing(ageRange) = response else { return // Person declined sharing, or other error. } guard let lowerBound = ageRange.lowerBound else { // Person is under 13; enable age-appropriate experience. return } if lowerBound >= 18 { // Enable features for age 18 and older. } else if lowerBound >= 15 { // Enable features for ages 15-17. } else { // Enable features for ages 13-14. } } ``` } } The system may override your age gates based on the local regulations of the person's geographic location. Age ranges provide the minimum information necessary for content decisions while protecting privacy. Parental controls and family sharing settings may affect the availability and accuracy of age information.

Members (5)

get · iOS 26.2+

isEligibleForAgeFeatures

TypeScript
get isEligibleForAgeFeatures(): Promise<boolean>
Swift declaration
var isEligibleForAgeFeatures: Bool { get async throws }

A Boolean value that indicates whether an adult, teen, or child is eligible for age-gated features. Before implementing age-gated features in your app, check whether the person using your app is in a region that requires Age Assurance. For more information, refer to [Next steps for apps distributed in Texas](https://developer.apple.com/news/?id=2ezb6jhj). Use <doc://com.apple.documentation/documentation/DeclaredAgeRange/AgeRangeService/isEligibleForAgeFeatures> to determine whether associated laws or regulations may apply to your app based on the person's location and account settings. This property returns `true` when your app needs to support Age Assurance for the current user. In macOS, <doc://com.apple.documentation/documentation/DeclaredAgeRange/AgeRangeService/isEligibleForAgeFeatures> returns `false` because the system doesn't require Age Assurance for the person or device. However, you can still call `requestAgeRange` in macOS to get the declared age range. - Returns: `true` if your app is eligible for age-gated features; otherwise, `false`. - Throws: ``Error/notAvailable`` if it's unavailable.

method · iOS 26.0+

requestAgeRange

TypeScript
requestAgeRange(threshold1: number, threshold2: (number) | null, threshold3: (number) | null, viewController: _UIKit_UIViewController): Promise<AgeRangeService_Response>
Swift declaration
func requestAgeRange(ageGates threshold1: Int, _ threshold2: Int? = nil, _ threshold3: Int? = nil, in viewController: UIViewController) async throws -> AgeRangeService.Response

Requests an age range for the person signed in to iCloud on the device. Use ``requestAgeRange(ageGates:_:_:in:)`` 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. - 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. - Returns: An ``AgeRangeService/Response`` value containing either the person's age range or an indication that the person declined to share their age range. - Throws: An ``AgeRangeService/Error`` when the request fails.

get · iOS 26.4+

requiredRegulatoryFeatures

TypeScript
get requiredRegulatoryFeatures(): Promise<Array<AgeRangeService_RegulatoryFeature>>
Swift declaration
var requiredRegulatoryFeatures: Set<AgeRangeService.RegulatoryFeature> { get async throws }

A set of regulatory features that are required for the person. Use this property to determine which regulatory features apply to a person using your app based on their region and account settings. This helps you comply with regional requirements when distributing apps on the App Store. For more information, refer to [Next steps for apps distributed in Texas](https://developer.apple.com/news/?id=2ezb6jhj). - Returns: A set of ``RegulatoryFeature`` values indicating which regulatory requirements apply to the person. - Throws: ``Error/notAvailable`` if the regulatory feature's service is unavailable.

method · iOS 26.4+

showSignificantUpdateAcknowledgment

TypeScript
showSignificantUpdateAcknowledgment(windowScene: _UIKit_UIWindowScene, updateDescription: string): Promise<void>
Swift declaration
@MainActor func showSignificantUpdateAcknowledgment(in windowScene: UIWindowScene, updateDescription: String) async throws

Displays a system-provided interface for people to acknowledge a significant app update. Call this function to inform people that your app has undergone a significant change that requires their acknowledgment. For more information on what constitutes a significant app change, refer to <doc://com.apple.documentation/documentation/PermissionKit/SignificantAppUpdateTopic>. > Important: Before calling this function, check ``AgeRangeService/RegulatoryFeature`` > to determine if a person must acknowledge your significant app change. - Parameters: - windowScene: A window scene that presents the acknowledgment interface. - updateDescription: A clear description of what changed in your app and why acknowledgment is required. - Throws: An error if the feature isn't available.

get · iOS 26.0+

shared

TypeScript
static get shared(): AgeRangeService
Swift declaration
static let shared: AgeRangeService

The singleton app instance for accessing age range services. Use `shared` to access the ``AgeRangeService`` instance in your app.

Skipped declarations

No declarations were skipped in this snapshot.

All DeclaredAgeRange types →