Update the demo for placeholder comments
This commit is contained in:
parent
fc9c2b5293
commit
9dcc697a16
|
@ -86,6 +86,9 @@ struct ContentView: View {
|
|||
#if os(macOS) || os(iOS) || os(tvOS)
|
||||
AnimatedImage(url: URL(string:url))
|
||||
.indicator(SDWebImageActivityIndicator.medium)
|
||||
/**
|
||||
.placeholder(UIImage(systemName: "photo"))
|
||||
*/
|
||||
.transition(.fade)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
|
@ -100,6 +103,11 @@ struct ContentView: View {
|
|||
#if os(macOS) || os(iOS) || os(tvOS)
|
||||
WebImage(url: URL(string:url))
|
||||
.resizable()
|
||||
/**
|
||||
.placeholder {
|
||||
Image(systemName: "photo")
|
||||
}
|
||||
*/
|
||||
.indicator(.activity)
|
||||
.animation(.easeInOut(duration: 0.5))
|
||||
.transition(.fade)
|
||||
|
|
|
@ -90,8 +90,11 @@ var body: some View {
|
|||
// Success
|
||||
}
|
||||
.resizable() // Resizable like SwiftUI.Image
|
||||
.placeholder {
|
||||
Image(systemName: "photo") // Placeholder
|
||||
}
|
||||
.indicator(.activity) // Activity Indicator
|
||||
.animation(.easeInOut(duration: 0.5))
|
||||
.animation(.easeInOut(duration: 0.5)) // Animation Duration
|
||||
.transition(.fade) // Fade Transition
|
||||
.scaledToFit()
|
||||
.frame(width: 300, height: 300, alignment: .center)
|
||||
|
@ -118,6 +121,7 @@ var body: some View {
|
|||
// Error
|
||||
}
|
||||
.resizable() // Actually this is not needed unlike SwiftUI.Image
|
||||
.placeholder(UIImage(systemName: "photo")) // Placeholder
|
||||
.indicator(SDWebImageActivityIndicator.medium) // Activity Indicator
|
||||
.transition(.fade) // Fade Transition
|
||||
.scaledToFit() // Attention to call it on AnimatedImage, but not `some View` after View Modifier
|
||||
|
|
Loading…
Reference in New Issue