Updated bitwise operator to correctly find option if more than 1 are included
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -41,7 +41,7 @@ static char operationArrayKey; | @@ -41,7 +41,7 @@ static char operationArrayKey; | ||
41 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { | 41 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { |
42 | [self cancelCurrentImageLoad]; | 42 | [self cancelCurrentImageLoad]; |
43 | 43 | ||
44 | - if (options != SDWebImageDelayPlaceholder) { | 44 | + if (!(options & SDWebImageDelayPlaceholder)) { |
45 | self.image = placeholder; | 45 | self.image = placeholder; |
46 | } | 46 | } |
47 | 47 | ||
@@ -55,7 +55,7 @@ static char operationArrayKey; | @@ -55,7 +55,7 @@ static char operationArrayKey; | ||
55 | wself.image = image; | 55 | wself.image = image; |
56 | [wself setNeedsLayout]; | 56 | [wself setNeedsLayout]; |
57 | } else { | 57 | } else { |
58 | - if (options == SDWebImageDelayPlaceholder) { | 58 | + if (options & SDWebImageDelayPlaceholder) { |
59 | wself.image = placeholder; | 59 | wself.image = placeholder; |
60 | [wself setNeedsLayout]; | 60 | [wself setNeedsLayout]; |
61 | } | 61 | } |
-
Please register or login to post a comment