diff --git a/Gemfile.lock b/Gemfile.lock index e925cd0c0a1..9fe188868e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) fastimage (2.1.0) - fastlane (2.69.2) + fastlane (2.69.3) CFPropertyList (>= 2.3, < 3.0.0) addressable (>= 2.3, < 3.0.0) babosa (>= 1.0.2, < 2.0.0) diff --git a/Wikipedia/Code/ArticleLocationCollectionViewController.swift b/Wikipedia/Code/ArticleLocationCollectionViewController.swift index 469de06237f..056beb9b16c 100644 --- a/Wikipedia/Code/ArticleLocationCollectionViewController.swift +++ b/Wikipedia/Code/ArticleLocationCollectionViewController.swift @@ -122,9 +122,11 @@ extension ArticleLocationCollectionViewController { // MARK: - UIViewControllerPreviewingDelegate extension ArticleLocationCollectionViewController { override func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { - guard let indexPath = collectionView.indexPathForItem(at: location) else { + guard let indexPath = collectionView.indexPathForItem(at: location), + let cell = collectionView.cellForItem(at: indexPath) else { return nil } + previewingContext.sourceRect = cell.convert(cell.bounds, to: collectionView) let url = articleURL(at: indexPath) let articleViewController = WMFArticleViewController(articleURL: url, dataStore: dataStore, theme: self.theme) articleViewController.articlePreviewingActionsDelegate = self @@ -133,6 +135,7 @@ extension ArticleLocationCollectionViewController { } override func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) { + viewControllerToCommit.wmf_removePeekableChildViewControllers() wmf_push(viewControllerToCommit, animated: true) } }