If you want to present a native `UIAlertController` set the type to `.native` otherwise if you want to setup a `PMAlertController` set the type to `.codeido`.
## Localized Strings
**AREK** by convention expects to find localized strings in your Localizable files in order to configure the UI.
In the following table there are the configurations for:
- Pre-permission popup title
- Pre-permission popup message
- Re-enable popup title
- Re-enable popup message
- Popup image for that permission
- Allow button title
- Deny button title
Messages related to the iOS native permission popup should be configured following the conventions described here.
| Permission | Pre-permission Title | Pre-permission Message | Re-Enable Title | Re-Enable Message | Image | Allow Button Title | Deny Button Title |
| :-------------: | :-------------: | :-------------: | :-------------: | :---------------: | :---: | :----------------: | :---------------: |
| Camera | ArekCamera_initial_title | ArekCamera_initial_message | ArekCamera_reenable_title | ArekCamera_reenable_message | ArekCamera_image | ArekCamera_allow_button_title | ArekCamera_deny_button_title |
| CloudKit | ArekCloudKit_initial_title | ArekCloudKit_initial_message | ArekCloudKit_reenable_title | ArekCloudKit_reenable_message | ArekCloudKit_image | ArekCloudKit_allow_button_title | ArekCloudKit_deny_button_title
| Contacts | ArekContacts_initial_title | ArekContacts_initial_message | ArekContacts_reenable_title | ArekContacts_reenable_message | ArekContacts_image | ArekContacts_allow_button_title | ArekContacts_deny_button_title
| Events | ArekEvents_initial_title | ArekEvents_initial_message | ArekEvents_reenable_title | ArekEvents_reenable_message | ArekEvents_image | ArekEvents_allow_button_title | ArekEvents_deny_button_title |
| HealthKit | ArekHealth_initial_title | ArekHealth_initial_message | ArekHealth_reenable_title | ArekHealth_reenable_message | ArekHealth_image | ArekHealth_allow_button_title | ArekHealth_deny_button_title |
| Media Library | ArekMediaLibrary_initial_title | ArekMediaLibrary_initial_message | ArekMediaLibrary_reenable_title | ArekMediaLibrary_reenable_message | ArekMediaLibrary_image | ArekMediaLibrary_allow_button_title | ArekMediaLibrary_deny_button_title |
| Microphone | ArekMicrophone_initial_title | ArekMicrophone_initial_message | ArekMicrophone_reenable_title | ArekMicrophone_reenable_message | ArekMicrophone_image | ArekMicrophone_allow_button_title | ArekMicrophone_deny_button_title |
| Motion | ArekMotion_initial_title | ArekMotion_initial_message | ArekMotion_reenable_title | ArekMotion_reenable_message | ArekMotion_image | ArekMotion_allow_button_title | ArekMotion_deny_button_title |
| Notifications | ArekNotifications_initial_title | ArekNotifications_initial_message | ArekNotifications_reenable_title | ArekNotifications_reenable_message | ArekNotifications_image | ArekNotifications_allow_button_title | ArekNotifications_deny_button_title |
| Photo Library | ArekPhoto_initial_title | ArekPhoto_initial_message | ArekPhoto_reenable_title | ArekPhoto_reenable_message | ArekPhoto_image | ArekPhoto_allow_button_title | ArekPhoto_deny_button_title |
| Reminders | ArekReminders_initial_title | ArekReminders_initial_message | ArekReminders_reenable_title | ArekReminders_reenable_message | ArekReminders_image | ArekReminders_allow_button_title | ArekReminders_ deny_button_title|
| Siri | ArekSiri_initial_title | ArekSiri_initial_message | ArekSiri_reenable_title | ArekSiri_reenable_message | ArekSiri_image | ArekSiri_allow_button_title | ArekSiri_deny_button_title |
| Speech Recognizer | ArekSpeechRecognizer_initial_title | ArekSpeechRecognizer_initial_message | ArekSpeechRecognizer_reenable_title | ArekSpeechRecognizer_reenable_message | ArekSpeechRecognizer_image | ArekSpeechRecognizer_allow_button_title | ArekSpeechRecognizer_deny_button_title |
| Bluetooth | ArekBluetooth_initial_title | ArekBluetooth_initial_message | ArekBluetooth_reenable_title | ArekBluetooth_reenable_message | ArekBluetooth_image | ArekBluetooth_allow_button_title | ArekBluetooth_deny_button_title |
| Location | ArekBaseLocation_initial_title | ArekBaseLocation_initial_message | ArekBaseLocation_reenable_title | ArekBaseLocation_reenable_message | ArekBaseLocation_image | ArekBaseLocation_allow_button_title | ArekBaseLocation_deny_button_title |
# How to install AREK
## CocoaPods
Add AREK to your Podfile
```ruby
use_frameworks!
target 'MyTarget' do
pod 'arek', '~> 2.0.2'
end
```
If you want to install just a specific permission, let's say `Bluetooth`, you have to specify:
```ruby
use_frameworks!
target 'MyTarget' do
pod 'arek/Bluetooth', '~> 2.0.2'
end
```
```bash
$ pod install
```
## Carthage
```ruby
github "ennioma/arek" ~> 4.0.2
```
Then on your application target *Build Phases* settings tab, add a "New Run Script Phase". Create a Run Script with the following content:
```ruby
/usr/local/bin/carthage copy-frameworks
```
and add the following paths under "Input Files":
```ruby
$(SRCROOT)/Carthage/Build/iOS/arek.framework
$(SRCROOT)/Carthage/Build/iOS/PMAlertController.framework
```
## Swift Package Manager
```ruby
import PackageDescription
let package = Package(
name: "YourApp",
dependencies: [
.Package(url: "https://github.com/ennioma/arek.git", versionMajor: 2, minor: 0)
]
)
```
- Note that if you want to install a *Swift 3* version of Arek, the latest compatible version is the *1.7.0*.
- If you need to build it on Xcode 10, you have to point to the version `3.0.0`.
## Add AREK source code to your project
Add [https://github.com/ennioma/arek/tree/master/arek/arek/Arek](https://github.com/ennioma/arek/tree/master/arek/Classes) folder to your project.
π Take care about adding the ArekHealth class to your project. It includes HealthKit in your project, so if you do this without using HealthKit, your app will be rejected during the AppStore review.
# How to contribute
Contributions are welcome π If you'd like to improve this projects I've shared with the community, just open an issue or raise a PR from the current develop branch.
For any information or request feel free to contact me on twitter (@ennioma).
# TODO
- [] Provide a way to inject a custom PMAlertController in a permission
- [] Provide a way to inject the popup type when the `init()` is called on a permission
- [] Update the Swift Package Manager installation
# License and Credits
## License:
AREK is available under the MIT license. See the LICENSE file for more info.
## Arek on the Web:
1. [This week in Swift - Natasha The Robot](https://swiftnews.curated.co/issues/113#libraries)
2. [iOS Dev Weekly - Dave Verwer](https://iosdevweekly.com/issues/281#code)
## Credits:
Icones provided by `Freepik` and `Vectors Market` from `Flaticon`