32 lines
1013 B
Objective-C
32 lines
1013 B
Objective-C
//
|
|
// KSWebImageProtocol.h
|
|
// KSPhotoBrowserDemo
|
|
//
|
|
// Created by Kyle Sun on 22/05/2017.
|
|
// Copyright © 2017 Kyle Sun. All rights reserved.
|
|
//
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
typedef void (^KSImageManagerProgressBlock)(NSInteger receivedSize, NSInteger expectedSize);
|
|
|
|
typedef void (^KSImageManagerCompletionBlock)(UIImage * _Nullable image, NSURL * _Nullable url, BOOL success, NSError * _Nullable error);
|
|
|
|
@protocol KSImageManager
|
|
|
|
+ (Class _Nonnull)imageViewClass;
|
|
|
|
+ (void)setImageForImageView:(nullable UIImageView *)imageView
|
|
withURL:(nullable NSURL *)imageURL
|
|
placeholder:(nullable UIImage *)placeholder
|
|
progress:(nullable KSImageManagerProgressBlock)progress
|
|
completion:(nullable KSImageManagerCompletionBlock)completion;
|
|
|
|
+ (void)cancelImageRequestForImageView:(nullable UIImageView *)imageView;
|
|
|
|
+ (UIImage *_Nullable)imageFromMemoryForURL:(nullable NSURL *)url;
|
|
|
|
+ (UIImage *_Nullable)imageForURL:(nullable NSURL *)url;
|
|
|
|
@end
|