Added support for SDWebImageAvoidAutoSetImage option to UIButton and highlighted UIImageView
This commit is contained in:
parent
14842f65f7
commit
05ce156764
|
@ -74,7 +74,12 @@ static char imageURLStorageKey;
|
||||||
dispatch_main_sync_safe(^{
|
dispatch_main_sync_safe(^{
|
||||||
__strong UIButton *sself = wself;
|
__strong UIButton *sself = wself;
|
||||||
if (!sself) return;
|
if (!sself) return;
|
||||||
if (image) {
|
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
|
||||||
|
{
|
||||||
|
completedBlock(image, error, cacheType, url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (image) {
|
||||||
[sself setImage:image forState:state];
|
[sself setImage:image forState:state];
|
||||||
}
|
}
|
||||||
if (completedBlock && finished) {
|
if (completedBlock && finished) {
|
||||||
|
@ -117,7 +122,12 @@ static char imageURLStorageKey;
|
||||||
dispatch_main_sync_safe(^{
|
dispatch_main_sync_safe(^{
|
||||||
__strong UIButton *sself = wself;
|
__strong UIButton *sself = wself;
|
||||||
if (!sself) return;
|
if (!sself) return;
|
||||||
if (image) {
|
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
|
||||||
|
{
|
||||||
|
completedBlock(image, error, cacheType, url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (image) {
|
||||||
[sself setBackgroundImage:image forState:state];
|
[sself setBackgroundImage:image forState:state];
|
||||||
}
|
}
|
||||||
if (completedBlock && finished) {
|
if (completedBlock && finished) {
|
||||||
|
|
|
@ -39,7 +39,12 @@
|
||||||
dispatch_main_sync_safe (^
|
dispatch_main_sync_safe (^
|
||||||
{
|
{
|
||||||
if (!wself) return;
|
if (!wself) return;
|
||||||
if (image) {
|
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
|
||||||
|
{
|
||||||
|
completedBlock(image, error, cacheType, url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (image) {
|
||||||
wself.highlightedImage = image;
|
wself.highlightedImage = image;
|
||||||
[wself setNeedsLayout];
|
[wself setNeedsLayout];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue