Skip to content

Commit ae1809b

Browse files
authored
Merge pull request #59 from SDWebImage/api_fix
Fix the placeholder API viewBuilder args to match the documentation
2 parents 28986d5 + a62f9a9 commit ae1809b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

SDWebImageSwiftUI/Classes/AnimatedImage.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88

99
import SwiftUI
1010
import SDWebImage
11-
#if canImport(SDWebImageSwiftUIObjC)
12-
import SDWebImageSwiftUIObjC
13-
#endif
14-
15-
// Convenient
16-
#if os(watchOS)
17-
public typealias AnimatedImageViewWrapper = SDAnimatedImageInterfaceWrapper
18-
#endif
1911

2012
/// A coordinator object used for `AnimatedImage`native view bridge for UIKit/AppKit/WatchKit.
2113
public final class AnimatedImageCoordinator: NSObject {

SDWebImageSwiftUI/Classes/ImageViewWrapper.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
import Foundation
1010
import SDWebImage
11+
#if canImport(SDWebImageSwiftUIObjC)
12+
import SDWebImageSwiftUIObjC
13+
#endif
14+
15+
#if os(watchOS)
16+
/// Use wrapper to solve the `WKInterfaceImage` aspect issue (SwiftUI's Bug)
17+
public typealias AnimatedImageViewWrapper = SDAnimatedImageInterfaceWrapper
18+
#endif
1119

1220
#if !os(watchOS)
1321

SDWebImageSwiftUI/Classes/WebImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ extension WebImage {
144144
/// Associate a placeholder when loading image with url
145145
/// - note: The differences between Placeholder and Indicator, is that placeholder does not supports animation, and return type is different
146146
/// - Parameter content: A view that describes the placeholder.
147-
public func placeholder<T>(@ViewBuilder _ content: () -> T) -> WebImage where T : View {
147+
public func placeholder<T>(@ViewBuilder content: () -> T) -> WebImage where T : View {
148148
var result = self
149149
result.placeholder = AnyView(content())
150150
return result

0 commit comments

Comments
 (0)