RSDMotionAuthorization

public final class RSDMotionAuthorization : RSDAuthorizationAdaptor

RSDMotionAuthorization is a wrapper for the CoreMotion library that allows a general-purpose step or task to query this library for authorization if and only if that library is required by the application.

Before using this adaptor with a permission step, the calling application or framework will need to register the adaptor using RSDAuthorizationHandler.registerAdaptorIfNeeded().

Seealso

RSDPermissionsStepViewController
  • This adaptor is intended for checking for motion sensor permissions.

    Declaration

    Swift

    public let permissions: [RSDPermissionType]
  • Returns the authorization status for the motion sensors.

    Declaration

    Swift

    public func authorizationStatus(for permission: String) -> RSDAuthorizationStatus
  • Requests permission to access the motion sensors.

    Declaration

    Swift

    public func requestAuthorization(for permission: RSDPermission, _ completion: @escaping ((RSDAuthorizationStatus, Error?) -> Void))
  • Returns authorization status for .motion permission.

    Declaration

    Swift

    public static func authorizationStatus() -> RSDAuthorizationStatus
  • Request authorization for access to the motion and fitness sensors.

    Declaration

    Swift

    static public func requestAuthorization(_ completion: @escaping ((RSDAuthorizationStatus, Error?) -> Void))