-
The same code, in different versions of kingfisher, why the picture animation of the new version of kingfisher disappeared? Note that in the two videos, the code is the same, but the version of kingfisher in the swift package manager on the left is different, and the animation of version 5.15.8 is correct. 2021-02-10.1.27.07.mov2021-02-10.1.27.19.mov |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
code: struct ContentView: View {
@State var imageSize: CGFloat = 300
@State var isPlaying = false
var body: some View {
VStack {
KFImage(URL(string: "https://codeswift.top/app/takeAwayEng/images/210208.jpg")!)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: imageSize, height: imageSize)
.clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
.frame(width: 350, height: 350)
Button(action: {
playButtonAction()
}) {
Image(systemName: self.isPlaying ? "pause.fill" : "play.fill")
.font(.system(size: 60))
}
}
}
func playButtonAction() {
withAnimation(Animation.spring(response: 0.45, dampingFraction: 0.475, blendDuration: 0)) {
if self.imageSize == 300 {
self.imageSize = 350
} else {
self.imageSize = 300
}
self.isPlaying.toggle()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
} |
Beta Was this translation helpful? Give feedback.
-
Kingfisher changed its internal implementation in version 6 and it is a bug. |
Beta Was this translation helpful? Give feedback.
-
Try this branch: fix/hashable-binder |
Beta Was this translation helpful? Give feedback.
Kingfisher changed its internal implementation in version 6 and it is a bug.