mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Dismisses PreviewAppScreenshotsViewController with swipe gesture
This commit is contained in:
@@ -58,9 +58,13 @@ class PreviewAppScreenshotsViewController: UICollectionViewController
|
|||||||
self.collectionView.prefetchDataSource = self.dataSource
|
self.collectionView.prefetchDataSource = self.dataSource
|
||||||
|
|
||||||
let doneButton = UIBarButtonItem(systemItem: .done, primaryAction: UIAction { [weak self] _ in
|
let doneButton = UIBarButtonItem(systemItem: .done, primaryAction: UIAction { [weak self] _ in
|
||||||
self?.dismiss(animated: true)
|
self?.dismissPreview()
|
||||||
})
|
})
|
||||||
self.navigationItem.rightBarButtonItem = doneButton
|
self.navigationItem.rightBarButtonItem = doneButton
|
||||||
|
|
||||||
|
let swipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: #selector(PreviewAppScreenshotsViewController.dismissPreview))
|
||||||
|
swipeGestureRecognizer.direction = .down
|
||||||
|
self.view.addGestureRecognizer(swipeGestureRecognizer)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewIsAppearing(_ animated: Bool)
|
override func viewIsAppearing(_ animated: Bool)
|
||||||
@@ -163,6 +167,14 @@ private extension PreviewAppScreenshotsViewController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension PreviewAppScreenshotsViewController
|
||||||
|
{
|
||||||
|
@objc func dismissPreview()
|
||||||
|
{
|
||||||
|
self.dismiss(animated: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@available(iOS 17, *)
|
@available(iOS 17, *)
|
||||||
#Preview(traits: .portrait) {
|
#Preview(traits: .portrait) {
|
||||||
DatabaseManager.shared.startForPreview()
|
DatabaseManager.shared.startForPreview()
|
||||||
|
|||||||
Reference in New Issue
Block a user