|
|
@@ -82,7 +82,7 @@ extension KingfisherWrapper where Base: NSTextAttachment {
|
|
|
@discardableResult
|
|
|
public func setImage(
|
|
|
with source: Source?,
|
|
|
- attributedView: KFCrossPlatformView,
|
|
|
+ attributedView: @autoclosure @escaping () -> KFCrossPlatformView,
|
|
|
placeholder: KFCrossPlatformImage? = nil,
|
|
|
options: KingfisherOptionsInfo? = nil,
|
|
|
progressBlock: DownloadProgressBlock? = nil,
|
|
|
@@ -162,7 +162,7 @@ extension KingfisherWrapper where Base: NSTextAttachment {
|
|
|
|
|
|
func setImage(
|
|
|
with source: Source?,
|
|
|
- attributedView: KFCrossPlatformView,
|
|
|
+ attributedView: @escaping () -> KFCrossPlatformView,
|
|
|
placeholder: KFCrossPlatformImage? = nil,
|
|
|
parsedOptions: KingfisherParsedOptionsInfo,
|
|
|
progressBlock: DownloadProgressBlock? = nil,
|
|
|
@@ -222,10 +222,11 @@ extension KingfisherWrapper where Base: NSTextAttachment {
|
|
|
switch result {
|
|
|
case .success(let value):
|
|
|
self.base.image = value.image
|
|
|
+ let view = attributedView()
|
|
|
#if canImport(UIKit)
|
|
|
- attributedView.setNeedsDisplay()
|
|
|
+ view.setNeedsDisplay()
|
|
|
#else
|
|
|
- attributedView.setNeedsDisplay(attributedView.bounds)
|
|
|
+ view.setNeedsDisplay(view.bounds)
|
|
|
#endif
|
|
|
case .failure:
|
|
|
if let image = options.onFailureImage {
|