|
|
@@ -38,6 +38,11 @@ struct KFImageRenderer<HoldingView> : View where HoldingView: KFImageHoldingView
|
|
|
|
|
|
var body: some View {
|
|
|
ZStack {
|
|
|
+ context.configurations
|
|
|
+ .reduce(HoldingView.created(from: binder.loadedImage, context: context)) {
|
|
|
+ current, config in config(current)
|
|
|
+ }
|
|
|
+ .opacity(binder.loaded ? 1.0 : 0.0)
|
|
|
if binder.loadedImage == nil {
|
|
|
Group {
|
|
|
if let placeholder = context.placeholder, let view = placeholder(binder.progress) {
|
|
|
@@ -46,6 +51,7 @@ struct KFImageRenderer<HoldingView> : View where HoldingView: KFImageHoldingView
|
|
|
Color.clear
|
|
|
}
|
|
|
}
|
|
|
+ .opacity(binder.loaded ? 0.0 : 1.0)
|
|
|
.onAppear { [weak binder = self.binder] in
|
|
|
guard let binder = binder else {
|
|
|
return
|
|
|
@@ -63,11 +69,6 @@ struct KFImageRenderer<HoldingView> : View where HoldingView: KFImageHoldingView
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- context.configurations
|
|
|
- .reduce(HoldingView.created(from: binder.loadedImage, context: context)) {
|
|
|
- current, config in config(current)
|
|
|
- }
|
|
|
- .opacity(binder.loaded ? 1.0 : 0.0)
|
|
|
}
|
|
|
}
|
|
|
}
|