From dcc5f7f71624617151f83bfdc0b7c510eac9f433 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 6 Jul 2024 17:36:45 -0700 Subject: [PATCH] visionOS: Workaround for gallery not working at all --- .../Sources/GalleryVC/GalleryViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Packages/GalleryVC/Sources/GalleryVC/GalleryViewController.swift b/Packages/GalleryVC/Sources/GalleryVC/GalleryViewController.swift index 825084d0..6131f73c 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/GalleryViewController.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/GalleryViewController.swift @@ -152,14 +152,21 @@ extension GalleryViewController: GalleryItemViewControllerDelegate { extension GalleryViewController: UIViewControllerTransitioningDelegate { public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { + #if os(visionOS) + return nil + #else if let sourceView = galleryDataSource.galleryContentTransitionSourceView(forItemAt: initialItemIndex) { return GalleryPresentationAnimationController(sourceView: sourceView) } else { return nil } + #endif } public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { + #if os(visionOS) + return nil + #else if let sourceView = galleryDataSource.galleryContentTransitionSourceView(forItemAt: currentItemViewController.itemIndex) { let translation: CGPoint? let velocity: CGPoint? @@ -175,5 +182,6 @@ extension GalleryViewController: UIViewControllerTransitioningDelegate { } else { return nil } + #endif } }