From efb96eddf338c8473d3c04026a20af86a8d9d2ad Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 2 Jul 2022 11:33:15 -0700 Subject: [PATCH] Fix compiling for Catalyst --- Tusker/Screens/Large Image/LargeImageContentView.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tusker/Screens/Large Image/LargeImageContentView.swift b/Tusker/Screens/Large Image/LargeImageContentView.swift index 9608c42c..f6273dbc 100644 --- a/Tusker/Screens/Large Image/LargeImageContentView.swift +++ b/Tusker/Screens/Large Image/LargeImageContentView.swift @@ -19,8 +19,10 @@ protocol LargeImageContentView: UIView { class LargeImageImageContentView: UIImageView, LargeImageContentView { + #if !targetEnvironment(macCatalyst) @available(iOS 16.0, *) private static let analyzer = ImageAnalyzer() + #endif var animationImage: UIImage? { image! } @@ -39,6 +41,7 @@ class LargeImageImageContentView: UIImageView, LargeImageContentView { contentMode = .scaleAspectFit isUserInteractionEnabled = true + #if !targetEnvironment(macCatalyst) if #available(iOS 16.0, *), ImageAnalyzer.isSupported { let interaction = ImageAnalysisInteraction() @@ -54,6 +57,7 @@ class LargeImageImageContentView: UIImageView, LargeImageContentView { } } } + #endif } required init?(coder: NSCoder) { @@ -78,12 +82,14 @@ class LargeImageImageContentView: UIImageView, LargeImageContentView { } } +#if !targetEnvironment(macCatalyst) @available(iOS 16.0, *) extension LargeImageImageContentView: ImageAnalysisInteractionDelegate { func presentingViewController(for interaction: ImageAnalysisInteraction) -> UIViewController? { return owner } } +#endif class LargeImageGifContentView: GIFImageView, LargeImageContentView { var animationImage: UIImage? { image }