A set of methods you use to add custom restrictions for the Guided Access feature in iOS.


protocol UIGuidedAccessRestrictionDelegate


Custom restrictions are represented by string identifiers provided by the developer in the guidedAccessRestrictionIdentifiers method. Each identifier represents an operation in the app that the developer wishes to allow users to restrict using Guided Access. The default for all operations is allow. Users can deny operations using the normal Guided Access user interface. See for a description of how to enable and configure Guided Access on iOS.

Apps describe their custom restrictions by implementing the textForGuidedAccessRestriction(withIdentifier:) and detailTextForGuidedAccessRestriction(withIdentifier:) methods to return appropriate localized, human-readable strings.

For example, a photo editing app might allow users to disable deleting photos. The app would return an identifier representing this restriction in its guidedAccessRestrictionIdentifiers method. It would also implement textForGuidedAccessRestriction(withIdentifier:) to provide a human-readable description of the restriction. Finally, the app would implement guidedAccessRestriction(withIdentifier:didChange:) to notice when a user indicates that they want to enable the restriction. When the app sees the state change to “deny”, it would configure itself to prevent the deletion of photos by any means. Similarly, when the app sees the state change to “allow”, it would configure itself to allow photo deletion.

Apps can use the guidedAccessRestrictionState(forIdentifier:) function to check the state of a restriction at any time.


Identifying Custom Guided Access Restrictions

var guidedAccessRestrictionIdentifiers: [String]?

Returns an array of strings identifying custom restrictions.


func textForGuidedAccessRestriction(withIdentifier: String) -> String?

Returns a succinct description of the restriction for the provided identifier.


func detailTextForGuidedAccessRestriction(withIdentifier: String) -> String?

Returns more detailed information about the restriction for the provided identifier.

Implementing Restrictions

func guidedAccessRestriction(withIdentifier: String, didChange: UIAccessibility.GuidedAccessRestrictionState)

Tells the delegate that the restriction associated with the identifier has changed state.



enum UIAccessibility.GuidedAccessRestrictionState

The state of a restriction, either allow or deny.


Inherits From

See Also

Guided Access

static func guidedAccessRestrictionState(forIdentifier: String) -> UIAccessibility.GuidedAccessRestrictionState

Returns the restriction state for the specified guided access restriction.