Skip to content

Commit 8dc9dfc

Browse files
committed
Change the internal compatible symbol naming with Platform prefix
1 parent 2997c45 commit 8dc9dfc

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

SDWebImageSwiftUI/Classes/AnimatedImage.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class AnimatedImageLayout : ObservableObject {
3232
}
3333

3434
// View
35-
public struct AnimatedImage : ViewRepresentable {
35+
public struct AnimatedImage : PlatformViewRepresentable {
3636
@ObservedObject var imageModel = AnimatedImageModel()
3737
@ObservedObject var imageLayout = AnimatedImageLayout()
3838

@@ -64,11 +64,11 @@ public struct AnimatedImage : ViewRepresentable {
6464
}
6565
#endif
6666

67-
func makeView(context: ViewRepresentableContext<AnimatedImage>) -> AnimatedImageViewWrapper {
67+
func makeView(context: PlatformViewRepresentableContext<AnimatedImage>) -> AnimatedImageViewWrapper {
6868
AnimatedImageViewWrapper()
6969
}
7070

71-
func updateView(_ view: AnimatedImageViewWrapper, context: ViewRepresentableContext<AnimatedImage>) {
71+
func updateView(_ view: AnimatedImageViewWrapper, context: PlatformViewRepresentableContext<AnimatedImage>) {
7272
view.wrapped.image = imageModel.image
7373
if let url = imageModel.url {
7474
view.wrapped.sd_setImage(with: url, placeholderImage: placeholder, options: webOptions, context: webContext, progress: { (receivedSize, expectedSize, _) in
@@ -85,7 +85,7 @@ public struct AnimatedImage : ViewRepresentable {
8585
layoutView(view, context: context)
8686
}
8787

88-
func layoutView(_ view: AnimatedImageViewWrapper, context: ViewRepresentableContext<AnimatedImage>) {
88+
func layoutView(_ view: AnimatedImageViewWrapper, context: PlatformViewRepresentableContext<AnimatedImage>) {
8989
// AspectRatio
9090
if let _ = imageLayout.aspectRatio {
9191
// TODO: Needs layer transform and geometry calculation

SDWebImageSwiftUI/Classes/SDWebImageSwiftUI.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public typealias PlatformView = WKInterfaceObject
3636
#endif
3737

3838
#if os(macOS)
39-
typealias ViewRepresentable = NSViewRepresentable
40-
typealias ViewRepresentableContext = NSViewRepresentableContext
39+
typealias PlatformViewRepresentable = NSViewRepresentable
40+
typealias PlatformViewRepresentableContext = NSViewRepresentableContext
4141
#endif
4242
#if os(iOS) || os(tvOS)
43-
typealias ViewRepresentable = UIViewRepresentable
44-
typealias ViewRepresentableContext = UIViewRepresentableContext
43+
typealias PlatformViewRepresentable = UIViewRepresentable
44+
typealias PlatformViewRepresentableContext = UIViewRepresentableContext
4545
#endif
4646
#if os(watchOS)
47-
typealias ViewRepresentable = WKInterfaceObjectRepresentable
48-
typealias ViewRepresentableContext = WKInterfaceObjectRepresentableContext
47+
typealias PlatformViewRepresentable = WKInterfaceObjectRepresentable
48+
typealias PlatformViewRepresentableContext = WKInterfaceObjectRepresentableContext
4949
#endif

0 commit comments

Comments
 (0)