-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error image with custom Placeholder fix #1925
Conversation
Any chance of this being looked at? |
@PJ-LT Sorry for the late reply. It looks good to me and I was just a bit busy recently on other projects. I will merge and tag it ASAP! Thanks for the contribution! |
@onevcat Awesome, thanks so much! |
CallbackQueue.mainCurrentOrAsync.execute { | ||
context.onFailureDelegate.call(KingfisherError.imageSettingError(reason: .emptySource)) | ||
if let image = context.options.onFailureImage { | ||
self.loadedImage = image | ||
} | ||
self.loading = false | ||
self.loaded = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to pass weak or unowned self here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
This fixes an issue where custom Placeholders are never removed when an error occurs even when there is an Error Image that should be shown instead.
Steps to reproduce:
Note: Unit Test added for UIKit failed without fix and passes with fix