Merge pull request #1310 from xzenon/patch

Added support for SDWebImageAvoidAutoSetImage option to UIButton and highlighted UIImageView categories
This commit is contained in:
Konstantinos K. 2015-09-23 09:01:54 +03:00
commit b185621812
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];
}