Make permission request easier.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Lady.xcodeproj Updated to Swift 4.2 Sep 15, 2018
Lady 1.2.1 Sep 15, 2018
Proposer 1.2.1 Sep 15, 2018
.gitignore init Jul 10, 2015
.swift-version 1.2.1 Sep 15, 2018
LICENSE update version 0.9.1 Sep 8, 2016
Proposer.podspec 1.2.1 Sep 15, 2018 update readme Sep 15, 2018


Proposer provides a single API to request permission for access Camera, Photos, Microphone, Contacts, Reminders, Calendar, Location or Notifications.


Swift 4.2, iOS 8.0

(Swift 3, use version 1.1.0)


Only one single API:


In real world:

import Proposer
@IBAction func choosePhoto() {
    let photos: PrivateResource = .photos
    let propose: Propose = {
        proposeToAccess(photos, agreed: {
            print("I can access Photos. :]\n")
            if UIImagePickerController.isSourceTypeAvailable(.savedPhotosAlbum) {
                let imagePicker = UIImagePickerController()
                imagePicker.sourceType = .savedPhotosAlbum
                self.present(imagePicker, animated: true, completion: nil)
        }, rejected: {
    showProposeMessageIfNeedFor(photos, andTryPropose: propose)

When you want to get user's location, thanks to Swift's enum, you can even choose the usage mode:

@IBAction func shareLocation() {
    let location: PrivateResource = .location(.whenInUse)
    let propose: Propose = {
        proposeToAccess(location, agreed: {
            print("I can access Location. :]\n")
        }, rejected: {
    showProposeMessageIfNeedFor(location, andTryPropose: propose)

Depending on your needs, you must add a NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist

See the demo for more information.

I recommend you add a UIViewController+Proposer.swift file (like the demo) for show localized alert before the first proposal or when propose failed.


Feel free to drag Proposer.swift to your iOS Project. But it's recommended to use Carthage (or CocoaPods).


github "nixzhu/Proposer"


pod 'Proposer'


NIX @nixzhu


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