Could someone please give me the use cases / best practices when using WKWebView.
let jscript = "my script" let userScript = WKUserScript(source: jscript, injectionTime: .atDocumentEnd, forMainFrameOnly: true) let userContentController = WKUserContentController() userContentController.addUserScript(userScript) let webViewConfiguration = WKWebViewConfiguration() webViewConfiguration.userContentController = userContentController webView = WKWebView(frame: self.view.bounds, configuration: webViewConfiguration)
In my experience, WKUserScript seems to have more privileges, eg:
Pretty cool stuff that doesn’t exist in UIWebView
Found a nice explanation
- Swift : println() doesn't show anything into “View Device Logs” in “Devices” tab
- Enabling the photo library button on the UIImagePickerController
- rotating a view on touch
- SourceKitService Terminated
- How do you access command line arguments in Swift?
- In Swift 3.1, UnsafeMutablePointer.initialize(from:) is deprecated
- How do I generate an auth token using JWT for Google firebase?
- Why would one use nested classes?
- CGBitmapContextCreateImage – vm_copy failed – iPhone SDK
- Can Objective C determine the caller object reference at runtime (reflection)?
- Reachability change notification should be called only once
- Sockets with Swift
- How to send multiple files with post request? (objective-c, iOS)
- IBAction inside UITableViewCell not called in iOS 9
- How to create IPA in Xcode 6?