@@ -12,6 +12,7 @@ import SDWebImage
1212#if os(iOS) || os(tvOS) || os(macOS)
1313
1414/// A coordinator object used for `AnimatedImage`native view bridge for UIKit/AppKit/WatchKit.
15+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
1516public final class AnimatedImageCoordinator : NSObject {
1617
1718 /// Any user-provided object for actual coordinator, such as delegate method, taget-action
@@ -22,6 +23,7 @@ public final class AnimatedImageCoordinator: NSObject {
2223}
2324
2425/// Data Binding Object, only properties in this object can support changes from user with @State and refresh
26+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
2527final class AnimatedImageModel : ObservableObject {
2628 /// URL image
2729 @Published var url : URL ?
@@ -36,6 +38,7 @@ final class AnimatedImageModel : ObservableObject {
3638}
3739
3840/// Completion Handler Binding Object, supports dynamic @State changes
41+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
3942final class AnimatedImageHandler : ObservableObject {
4043 // Completion Handler
4144 @Published var successBlock : ( ( PlatformImage , SDImageCacheType ) -> Void ) ?
@@ -47,6 +50,7 @@ final class AnimatedImageHandler: ObservableObject {
4750}
4851
4952/// Layout Binding Object, supports dynamic @State changes
53+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
5054final class AnimatedImageLayout : ObservableObject {
5155 var contentMode : ContentMode ?
5256 var aspectRatio : CGFloat ?
@@ -58,6 +62,7 @@ final class AnimatedImageLayout : ObservableObject {
5862}
5963
6064/// Configuration Binding Object, supports dynamic @State changes
65+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
6166final class AnimatedImageConfiguration : ObservableObject {
6267 var incrementalLoad : Bool ?
6368 var maxBufferSize : UInt ?
@@ -73,6 +78,7 @@ final class AnimatedImageConfiguration: ObservableObject {
7378}
7479
7580/// A Image View type to load image from url, data or bundle. Supports animated and static image format.
81+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
7682public struct AnimatedImage : PlatformViewRepresentable {
7783 @ObservedObject var imageModel = AnimatedImageModel ( )
7884 @ObservedObject var imageHandler = AnimatedImageHandler ( )
@@ -444,6 +450,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
444450}
445451
446452// Layout
453+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
447454extension AnimatedImage {
448455
449456 /// Configurate this view's image with the specified cap insets and options.
@@ -483,6 +490,7 @@ extension AnimatedImage {
483490}
484491
485492// Aspect Ratio
493+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
486494extension AnimatedImage {
487495 /// Constrains this view's dimensions to the specified aspect ratio.
488496 /// - Parameters:
@@ -541,6 +549,7 @@ extension AnimatedImage {
541549}
542550
543551// AnimatedImage Modifier
552+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
544553extension AnimatedImage {
545554
546555 /// Total loop count for animated image rendering. Defaults to nil.
@@ -610,6 +619,7 @@ extension AnimatedImage {
610619}
611620
612621// Completion Handler
622+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
613623extension AnimatedImage {
614624
615625 /// Provide the action when image load fails.
@@ -641,6 +651,7 @@ extension AnimatedImage {
641651}
642652
643653// View Coordinator Handler
654+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
644655extension AnimatedImage {
645656
646657 /// Provide the action when view representable create the native view.
@@ -668,6 +679,7 @@ extension AnimatedImage {
668679}
669680
670681// Web Image convenience
682+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
671683extension AnimatedImage {
672684
673685 /// Associate a placeholder when loading image with url
@@ -695,6 +707,7 @@ extension AnimatedImage {
695707}
696708
697709#if DEBUG
710+ @available ( iOS 13 . 0 , OSX 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
698711struct AnimatedImage_Previews : PreviewProvider {
699712 static var previews : some View {
700713 Group {
0 commit comments