forked from shadowfacts/Tusker
visionOS: Don't use gallery VC transition
This commit is contained in:
parent
bdec14c463
commit
e156a97861
|
@ -6,6 +6,7 @@
|
|||
// Copyright © 2018 Shadowfacts. All rights reserved.
|
||||
//
|
||||
|
||||
#if !os(visionOS)
|
||||
import UIKit
|
||||
|
||||
extension UIViewController: UIViewControllerTransitioningDelegate {
|
||||
|
@ -34,3 +35,4 @@ extension UIViewController: UIViewControllerTransitioningDelegate {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -470,6 +470,17 @@ class CustomAlertActionButton: UIControl {
|
|||
}
|
||||
}
|
||||
|
||||
#if os(visionOS)
|
||||
extension CustomAlertController: UIViewControllerTransitioningDelegate {
|
||||
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
return CustomAlertPresentationAnimation()
|
||||
}
|
||||
|
||||
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
return CustomAlertDismissAnimation()
|
||||
}
|
||||
}
|
||||
#else
|
||||
extension CustomAlertController {
|
||||
override func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
return CustomAlertPresentationAnimation()
|
||||
|
@ -479,6 +490,7 @@ extension CustomAlertController {
|
|||
return CustomAlertDismissAnimation()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
class CustomAlertPresentationAnimation: NSObject, UIViewControllerAnimatedTransitioning {
|
||||
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
|
||||
|
|
|
@ -129,13 +129,17 @@ extension TuskerNavigationDelegate {
|
|||
func showLoadingLargeImage(url: URL, cache: ImageCache, description: String?, animatingFrom sourceView: UIImageView) {
|
||||
let vc = LoadingLargeImageViewController(url: url, cache: cache, imageDescription: description)
|
||||
vc.animationSourceView = sourceView
|
||||
#if !os(visionOS)
|
||||
vc.transitioningDelegate = self
|
||||
#endif
|
||||
present(vc, animated: true)
|
||||
}
|
||||
|
||||
func gallery(attachments: [Attachment], sourceViews: [UIImageView?], startIndex: Int) -> GalleryViewController {
|
||||
let vc = GalleryViewController(attachments: attachments, sourceViews: sourceViews, startIndex: startIndex)
|
||||
#if !os(visionOS)
|
||||
vc.transitioningDelegate = self
|
||||
#endif
|
||||
return vc
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue