Added support for SDWebImageAvoidAutoSetImage option to UIButton and highlighted UIImageView

This commit is contained in:
Xenon 2015-09-23 04:23:11 +03:00
parent 14842f65f7
commit 05ce156764
2 changed files with 18 additions and 3 deletions

View File

@ -74,7 +74,12 @@ static char imageURLStorageKey;
dispatch_main_sync_safe(^{
__strong UIButton *sself = wself;
if (!sself) return;
if (image) {
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
{
completedBlock(image, error, cacheType, url);
return;
}
else if (image) {
[sself setImage:image forState:state];
}
if (completedBlock && finished) {
@ -117,7 +122,12 @@ static char imageURLStorageKey;
dispatch_main_sync_safe(^{
__strong UIButton *sself = wself;
if (!sself) return;
if (image) {
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
{
completedBlock(image, error, cacheType, url);
return;
}
else if (image) {
[sself setBackgroundImage:image forState:state];
}
if (completedBlock && finished) {

View File

@ -39,7 +39,12 @@
dispatch_main_sync_safe (^
{
if (!wself) return;
if (image) {
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
{
completedBlock(image, error, cacheType, url);
return;
}
else if (image) {
wself.highlightedImage = image;
[wself setNeedsLayout];
}