Fixes peek & pop deprecation warnings

This commit is contained in:
Riley Testut
2023-03-02 15:48:33 -06:00
committed by Magesh K
parent e4dfe1125a
commit 8695c412d7
5 changed files with 32 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ import Roxas
import Nuke
class BrowseViewController: UICollectionViewController
class BrowseViewController: UICollectionViewController, PeekPopPreviewing
{
private lazy var dataSource = self.makeDataSource()
private lazy var placeholderView = RSTPlaceholderView(frame: .zero)
@@ -47,7 +47,7 @@ class BrowseViewController: UICollectionViewController
self.collectionView.dataSource = self.dataSource
self.collectionView.prefetchDataSource = self.dataSource
self.registerForPreviewing(with: self, sourceView: self.collectionView)
(self as PeekPopPreviewing).registerForPreviewing(with: self, sourceView: self.collectionView)
self.update()
}
@@ -373,6 +373,7 @@ extension BrowseViewController: UICollectionViewDelegateFlowLayout
extension BrowseViewController: UIViewControllerPreviewingDelegate
{
@available(iOS, deprecated: 13.0)
func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController?
{
guard
@@ -388,6 +389,7 @@ extension BrowseViewController: UIViewControllerPreviewingDelegate
return appViewController
}
@available(iOS, deprecated: 13.0)
func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController)
{
self.navigationController?.pushViewController(viewControllerToCommit, animated: true)