Skip to content

Fix the placeholder API viewBuilder args to match the documentation #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions SDWebImageSwiftUI/Classes/AnimatedImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@

import SwiftUI
import SDWebImage
#if canImport(SDWebImageSwiftUIObjC)
import SDWebImageSwiftUIObjC
#endif

// Convenient
#if os(watchOS)
public typealias AnimatedImageViewWrapper = SDAnimatedImageInterfaceWrapper
#endif

/// A coordinator object used for `AnimatedImage`native view bridge for UIKit/AppKit/WatchKit.
public final class AnimatedImageCoordinator: NSObject {
Expand Down
8 changes: 8 additions & 0 deletions SDWebImageSwiftUI/Classes/ImageViewWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

import Foundation
import SDWebImage
#if canImport(SDWebImageSwiftUIObjC)
import SDWebImageSwiftUIObjC
#endif

#if os(watchOS)
/// Use wrapper to solve the `WKInterfaceImage` aspect issue (SwiftUI's Bug)
public typealias AnimatedImageViewWrapper = SDAnimatedImageInterfaceWrapper
#endif

#if !os(watchOS)

Expand Down
2 changes: 1 addition & 1 deletion SDWebImageSwiftUI/Classes/WebImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extension WebImage {
/// Associate a placeholder when loading image with url
/// - note: The differences between Placeholder and Indicator, is that placeholder does not supports animation, and return type is different
/// - Parameter content: A view that describes the placeholder.
public func placeholder<T>(@ViewBuilder _ content: () -> T) -> WebImage where T : View {
public func placeholder<T>(@ViewBuilder content: () -> T) -> WebImage where T : View {
var result = self
result.placeholder = AnyView(content())
return result
Expand Down