SystemServicePermissioner

open class SystemServicePermissioner

A class to ask a user to grant access to different system-level services, such as CoreMotion, HealthKit and Notification delivery.

Works together with SystemService.

  • Attempts to find out whether permission to the respective service has already been granted.

    Declaration

    Swift

    open func hasPermission(for service: SystemService) -> Bool

    Parameters

    service

    The SystemService to inquire for

    callback

    A block to be executed when status has been determined; executed on the main queue

  • Requests permission to the specified system service, asynchronously.

    Declaration

    Swift

    open func requestPermission(for service: SystemService, callback: @escaping ((Error?) -> Void))

    Parameters

    service

    The SystemService to request access to

    callback

    A block to be executed when the request has been granted or denied; executed on the main queue