Latest 0.5.1
Homepage https://github.com/BellAppLab/Permissionable
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

[![CI Status](http://img.shields.io/travis/Bell App Lab/Permissionable.svg?style=flat)](https://travis-ci.org/Bell App Lab/Permissionable)
Version
License
Platform

Usage

import Permissionable

class ViewController: UIViewController {
    func askPermission() {
        Permissions.Camera.request(self) { (success: Bool) -> Void in 
            if success {
                print("o/")
            }
        }
    }
    func askForPushPermission() {
        Permissions.Push.request(self, categories) { (success: Bool) -> Void in 
            if success {
                print("o/")
            }
        }
    }
}

//===================================================

import Permissionable

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    {...}

    func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
        Permissions.didFinishRegisteringForPushNotifications(error)
    }

    func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
        //Do domething with the token
        Permissions.didFinishRegisteringForPushNotifications(nil)
    }
}

//===================================================

import Permissionable

class UserHandler {
    func logout() {
        Permissions.reset()
    }
}

To run the example project, clone the repo, and run pod install from the Example directory first.

Localization

To localize this library, make sure you include the following entries in your Localizable.strings file:

"Yes" = "<Your translation>";

"No" = "<Your translation>";

"Please" = "<Your translation>"; //Default alert title

"Would you mind if we send you push notifications?" = "<Your translation>"; //Default message for push notifications

"Would you mind if we access your camera?" = "<Your translation>"; //Default message for the device's camera

"Would you mind if we access your photos?" = "<Your translation>"; //Default message for the user's photos

"Uh oh" = "<Your translation>"; //Default alert title for when things go wrong

"Looks like we can't access the camera... Would you like to go to the Settings app to check?" = "<Your translation>"; //Default message to prompt the user to fix a permission on the Settings app

"Looks like we can't access your photos... Would you like to go to the Settings app to check?" = "<Your translation>"; //Default message to prompt the user to fix a permission on the Settings app

Requirements

iOS 8+

Installation

Permissionable is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Permissionable"

Please note that this will install all possible permissions (and their related libraries as well), bloating up your app’s dependencies. Take a look at the commands below to find one that suits your needs:

pod "Permissionable/Camera"
pod "Permissionable/Photos"

Author

Bell App Lab, [email protected]

License

Permissionable is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Permissionable",
    "version": "0.5.1",
    "summary": "A simplified Swifty way of asking users for permissions on iOS, based on Cluster's Pre-Permissions.",
    "description": "A simplified Swifty way of asking users for permissions on iOS, inpired by Cluster's Pre-Permissions: https://github.com/clusterinc/ClusterPrePermissions",
    "homepage": "https://github.com/BellAppLab/Permissionable",
    "license": "MIT",
    "authors": {
        "Bell App Lab": "[email protected]"
    },
    "source": {
        "git": "https://github.com/BellAppLab/Permissionable.git",
        "tag": "0.5.1"
    },
    "social_media_url": "https://twitter.com/BellAppLab",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "frameworks": "UIKit",
    "default_subspecs": "All",
    "subspecs": [
        {
            "name": "Core",
            "dependencies": {
                "Alertable": [],
                "Defines": []
            },
            "source_files": "Pod/Classes/*.{swift}"
        },
        {
            "name": "Camera",
            "dependencies": {
                "Permissionable/Core": []
            },
            "frameworks": "AVFoundation",
            "source_files": "Pod/Classes/Camera/*.{swift}"
        },
        {
            "name": "Photos",
            "dependencies": {
                "Permissionable/Core": []
            },
            "frameworks": "Photos",
            "source_files": "Pod/Classes/Photos/*.{swift}"
        },
        {
            "name": "Location",
            "dependencies": {
                "Permissionable/Core": []
            },
            "frameworks": "CoreLocation",
            "source_files": "Pod/Classes/Location/*.{swift}"
        },
        {
            "name": "All",
            "dependencies": {
                "Permissionable/Core": [],
                "Permissionable/Camera": [],
                "Permissionable/Photos": [],
                "Permissionable/Location": []
            }
        }
    ]
}

Pin It on Pinterest

Share This