Skip to content

Commit 8a4dbd4

Browse files
committed
Added decidePolicyFor WebView Delegate method
1 parent 9718c06 commit 8a4dbd4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ChangelogKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'ChangelogKit'
11-
s.version = '0.1.9'
11+
s.version = '0.1.10'
1212
s.summary = 'A library that offers tools to display a changelog using webviews and user defaults.'
1313

1414
# This description is used to generate tags and improve search results.

ChangelogKit/Classes/Views/WebViewController.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class WebViewController: UIViewController {
8888
webView.rightAnchor.constraint(equalTo: webViewContainer.rightAnchor).isActive = true
8989
webView.topAnchor.constraint(equalTo: webViewContainer.topAnchor).isActive = true
9090
webView.bottomAnchor.constraint(equalTo: webViewContainer.bottomAnchor).isActive = true
91+
webView.navigationDelegate = self
9192
}
9293

9394
/// Loads the changelog into the `WKWebView`
@@ -176,3 +177,12 @@ class webViewScrollViewDelegate: NSObject, UIScrollViewDelegate {
176177
return nil
177178
}
178179
}
180+
181+
// MARK: - WKNavigationDelegate
182+
extension WebViewController: WKNavigationDelegate {
183+
func webView(_ webView: WKWebView,
184+
decidePolicyFor navigationAction: WKNavigationAction,
185+
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
186+
decisionHandler(.allow)
187+
}
188+
}

0 commit comments

Comments
 (0)