Change event used to stop web view activity (video and image zooming) so that it doesn't interfere with the image zooming transition.
This commit is contained in:
parent
e3b32847f9
commit
8acd6a039a
@ -317,8 +317,11 @@ extension ArticleViewController: UIPageViewControllerDelegate {
|
||||
func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
|
||||
guard finished, completed else { return }
|
||||
guard let article = currentWebViewController?.article else { return }
|
||||
|
||||
coordinator.selectArticle(article, animations: [.select, .scroll, .navigation])
|
||||
articleExtractorButton.buttonState = currentWebViewController?.articleExtractorButtonState ?? .off
|
||||
|
||||
previousViewControllers.compactMap({ $0 as? WebViewController }).forEach({ $0.stopWebViewActivity() })
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -92,14 +92,6 @@ class WebViewController: UIViewController {
|
||||
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
if let webView = webView {
|
||||
stopMediaPlayback(webView)
|
||||
cancelImageLoad(webView)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
@objc func webFeedIconDidBecomeAvailable(_ note: Notification) {
|
||||
@ -216,6 +208,13 @@ class WebViewController: UIViewController {
|
||||
stopArticleExtractor()
|
||||
}
|
||||
}
|
||||
|
||||
func stopWebViewActivity() {
|
||||
if let webView = webView {
|
||||
stopMediaPlayback(webView)
|
||||
cancelImageLoad(webView)
|
||||
}
|
||||
}
|
||||
|
||||
func showActivityDialog(popOverBarButtonItem: UIBarButtonItem? = nil) {
|
||||
guard let preferredLink = article?.preferredLink, let url = URL(string: preferredLink) else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user