Is there a function for the WKWebView class that allows you to detect whenever the URL of that WebView has changed?
The didCommit
and didStartProvisionalNavigation
functions don't always seem to fire when working with certain elements within the WebView.
EDIT: Attempted adding a Notification observer. Here's what I have thus far:
extension Notification.Name {
static let checkURL = Notification.Name("checkURL")
}
NotificationCenter.default.post(name: .checkURL, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(getter: webView.url), name: .checkURL, object: webView.url)