Fix the build: UIButton and UIImageView are not defined on Mac OS or WatchOS

This commit is contained in:
Bogdan Poplauschi 2016-09-25 20:07:12 +03:00
parent 1cbe54d600
commit e642024688
1 changed files with 5 additions and 1 deletions

View File

@ -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 {