AREK is a clean and easy to use wrapper over any kind of iOS permission.
let permission = ArekPhoto()
permission.status { (status) in
switch status {
case .Authorized:
print("Yoah! :white_check_mark:")
case .Denied:
print("! :no_entry:️ !" )
case .NotDetermined:
print("! !" )
}
}
let permission = ArekEvent()
permission.manage { (status) in
switch status {
case .Authorized:
symbol = ":white_check_mark:"
case .Denied:
symbol = ":no_entry:️"
case .NotDetermined:
symbol = ""
}
}
Each permission type included in AREK is configurable through the ArekConfiguration struct. Each permission has a default configuration, so if you are happy with the basic configuration you don't have to take care about how it works behind the scenes.
An ArekConfiguration is made up by:
frequency: ArekPermissionFrequency (.Always, .EveryHour, .OnceADay, .OnceAWeek, .JustOnce) This frequency value is related to how often you want to the user to re-enable a permission if that one has been disallowed.
Set by default to .OnceADay
presentInitialPopup: Bool This is an initial popup used to ask kindly to the user to allow a permission. This is useful to avoid burning the possibility to show the system popup.
Set by default to true
presentReEnablePopup: Bool This is the popup used to kindly to the user to re-enable that permission. The frequency value is related to this popup.
Set by defaul to true
You could add to your Podfile the line
use_frameworks! target 'MyTarget' do pod 'arek', '~> 0.0.5' end
Add https://github.com/ennioma/arek/tree/master/arek/arek/Arek folder to your project.
Contributions are welcome
AREK is available under the MIT license. See the LICENSE file for more info.