@@ -12,7 +12,7 @@ import SDWebImage
12
12
#if !os(watchOS)
13
13
14
14
/// 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 , * )
16
16
public final class AnimatedImageCoordinator : NSObject {
17
17
18
18
/// Any user-provided object for actual coordinator, such as delegate method, taget-action
@@ -25,7 +25,7 @@ public final class AnimatedImageCoordinator: NSObject {
25
25
}
26
26
27
27
/// 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 , * )
29
29
final class AnimatedImageModel : ObservableObject {
30
30
enum Kind {
31
31
case url
@@ -53,7 +53,7 @@ final class AnimatedImageModel : ObservableObject {
53
53
}
54
54
55
55
/// 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 , * )
57
57
final class AnimatedLoadingModel : ObservableObject {
58
58
@Published var image : PlatformImage ? // loaded image, note when progressive loading, this will published multiple times with different partial image
59
59
@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 {
66
66
}
67
67
68
68
/// 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 , * )
70
70
final class AnimatedImageHandler : ObservableObject {
71
71
// Completion Handler
72
72
@Published var successBlock : ( ( PlatformImage , Data ? , SDImageCacheType ) -> Void ) ?
@@ -78,7 +78,7 @@ final class AnimatedImageHandler: ObservableObject {
78
78
}
79
79
80
80
/// 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 , * )
82
82
final class AnimatedImageLayout : ObservableObject {
83
83
var contentMode : ContentMode ?
84
84
var aspectRatio : CGFloat ?
@@ -90,7 +90,7 @@ final class AnimatedImageLayout : ObservableObject {
90
90
}
91
91
92
92
/// 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 , * )
94
94
final class AnimatedImageConfiguration : ObservableObject {
95
95
var incrementalLoad : Bool ?
96
96
var maxBufferSize : UInt ?
@@ -106,7 +106,7 @@ final class AnimatedImageConfiguration: ObservableObject {
106
106
}
107
107
108
108
/// 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 , * )
110
110
public struct AnimatedImage : PlatformViewRepresentable {
111
111
@ObservedObject var imageModel : AnimatedImageModel
112
112
@ObservedObject var imageHandler = AnimatedImageHandler ( )
@@ -591,7 +591,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
591
591
}
592
592
593
593
// 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 , * )
595
595
extension AnimatedImage {
596
596
597
597
/// Configurate this view's image with the specified cap insets and options.
@@ -631,7 +631,7 @@ extension AnimatedImage {
631
631
}
632
632
633
633
// 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 , * )
635
635
extension AnimatedImage {
636
636
func setImageLayoutAspectRatio( _ aspectRatio: CGFloat ? , contentMode: ContentMode ) {
637
637
self . imageLayout. aspectRatio = aspectRatio
@@ -693,7 +693,7 @@ extension AnimatedImage {
693
693
}
694
694
695
695
// 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 , * )
697
697
extension AnimatedImage {
698
698
699
699
/// Total loop count for animated image rendering. Defaults to nil.
@@ -770,7 +770,7 @@ extension AnimatedImage {
770
770
}
771
771
772
772
// 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 , * )
774
774
extension AnimatedImage {
775
775
776
776
/// Provide the action when image load fails.
@@ -802,7 +802,7 @@ extension AnimatedImage {
802
802
}
803
803
804
804
// 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 , * )
806
806
extension AnimatedImage {
807
807
808
808
/// Provide the action when view representable create the native view.
@@ -839,7 +839,7 @@ extension SDWebImageIndicator where Self == SDWebImageProgressIndicator {
839
839
}
840
840
841
841
// 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 , * )
843
843
extension AnimatedImage {
844
844
845
845
/// Associate a indicator when loading image with url
@@ -860,7 +860,7 @@ extension AnimatedImage {
860
860
}
861
861
862
862
#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 , * )
864
864
struct AnimatedImage_Previews : PreviewProvider {
865
865
static var previews : some View {
866
866
Group {
0 commit comments