I'm taking a SwiftUI course and am trying to get this animation method figured out and for some reason it's not compiling.
Haven't coded in a while with swift, could someone please point me in the right direction?
Thank you
struct ContentView: View {
private let imageURL: String = "https://credo.academy/credo-academy@3x.png"
var body: some View {
AsyncImage(url: URL(string: imageURL), transaction: Transaction(animation: .interactiveSpring(response: 0.5, dampingFraction: 0.6, blendDuration: 0.25))) {
phase in
switch phase {
case .success(let image):
image
.imageModifier()
.transition(.move(edge: .bottom))
case .failure(_):
Image(systemName: "ant.circle.fill").iconModifier()
case.empty:
Image(systemName: "photo.circle.fill").iconModifier()
@unknown default:
ProgressView()
}
}
.padding(40)
}
}
Sadly, the issue was fixed by restarting xcode
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.