PermissionScope

Undocumented

  • Header UILabel with the message Hey, listen! by default.

    Declaration

    Swift

    public let headerLabel                 = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 50))
  • Header UILabel with the message We need a couple things\r\nbefore you get started. by default.

    Declaration

    Swift

    public let bodyLabel                   = UILabel(frame: CGRect(x: 0, y: 0, width: 240, height: 70))
  • Color for the close button’s text color.

    Declaration

    Swift

    public var closeButtonTextColor        = UIColor(red: 0, green: 0.47, blue: 1, alpha: 1)
  • Color for the permission buttons’ text color.

    Declaration

    Swift

    public var permissionButtonTextColor   = UIColor(red: 0, green: 0.47, blue: 1, alpha: 1)
  • Color for the permission buttons’ border color.

    Declaration

    Swift

    public var permissionButtonBorderColor = UIColor(red: 0, green: 0.47, blue: 1, alpha: 1)
  • Width for the permission buttons.

    Declaration

    Swift

    public var permissionButtonΒorderWidth  : CGFloat = 1
  • Corner radius for the permission buttons.

    Declaration

    Swift

    public var permissionButtonCornerRadius : CGFloat = 6
  • Color for the permission labels’ text color.

    Declaration

    Swift

    public var permissionLabelColor:UIColor = .blackColor()
  • Font used for all the UIButtons

    Declaration

    Swift

    public var buttonFont:UIFont            = .boldSystemFontOfSize(14)
  • Font used for all the UILabels

    Declaration

    Swift

    public var labelFont:UIFont             = .systemFontOfSize(14)
  • Close button. By default in the top right corner.

    Declaration

    Swift

    public var closeButton                  = UIButton(frame: CGRect(x: 0, y: 0, width: 50, height: 32))
  • Offset used to position the Close button.

    Declaration

    Swift

    public var closeOffset                  = CGSizeZero
  • Color used for permission buttons with authorized status

    Declaration

    Swift

    public var authorizedButtonColor        = UIColor(red: 0, green: 0.47, blue: 1, alpha: 1)
  • Color used for permission buttons with unauthorized status. By default, inverse of authorizedButtonColor.

    Declaration

    Swift

    public var unauthorizedButtonColor:UIColor?
  • Callback called when permissions status change.

    Declaration

    Swift

    public var onAuthChange: authClosureType? = nil
  • Callback called when the user taps on the close button.

    Declaration

    Swift

    public var onCancel: cancelClosureType?   = nil
  • Called when the user has disabled or denied access to notifications, and we’re presenting them with a help dialog.

    Declaration

    Swift

    public var onDisabledOrDenied: cancelClosureType? = nil
  • View controller to be used when presenting alerts. Defaults to self. You’ll want to set this if you are calling the request* methods directly.

    Declaration

    Swift

    public var viewControllerForAlerts : UIViewController?
  • Undocumented

  • Designated initializer.

    Declaration

    Swift

    public init(backgroundTapCancels: Bool)

    Parameters

    backgroundTapCancels

    True if a tap on the background should trigger the dialog dismissal.

  • Convenience initializer. Same as init(backgroundTapCancels: true)

    Declaration

    Swift

    public convenience init()
  • Undocumented

  • Undocumented

  • Undocumented

  • Adds a permission configuration to PermissionScope.

    Declaration

    Swift

    @objc public func addPermission(permission: Permission, message: String)

    Parameters

    config

    Configuration for a specific permission.

    message

    Body label’s text on the presented dialog when requesting access.

  • Returns the current permission status for accessing LocationAlways.

    Declaration

    Swift

    public func statusLocationAlways() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to LocationAlways, if necessary.

    Declaration

    Swift

    public func requestLocationAlways()
  • Returns the current permission status for accessing LocationWhileInUse.

    Declaration

    Swift

    public func statusLocationInUse() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to LocationWhileInUse, if necessary.

    Declaration

    Swift

    public func requestLocationInUse()
  • Returns the current permission status for accessing Contacts.

    Declaration

    Swift

    public func statusContacts() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to Contacts, if necessary.

    Declaration

    Swift

    public func requestContacts()
  • Returns the current permission status for accessing Notifications.

    Declaration

    Swift

    public func statusNotifications() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to User Notifications, if necessary.

    Declaration

    Swift

    public func requestNotifications()
  • Returns the current permission status for accessing the Microphone.

    Declaration

    Swift

    public func statusMicrophone() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to the Microphone, if necessary.

    Declaration

    Swift

    public func requestMicrophone()
  • Returns the current permission status for accessing the Camera.

    Declaration

    Swift

    public func statusCamera() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to the Camera, if necessary.

    Declaration

    Swift

    public func requestCamera()
  • Returns the current permission status for accessing Photos.

    Declaration

    Swift

    public func statusPhotos() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to Photos, if necessary.

    Declaration

    Swift

    public func requestPhotos()
  • Returns the current permission status for accessing Reminders.

    Declaration

    Swift

    public func statusReminders() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to Reminders, if necessary.

    Declaration

    Swift

    public func requestReminders()
  • Returns the current permission status for accessing Events.

    Declaration

    Swift

    public func statusEvents() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to Events, if necessary.

    Declaration

    Swift

    public func requestEvents()
  • Returns the current permission status for accessing Bluetooth.

    Declaration

    Swift

    public func statusBluetooth() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to Bluetooth, if necessary.

    Declaration

    Swift

    public func requestBluetooth()
  • Returns the current permission status for accessing Core Motion Activity.

    Declaration

    Swift

    public func statusMotion() -> PermissionStatus

    Return Value

    Permission status for the requested type.

  • Requests access to Core Motion Activity, if necessary.

    Declaration

    Swift

    public func requestMotion()
  • Shows the modal viewcontroller for requesting access to the configured permissions and sets up the closures on it.

    Declaration

    Swift

    @objc public func show(authChange: authClosureType? = nil, cancelled: cancelClosureType? = nil)

    Parameters

    authChange

    Called when a status is detected on any of the permissions.

    cancelled

    Called when the user taps the Close button.

  • Hides the modal viewcontroller with an animation.

    Declaration

    Swift

    public func hide()