|
@@ -74,7 +74,12 @@ static char imageURLStorageKey; |
|
@@ -74,7 +74,12 @@ static char imageURLStorageKey; |
74
|
dispatch_main_sync_safe(^{
|
74
|
dispatch_main_sync_safe(^{
|
75
|
__strong UIButton *sself = wself;
|
75
|
__strong UIButton *sself = wself;
|
76
|
if (!sself) return;
|
76
|
if (!sself) return;
|
77
|
- if (image) {
|
77
|
+ if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
|
|
|
78
|
+ {
|
|
|
79
|
+ completedBlock(image, error, cacheType, url);
|
|
|
80
|
+ return;
|
|
|
81
|
+ }
|
|
|
82
|
+ else if (image) {
|
78
|
[sself setImage:image forState:state];
|
83
|
[sself setImage:image forState:state];
|
79
|
}
|
84
|
}
|
80
|
if (completedBlock && finished) {
|
85
|
if (completedBlock && finished) {
|
|
@@ -117,7 +122,12 @@ static char imageURLStorageKey; |
|
@@ -117,7 +122,12 @@ static char imageURLStorageKey; |
117
|
dispatch_main_sync_safe(^{
|
122
|
dispatch_main_sync_safe(^{
|
118
|
__strong UIButton *sself = wself;
|
123
|
__strong UIButton *sself = wself;
|
119
|
if (!sself) return;
|
124
|
if (!sself) return;
|
120
|
- if (image) {
|
125
|
+ if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
|
|
|
126
|
+ {
|
|
|
127
|
+ completedBlock(image, error, cacheType, url);
|
|
|
128
|
+ return;
|
|
|
129
|
+ }
|
|
|
130
|
+ else if (image) {
|
121
|
[sself setBackgroundImage:image forState:state];
|
131
|
[sself setBackgroundImage:image forState:state];
|
122
|
}
|
132
|
}
|
123
|
if (completedBlock && finished) {
|
133
|
if (completedBlock && finished) {
|