You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PAPermissions is a fully customizable and ready-to-run library to handle permissions through a ViewController
Right now it supports out of the box permissions for:
Bluetooth
Location
Notifications
Microphone
Camera
Contacts
Custom
NB: PAPermissions is written in Swift 2.2 and can be discontinued, if you are looking for the Swift 3 version of it, please check out the master branch
###Compatibility
PAPermissions requires iOS8+, compatible with both Swift 2/3 and Objective-C based projects
###Screenshots
It can be used with a plain background color
Or with a background image
###How it works
Create a new UIViewController, inherit from PAPermissionsViewController and write:
let microphoneCheck = PAMicrophonePermissionsCheck()
let cameraCheck = PACameraPermissionsCheck()
override func viewDidLoad() {
super.viewDidLoad()
//Custom settings
self.locationCheck.requestAlwaysAuthorization = true
let permissions = [
PAPermissionsItem.itemForType(.Microphone, reason: "Required to hear your beautiful voice")!,
PAPermissionsItem.itemForType(.Camera, reason: "Required to shoot awesome photos")!]
let handlers = [
PAPermissionsType.Microphone.rawValue: self.microphoneCheck,
PAPermissionsType.Camera.rawValue: self.cameraCheck]
self.setupData(permissions, handlers: handlers)
self.titleText = "My Awesome App"
self.detailsText = "Please enable the following"
}