iOS Developer Library

Developer

UIKit Framework Reference UIGuidedAccessRestrictionDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

UIGuidedAccessRestrictionDelegate

Adopting the UIGuidedAccessRestrictionDelegate protocol in your application delegate allows you to add custom restrictions for the Guided Access feature in iOS. More...

Inheritance


Not Applicable

Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 7.0 and later.
  • Returns an array of strings identifying custom restrictions. (required)

    Declaration

    Swift

    func guidedAccessRestrictionIdentifiers() -> [AnyObject]

    Objective-C

    - (NSArray *)guidedAccessRestrictionIdentifiers

    Return Value

    An array of NSString objects, each of which represents a custom restriction.

    Discussion

    Your delegate must implement this method and return an array with an identifier string for each custom guided access restriction you wish to provide in your app.

    Import Statement

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Returns a succinct description of the restriction for the provided identifier. (required)

    Declaration

    Swift

    func textForGuidedAccessRestrictionWithIdentifier(_ restrictionIdentifier: String) -> String!

    Objective-C

    - (NSString *)textForGuidedAccessRestrictionWithIdentifier:(NSString *)restrictionIdentifier

    Parameters

    restrictionIdentifier

    The identifer of the restriction the system is interested in.

    Return Value

    A localized, human-readable string that succinctly describes the restriction for the provided identifier.

    Import Statement

    import UIKit

    Availability

    Available in iOS 7.0 and later.

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

    Declaration

    Swift

    optional func detailTextForGuidedAccessRestrictionWithIdentifier(_ restrictionIdentifier: String) -> String!

    Objective-C

    - (NSString *)detailTextForGuidedAccessRestrictionWithIdentifier:(NSString *)restrictionIdentifier

    Parameters

    restrictionIdentifier

    The identifer of the restriction the system is interested in.

    Return Value

    A localized, human-readable string that provides additional information about the restriction for the provided identifier.

    Import Statement

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • The state of a restriction, either allow or deny.

    Declaration

    Swift

    enum UIGuidedAccessRestrictionState : Int { case Allow case Deny }

    Objective-C

    typedef enum : NSInteger { UIGuidedAccessRestrictionStateAllow, UIGuidedAccessRestrictionStateDeny } UIGuidedAccessRestrictionState;

    Constants

    • Allow

      UIGuidedAccessRestrictionStateAllow

      The app should allow the user to perform the action controlled by the restriction.

      Available in iOS 7.0 and later.

    • Deny

      UIGuidedAccessRestrictionStateDeny

      The app should deny the user from performing the action controlled by the restriction.

      Available in iOS 7.0 and later.

    Import Statement

    import UIKit

    Availability

    Available in iOS 7.0 and later.