Change the options result property into readonly, add documentations

This commit is contained in:
DreamPiggy 2019-05-25 12:21:50 +08:00
parent 0dbcb98c6f
commit d6852db8d0
2 changed files with 26 additions and 2 deletions

View File

@ -19,9 +19,23 @@ typedef SDWebImageOptionsResult * _Nullable(^SDWebImageOptionsProcessorBlock)(NS
*/
@interface SDWebImageOptionsResult : NSObject
@property (nonatomic, assign) SDWebImageOptions options;
@property (nonatomic, copy, nullable) SDWebImageContext *context;
/**
WebCache options.
*/
@property (nonatomic, assign, readonly) SDWebImageOptions options;
/**
Context options.
*/
@property (nonatomic, copy, readonly, nullable) SDWebImageContext *context;
/**
Create a new options result.
@param options options
@param context context
@return The options result contains both options and context.
*/
- (nonnull instancetype)initWithOptions:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context;
@end
@ -47,6 +61,9 @@ typedef SDWebImageOptionsResult * _Nullable(^SDWebImageOptionsProcessorBlock)(NS
@end
/**
A options processor class with block.
*/
@interface SDWebImageOptionsProcessor : NSObject<SDWebImageOptionsProcessor>
- (nonnull instancetype)initWithBlock:(nonnull SDWebImageOptionsProcessorBlock)block;

View File

@ -8,6 +8,13 @@
#import "SDWebImageOptionsProcessor.h"
@interface SDWebImageOptionsResult ()
@property (nonatomic, assign) SDWebImageOptions options;
@property (nonatomic, copy, nullable) SDWebImageContext *context;
@end
@implementation SDWebImageOptionsResult
- (instancetype)initWithOptions:(SDWebImageOptions)options context:(SDWebImageContext *)context {