Skip to content

matrixdekoder/RequestPermission

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This project is about managing permissions with the customizable visual effects. Beautiful dialog increases the chance of approval (which is important when we request notification). Simple control of this module saves you hours of development. You can start using this project with just two lines of code and easy customization! You can see how I am designed UI and how use pod tutorial on youtube

Preview GIF loading [4mb]. Please, wait

The project is absolutely free, but but it takes time to support and update it. Your support is very motivating and very important. I often receive emails asking me to update or add functionality. Small donate for a cup of coffee helps to develop the project and make it better

Requirements

Swift 4.2. Ready for use on iOS 10+

Integration

Drop in Sparrow folder to your Xcode project. Make sure to enable Copy items if needed and Create groups

Or via CocoaPods:

pod 'SPPermission'

How to use

Call SPRequestPermission and use func request(). Also passed controller, on which dialog should present

class ViewController: UIViewController {

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        SPPermission.Dialog.request(with: [.camera, .microphone, .notification], on: self)
    }
}

If you want to know if you have received permission, you should call the function:

let isAvailableCamera = SPPermission.isAllow(.сamera)

Available Permissions

Delegate

To track events hide & allowed permission associated with SPPermission, implement the protocol SPPermissionDialogDelegate and pass the delegate

SPPermission.Dialog.request(
    with: [.calendar, .microphone],
    on: self,
    delegate: self
)

DataSource

If you want to change the text, you need to implement the SPPermissionDialogDataSource protocol. Redefine the needed parameters to see the changes. In the project you can find an example

SPPermission.Dialog.request(
    with: [.photoLibrary, .contacts],
    on: self,
    delegate: self,
    dataSource: self
)

if you want add or remove close button (for close dialog, need swipe it), you need ovveride parametr showCloseButton

Apps, using lib

I like the idea to specify applications that use the RequestPermission. Please, contact me via email. You can find it in the section Contacts so that I added app here

License

RequestPermission is released under the MIT license. Check LICENSE.md for details

Contact

@ivanvorobei in telegram

https://hello.ivanvorobei.by

https://ivanvorobei.by

hello@ivanvorobei.by

my apps in AppStore & in AppStore 2

If you need develop application or nice UI, write me

About

Simple permission request with beautiful UI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 99.4%
  • Ruby 0.6%