58 lines
1.8 KiB
Objective-C
58 lines
1.8 KiB
Objective-C
//
|
|
// UIImageView+LoadImage.h
|
|
// xplan-ios
|
|
//
|
|
// Created by 冯硕 on 2021/9/17.
|
|
// 加载图片的类
|
|
|
|
#import <UIKit/UIKit.h>
|
|
#import "UIImageConstant.h"
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
typedef void(^LoadImageSuccess)(UIImage *image, NSURL * url);
|
|
|
|
@interface UIImageView (LoadImage)
|
|
/// 加载图片
|
|
/// @param url 图片的链接地址
|
|
/// @param placeholderImage 站位图
|
|
/// @param type 类型 用于设置大小
|
|
/// @param cornerRadious 弧度
|
|
/// @param complection 成功的回调
|
|
- (void)load_imageWithUrl:(NSString *)url
|
|
placeholderImage:(UIImage *)placeholderImage
|
|
type:(ImageType)type
|
|
cornerRadious:(CGFloat)cornerRadious
|
|
complection:(nullable LoadImageSuccess)complection;
|
|
|
|
/// 加载图片 回调图片的
|
|
/// @param url 图片的链接地址
|
|
/// @param placeholderImage 站位图
|
|
/// @param complection 成功了
|
|
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage type:(ImageType)type complection:(nullable LoadImageSuccess)complection;
|
|
|
|
/// 加载图片不需要成功的回调
|
|
/// @param url 图片的链接地址
|
|
/// @param placeholderImage 站位图
|
|
/// @param type 类型 用于设置大小
|
|
/// @param cornerRadious 弧度
|
|
- (void)load_imageWithUrl:(NSString *)url
|
|
placeholderImage:(UIImage *)placeholderImage
|
|
type:(ImageType)type
|
|
cornerRadious:(CGFloat)cornerRadious;
|
|
|
|
/// 加载图片 没有圆角的设置
|
|
/// @param url 图片的链接地址
|
|
/// @param placeholderImage 站位图
|
|
/// @param type 类型 用于设置大小
|
|
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage type:(ImageType)type;
|
|
|
|
/// 加载图片 没有类型的设置
|
|
/// @param url 图片的链接地址
|
|
/// @param placeholderImage 站位图
|
|
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage;
|
|
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|