Fix the build: UIButton and UIImageView are not defined on Mac OS or WatchOS
This commit is contained in:
parent
1cbe54d600
commit
e642024688
|
@ -97,13 +97,17 @@ static char TAG_ACTIVITY_SHOW;
|
|||
- (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock {
|
||||
if (setImageBlock) {
|
||||
setImageBlock(image, imageData);
|
||||
} else if ([self isKindOfClass:[UIImageView class]]) {
|
||||
return;
|
||||
}
|
||||
#if SD_UIKIT
|
||||
if ([self isKindOfClass:[UIImageView class]]) {
|
||||
UIImageView *imageView = (UIImageView *)self;
|
||||
imageView.image = image;
|
||||
} else if ([self isKindOfClass:[UIButton class]]) {
|
||||
UIButton *button = (UIButton *)self;
|
||||
[button setImage:image forState:UIControlStateNormal];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)sd_setNeedsLayout {
|
||||
|
|
Loading…
Reference in New Issue