Authored by DreamPiggy
Committed by GitHub

Merge pull request #2043 from dreampiggy/set_uibutton_placeholder_if_url_is_nil

Set UIButton's placeholer-image even if the url is nil
... ... @@ -71,10 +71,9 @@ static inline NSString * backgroundImageURLKeyForState(UIControlState state) {
completed:(nullable SDExternalCompletionBlock)completedBlock {
if (!url) {
[self.imageURLStorage removeObjectForKey:imageURLKeyForState(state)];
return;
}
} else {
self.imageURLStorage[imageURLKeyForState(state)] = url;
}
__weak typeof(self)weakSelf = self;
[self sd_internalSetImageWithURL:url
... ... @@ -131,10 +130,9 @@ static inline NSString * backgroundImageURLKeyForState(UIControlState state) {
completed:(nullable SDExternalCompletionBlock)completedBlock {
if (!url) {
[self.imageURLStorage removeObjectForKey:backgroundImageURLKeyForState(state)];
return;
}
} else {
self.imageURLStorage[backgroundImageURLKeyForState(state)] = url;
}
__weak typeof(self)weakSelf = self;
[self sd_internalSetImageWithURL:url
... ...