WebKit Changes for Swift
WebKit
Added WKSecurityOrigin
Added WKSecurityOrigin.host
Added WKSecurityOrigin.port
Added WKWebsiteDataRecord
Added WKWebsiteDataStore
Added WKWebsiteDataTypeCookies
Modified WKBackForwardList
Declaration | |
---|---|
From | class WKBackForwardList : NSObject { var currentItem: WKBackForwardListItem? { get } var backItem: WKBackForwardListItem? { get } var forwardItem: WKBackForwardListItem? { get } func itemAtIndex(_ index: Int) -> WKBackForwardListItem? var backList: [AnyObject] { get } var forwardList: [AnyObject] { get } } |
To | class WKBackForwardList : NSObject { var currentItem: WKBackForwardListItem? { get } var backItem: WKBackForwardListItem? { get } var forwardItem: WKBackForwardListItem? { get } func itemAtIndex(_ index: Int) -> WKBackForwardListItem? var backList: [WKBackForwardListItem] { get } var forwardList: [WKBackForwardListItem] { get } } |
Modified WKBackForwardList.backList
Declaration | |
---|---|
From | var backList: [AnyObject] { get } |
To | var backList: [WKBackForwardListItem] { get } |
Modified WKBackForwardList.forwardList
Declaration | |
---|---|
From | var forwardList: [AnyObject] { get } |
To | var forwardList: [WKBackForwardListItem] { get } |
Modified WKErrorCode [enum]
Declaration | Protocols | Raw Value Type | |
---|---|---|---|
From | enum WKErrorCode : Int { case Unknown case WebContentProcessTerminated case WebViewInvalidated case JavaScriptExceptionOccurred } | Equatable, Hashable, RawRepresentable | -- |
To | enum WKErrorCode : Int { case Unknown case WebContentProcessTerminated case WebViewInvalidated case JavaScriptExceptionOccurred case JavaScriptResultTypeIsUnsupported } extension WKErrorCode : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError { } extension WKErrorCode : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError { } | Equatable, ErrorType, Hashable, RawRepresentable | Int |
Modified WKFrameInfo
Declaration | |
---|---|
From | class WKFrameInfo : NSObject, NSCopying { var mainFrame: Bool { get } @NSCopying var request: NSURLRequest { get } } |
To | class WKFrameInfo : NSObject, NSCopying { var mainFrame: Bool { get } @NSCopying var request: NSURLRequest { get } var securityOrigin: WKSecurityOrigin { get } } |
Modified WKNavigationAction
Declaration | |
---|---|
From | class WKNavigationAction : NSObject { @NSCopying var sourceFrame: WKFrameInfo? { get } @NSCopying var targetFrame: WKFrameInfo? { get } var navigationType: WKNavigationType { get } @NSCopying var request: NSURLRequest { get } } |
To | class WKNavigationAction : NSObject { @NSCopying var sourceFrame: WKFrameInfo { get } @NSCopying var targetFrame: WKFrameInfo? { get } var navigationType: WKNavigationType { get } @NSCopying var request: NSURLRequest { get } } |
Modified WKNavigationAction.sourceFrame
Declaration | |
---|---|
From | @NSCopying var sourceFrame: WKFrameInfo? { get } |
To | @NSCopying var sourceFrame: WKFrameInfo { get } |
Modified WKNavigationActionPolicy [enum]
Raw Value Type | |
---|---|
From | -- |
To | Int |
Modified WKNavigationDelegate
Declaration | |
---|---|
From | protocol WKNavigationDelegate : NSObjectProtocol { optional func webView(_ webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler decisionHandler: (WKNavigationActionPolicy) -> Void) optional func webView(_ webView: WKWebView, decidePolicyForNavigationResponse navigationResponse: WKNavigationResponse, decisionHandler decisionHandler: (WKNavigationResponsePolicy) -> Void) optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: NSError) optional func webView(_ webView: WKWebView, didCommitNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didFinishNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didFailNavigation navigation: WKNavigation!, withError error: NSError) optional func webView(_ webView: WKWebView, didReceiveAuthenticationChallenge challenge: NSURLAuthenticationChallenge, completionHandler completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential!) -> Void) } |
To | protocol WKNavigationDelegate : NSObjectProtocol { optional func webView(_ webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler decisionHandler: (WKNavigationActionPolicy) -> Void) optional func webView(_ webView: WKWebView, decidePolicyForNavigationResponse navigationResponse: WKNavigationResponse, decisionHandler decisionHandler: (WKNavigationResponsePolicy) -> Void) optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: NSError) optional func webView(_ webView: WKWebView, didCommitNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didFinishNavigation navigation: WKNavigation!) optional func webView(_ webView: WKWebView, didFailNavigation navigation: WKNavigation!, withError error: NSError) optional func webView(_ webView: WKWebView, didReceiveAuthenticationChallenge challenge: NSURLAuthenticationChallenge, completionHandler completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) } |
Declaration | |
---|---|
From | optional func webView(_ webView: WKWebView, didReceiveAuthenticationChallenge challenge: NSURLAuthenticationChallenge, completionHandler completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential!) -> Void) |
To | optional func webView(_ webView: WKWebView, didReceiveAuthenticationChallenge challenge: NSURLAuthenticationChallenge, completionHandler completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) |
Modified WKNavigationResponsePolicy [enum]
Raw Value Type | |
---|---|
From | -- |
To | Int |
Modified WKNavigationType [enum]
Raw Value Type | |
---|---|
From | -- |
To | Int |
Modified WKSelectionGranularity [enum]
Raw Value Type | |
---|---|
From | -- |
To | Int |
Modified WKUIDelegate
Declaration | |
---|---|
From | protocol WKUIDelegate : NSObjectProtocol { optional func webView(_ webView: WKWebView, createWebViewWithConfiguration configuration: WKWebViewConfiguration, forNavigationAction navigationAction: WKNavigationAction, windowFeatures windowFeatures: WKWindowFeatures) -> WKWebView? optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: () -> Void) optional func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: (Bool) -> Void) optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: (String!) -> Void) } |
To | protocol WKUIDelegate : NSObjectProtocol { optional func webView(_ webView: WKWebView, createWebViewWithConfiguration configuration: WKWebViewConfiguration, forNavigationAction navigationAction: WKNavigationAction, windowFeatures windowFeatures: WKWindowFeatures) -> WKWebView? optional func webViewDidClose(_ webView: WKWebView) optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: () -> Void) optional func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: (Bool) -> Void) optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: (String?) -> Void) } |
Declaration | |
---|---|
From | optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: (String!) -> Void) |
To | optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler completionHandler: (String?) -> Void) |
Modified WKUserContentController
Declaration | |
---|---|
From | class WKUserContentController : NSObject { var userScripts: [AnyObject] { get } func addUserScript(_ userScript: WKUserScript) func removeAllUserScripts() func addScriptMessageHandler(_ scriptMessageHandler: WKScriptMessageHandler, name name: String) func removeScriptMessageHandlerForName(_ name: String) } |
To | class WKUserContentController : NSObject { var userScripts: [WKUserScript] { get } func addUserScript(_ userScript: WKUserScript) func removeAllUserScripts() func addScriptMessageHandler(_ scriptMessageHandler: WKScriptMessageHandler, name name: String) func removeScriptMessageHandlerForName(_ name: String) } |
Modified WKUserContentController.userScripts
Declaration | |
---|---|
From | var userScripts: [AnyObject] { get } |
To | var userScripts: [WKUserScript] { get } |
Modified WKUserScriptInjectionTime [enum]
Raw Value Type | |
---|---|
From | -- |
To | Int |
Modified WKWebView
Declaration | |
---|---|
From | class WKWebView : UIView { @NSCopying var configuration: WKWebViewConfiguration { get } weak var navigationDelegate: WKNavigationDelegate? weak var UIDelegate: WKUIDelegate? var backForwardList: WKBackForwardList { get } init(frame frame: CGRect, configuration configuration: WKWebViewConfiguration) convenience init!(coder coder: NSCoder!) func loadRequest(_ request: NSURLRequest) -> WKNavigation? func loadHTMLString(_ string: String, baseURL baseURL: NSURL?) -> WKNavigation? func goToBackForwardListItem(_ item: WKBackForwardListItem) -> WKNavigation? var title: String? { get } @NSCopying var URL: NSURL? { get } var loading: Bool { get } var estimatedProgress: Double { get } var hasOnlySecureContent: Bool { get } var canGoBack: Bool { get } var canGoForward: Bool { get } func goBack() -> WKNavigation? func goForward() -> WKNavigation? func reload() -> WKNavigation? func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler completionHandler: ((AnyObject!, NSError!) -> Void)?) var allowsBackForwardNavigationGestures: Bool var scrollView: UIScrollView { get } } |
To | class WKWebView : UIView { @NSCopying var configuration: WKWebViewConfiguration { get } weak var navigationDelegate: WKNavigationDelegate? weak var UIDelegate: WKUIDelegate? var backForwardList: WKBackForwardList { get } init(frame frame: CGRect, configuration configuration: WKWebViewConfiguration) convenience init(coder coder: NSCoder) func loadRequest(_ request: NSURLRequest) -> WKNavigation? func loadFileURL(_ URL: NSURL, allowingReadAccessToURL readAccessURL: NSURL) -> WKNavigation? func loadHTMLString(_ string: String, baseURL baseURL: NSURL?) -> WKNavigation? func loadData(_ data: NSData, MIMEType MIMEType: String, characterEncodingName characterEncodingName: String, baseURL baseURL: NSURL) -> WKNavigation? func goToBackForwardListItem(_ item: WKBackForwardListItem) -> WKNavigation? var title: String? { get } @NSCopying var URL: NSURL? { get } var loading: Bool { get } var estimatedProgress: Double { get } var hasOnlySecureContent: Bool { get } var certificateChain: [AnyObject] { get } var canGoBack: Bool { get } var canGoForward: Bool { get } func goBack() -> WKNavigation? func goForward() -> WKNavigation? func reload() -> WKNavigation? func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler completionHandler: ((AnyObject?, NSError?) -> Void)?) var allowsBackForwardNavigationGestures: Bool var customUserAgent: String? var allowsLinkPreview: Bool var scrollView: UIScrollView { get } } |
Modified WKWebView.evaluateJavaScript(_: String, completionHandler: ((AnyObject?, NSError?) -> Void)?)
Declaration | |
---|---|
From | func evaluateJavaScript(_ javaScriptString: String, completionHandler completionHandler: ((AnyObject!, NSError!) -> Void)?) |
To | func evaluateJavaScript(_ javaScriptString: String, completionHandler completionHandler: ((AnyObject?, NSError?) -> Void)?) |
Modified WKWebViewConfiguration
Declaration | |
---|---|
From | class WKWebViewConfiguration : NSObject, NSCopying { var processPool: WKProcessPool var preferences: WKPreferences var userContentController: WKUserContentController var suppressesIncrementalRendering: Bool var allowsInlineMediaPlayback: Bool var mediaPlaybackRequiresUserAction: Bool var mediaPlaybackAllowsAirPlay: Bool var selectionGranularity: WKSelectionGranularity } |
To | class WKWebViewConfiguration : NSObject, NSCopying { var processPool: WKProcessPool var preferences: WKPreferences var userContentController: WKUserContentController var websiteDataStore: WKWebsiteDataStore var suppressesIncrementalRendering: Bool var applicationNameForUserAgent: String? var allowsAirPlayForMediaPlayback: Bool var allowsInlineMediaPlayback: Bool var requiresUserActionForMediaPlayback: Bool var selectionGranularity: WKSelectionGranularity var allowsPictureInPictureMediaPlayback: Bool } extension WKWebViewConfiguration { var mediaPlaybackRequiresUserAction: Bool var mediaPlaybackAllowsAirPlay: Bool } |
Deprecation | |
---|---|
From | -- |
To | iOS 9.0 |
Deprecation | |
---|---|
From | -- |
To | iOS 9.0 |