Add gif placeholder animation

This commit is contained in:
Ali 2020-05-27 17:04:48 +04:00
parent f737130751
commit e376aa0f21

View File

@ -64,8 +64,10 @@ final class SoftwareVideoThumbnailNode: ASDisplayNode {
if let strongSelf = self {
strongSelf.contents = image.cgImage
if let placeholder = strongSelf.placeholder {
strongSelf.placeholder = placeholder
placeholder.removeFromSupernode()
strongSelf.placeholder = nil
placeholder.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak placeholder] _ in
placeholder?.removeFromSupernode()
})
}
strongSelf.ready?()
}