//
|
// UIImageView+YTH.m
|
// PapayaPlayerDaqo
|
//
|
// Created by 味口 on 15-6-24.
|
// Copyright (c) 2015年 wgj. All rights reserved.
|
//
|
|
#import "UIImageView+YTH.h"
|
@implementation UIImageView (YTH)
|
|
#pragma mark 设置网络图片
|
- (void)setYthImageWithURL:(NSString *)urlStr placeholderImage:(UIImage *)placeholder{
|
if (urlStr.length>4) {
|
if ([[urlStr substringWithRange:NSMakeRange(0, 4)] isEqualToString:@"http"]) {
|
[self yy_setImageWithURL:[NSURL URLWithString:urlStr] placeholder:placeholder options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation progress:^(NSInteger receivedSize, NSInteger expectedSize) {
|
|
} transform:^UIImage * _Nullable(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
return image;
|
} completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
|
|
}];
|
}else{
|
[self yy_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",ImageUrl,urlStr]] placeholder:placeholder options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation progress:^(NSInteger receivedSize, NSInteger expectedSize) {
|
|
} transform:^UIImage * _Nullable(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
return image;
|
} completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
|
|
}];
|
}
|
}
|
}
|
|
@end
|