Replies: 1 comment 2 replies
-
Your If you want to customize a specific image and use the existing loading behavior for other images, you could do something like: class MyCustomImageProvider: AnimationImageProvider {
init(base: AnimationImageProvider?) {
baseImageProvider = base
}
let baseImageProvider: AnimationImageProvider?
func imageForAsset(asset: ImageAsset) -> CGImage? {
guard someCondition else {
// fall back to the base image provider for images we don't want to customize
return baseImageProvider?.imageForAsset(asset: asset)
}
let image = UIImage(named: "shadow_left_ic")
return image?.cgImage
}
} and: let existingImageProvider = animationView.imageProvider
animationView.imageProvider = MyCustomImageProvider(base: existingImageProvider) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I return nil - the image not visible. But I don't know how to map ImageAsset to CGImage. Help me please.
Beta Was this translation helpful? Give feedback.
All reactions