[英]SwiftUI receiving "Editor placeholder in source file" and "Protocol 'Equatable' as a type cannot conform to the protocol itself" errors
I'm taking a SwiftUI course and am trying to get this animation method figured out and for some reason it's not compiling.我正在参加 SwiftUI 课程,并试图弄清楚这个 animation 方法,但由于某种原因它没有编译。
Haven't coded in a while with swift, could someone please point me in the right direction?有一段时间没有使用 swift 进行编码,有人可以指出我正确的方向吗?
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可悲的是,通过重启 xcode 解决了这个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.