GitHub - IvanVorobei/SPPermission: Simple permission request with beautiful UI
source link: https://github.com/IvanVorobei/SPPermission
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
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 source/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 SPPermission
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)
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 SPPermission. Please, contact me via email. You can find it in the section Contacts
so that I added app here
License
SPPermission
is released under the MIT license. Check LICENSE.md for details
Contact
my apps in AppStore & in AppStore 2
If you need develop application or nice UI, write me
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK