@@ -12,7 +12,7 @@ import SDWebImage
1212#if !os(watchOS)
1313
1414/// A coordinator object used for `AnimatedImage`native view bridge for UIKit/AppKit.
15- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
15+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
1616public final class AnimatedImageCoordinator : NSObject {
1717
1818 /// Any user-provided object for actual coordinator, such as delegate method, taget-action
@@ -25,7 +25,7 @@ public final class AnimatedImageCoordinator: NSObject {
2525}
2626
2727/// Data Binding Object, only properties in this object can support changes from user with @State and refresh
28- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
28+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
2929final class AnimatedImageModel : ObservableObject {
3030 enum Kind {
3131 case url
@@ -53,7 +53,7 @@ final class AnimatedImageModel : ObservableObject {
5353}
5454
5555/// Loading Binding Object, only properties in this object can support changes from user with @State and refresh
56- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
56+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
5757final class AnimatedLoadingModel : ObservableObject {
5858 @Published var image : PlatformImage ? // loaded image, note when progressive loading, this will published multiple times with different partial image
5959 @Published var isLoading : Bool = false // whether network is loading or cache is querying, should only be used for indicator binding
@@ -66,7 +66,7 @@ final class AnimatedLoadingModel : ObservableObject {
6666}
6767
6868/// Completion Handler Binding Object, supports dynamic @State changes
69- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
69+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
7070final class AnimatedImageHandler : ObservableObject {
7171 // Completion Handler
7272 @Published var successBlock : ( ( PlatformImage , Data ? , SDImageCacheType ) -> Void ) ?
@@ -78,7 +78,7 @@ final class AnimatedImageHandler: ObservableObject {
7878}
7979
8080/// Layout Binding Object, supports dynamic @State changes
81- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
81+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
8282final class AnimatedImageLayout : ObservableObject {
8383 var contentMode : ContentMode ?
8484 var aspectRatio : CGFloat ?
@@ -90,7 +90,7 @@ final class AnimatedImageLayout : ObservableObject {
9090}
9191
9292/// Configuration Binding Object, supports dynamic @State changes
93- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
93+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
9494final class AnimatedImageConfiguration : ObservableObject {
9595 var incrementalLoad : Bool ?
9696 var maxBufferSize : UInt ?
@@ -106,7 +106,7 @@ final class AnimatedImageConfiguration: ObservableObject {
106106}
107107
108108/// A Image View type to load image from url, data or bundle. Supports animated and static image format.
109- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
109+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
110110public struct AnimatedImage : PlatformViewRepresentable {
111111 @ObservedObject var imageModel : AnimatedImageModel
112112 @ObservedObject var imageHandler = AnimatedImageHandler ( )
@@ -591,7 +591,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
591591}
592592
593593// Layout
594- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
594+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
595595extension AnimatedImage {
596596
597597 /// Configurate this view's image with the specified cap insets and options.
@@ -631,7 +631,7 @@ extension AnimatedImage {
631631}
632632
633633// Aspect Ratio
634- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
634+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
635635extension AnimatedImage {
636636 func setImageLayoutAspectRatio( _ aspectRatio: CGFloat ? , contentMode: ContentMode ) {
637637 self . imageLayout. aspectRatio = aspectRatio
@@ -693,7 +693,7 @@ extension AnimatedImage {
693693}
694694
695695// AnimatedImage Modifier
696- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
696+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
697697extension AnimatedImage {
698698
699699 /// Total loop count for animated image rendering. Defaults to nil.
@@ -770,7 +770,7 @@ extension AnimatedImage {
770770}
771771
772772// Completion Handler
773- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
773+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
774774extension AnimatedImage {
775775
776776 /// Provide the action when image load fails.
@@ -802,7 +802,7 @@ extension AnimatedImage {
802802}
803803
804804// View Coordinator Handler
805- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
805+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
806806extension AnimatedImage {
807807
808808 /// Provide the action when view representable create the native view.
@@ -839,7 +839,7 @@ extension SDWebImageIndicator where Self == SDWebImageProgressIndicator {
839839}
840840
841841// Web Image convenience, based on UIKit/AppKit API
842- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
842+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
843843extension AnimatedImage {
844844
845845 /// Associate a indicator when loading image with url
@@ -860,7 +860,7 @@ extension AnimatedImage {
860860}
861861
862862#if DEBUG
863- @available ( iOS 14 . 0 , OSX 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
863+ @available ( iOS 14 . 0 , macOS 11 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
864864struct AnimatedImage_Previews : PreviewProvider {
865865 static var previews : some View {
866866 Group {
0 commit comments