Skip to content

AlexMokrushin/AMWebViewSDK

Repository files navigation

WebViewSDK

Package contains SDK to use camera torch from page loaded to WKWebView.

Installation

Add WebViewSDK using the Package manager in Xcode. Use the URL https://github.com/Transported-Labs/ios-webview-sdk

Usage

  1. Add import directive:
    import WebViewSDK
  1. Init WebViewController object:
    let sdkController = WebViewSDK.initWebViewController()
  1. Present WebViewController object and call it's .navigateTo() method:
    // URL to your custom html-page with SDK script
    let urlString = "https://www.google.com"
    present(sdkController, animated: true) {
        if let url = URL(string: urlString) {
            do {
                try sdkController.navigateTo(url: url)
            } catch {
                // Error handling when URL is not valid
                sdkController.dismiss(animated: true)
                print(error)
            }
        }
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published