forked from shadowfacts/Tusker
Fix compiling for Catalyst
This commit is contained in:
parent
5cb25c8c1f
commit
efb96eddf3
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue