PrivacyKit

Version License Platform CI Status Coverage Status Codacy Badge

Documentation

Example

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

Basic Example Screenshot

Installation

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

pod 'PrivacyKit'

Basic Usage

To configure PrivacyKit globally, do so from the AppDelegate.application(didFinishLaunchingWithOptions) function.

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        /** Configure PrivacyKit Globally */
        PrivacyKit.shared.config("https://github.com/ithazfire/PrivacyKit",
                                 "https://github.com/ithazfire/PrivacyKit/wiki")

        /** Use Custom Style (Colors & Fonts) **/        PrivacyKit.shared.setStyle(CustomPrivacyKitStyle())

        /** User Blur Effect Over Presenting View Controller **/          PrivacyKit.shared.setBlurView(isEnabled: true)

        // Override point for customization after application launch.
        return true
    }
}

To present the PrivacyKit UIViewController add the delegate to your UIViewController and call the requirePrivacy() function.

class ViewController: UIViewController, PrivacyKitDelegate {
    override func viewDidAppear(_ animated: Bool) {
        /** Present the PrivacyKit View if Privacy is not accepted. */
        self.requirePrivacy()
    }
}

More Examples

Custom Example Screenshot Custom Example Screenshot

Author

Archdoog

License

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