Skip to content

Commit

Permalink
增加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
chinaxxren committed Jun 12, 2019
1 parent 7ae9e60 commit 567ff91
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 25 deletions.
8 changes: 5 additions & 3 deletions VVRichText.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Pod::Spec.new do |spec|
spec.homepage = "https://github.com/chinaxxren/VVRichText"
spec.license = "MIT"
spec.author = { "chinaxxren" => "182421693@qq.com" }
spec.platform = :ios, "8.0"
spec.source = { :git => "https://github.com/chinaxxren/VVRichText", :tag => "#{spec.version}" }
spec.platform = :ios, "9.0"
spec.source = { :git => "https://github.com/chinaxxren/VVRichText.git", :tag => "#{spec.version}" }
spec.source_files = "VVRichText/Source", "VVRichText/Source/**/*.{h,m}"
spec.frameworks = "YYImage/WebP", "SDWebImage"
spec.frameworks = "UIKit"
spec.dependency "YYImage/WebP"
spec.dependency "SDWebImage"
end
14 changes: 7 additions & 7 deletions VVRichText/Source/VVLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
*
* @param storage 一个VVStorage对象
*/
- (void)addStorage:(VVStorage *)storage;
- (void)addStorage:(nullable VVStorage *)storage;

/**
* 添加一个包含VVStorage对象的数组的所有元素到VVLayout
*
* @param storages 一个包含VVStorage对象的数组
*/
- (void)addStorages:(NSArray <VVStorage *> *)storages;
- (void)addStorages:(nullable NSArray <VVStorage *> *)storages;

/**
* 移除一个VVStorage对象
*
* @param storage 一个VVStorage对象
*/
- (void)removeStorage:(VVStorage *)storage;
- (void)removeStorage:(nullable VVStorage *)storage;

/**
* 移除一个包含VVStorage对象的数组的所有元素
*
* @param storages 一个包含VVStorage对象的数组
*/
- (void)removeStorages:(NSArray <VVStorage *> *)storages;
- (void)removeStorages:(nullable NSArray <VVStorage *> *)storages;

/**
* 获取到一个建议的高度,主要用于UITabelViewCell的高度设定。
Expand All @@ -49,18 +49,18 @@
/**
* 获取包含VVTextStorage的数组
*/
- (NSMutableArray<VVTextStorage *> *)textStorages;
- (nullable NSMutableArray<VVTextStorage *> *)textStorages;

/**
* 获取包含VVImageStorage的数组
*/
- (NSMutableArray<VVImageStorage *> *)imageStorages;
- (nullable NSMutableArray<VVImageStorage *> *)imageStorages;


/**
* 获取包含所有的VVStorage的数组
*/
- (NSMutableArray<VVStorage *> *)totalStorages;
- (nullable NSMutableArray<VVStorage *> *)totalStorages;


@end
Expand Down
14 changes: 7 additions & 7 deletions VVRichText/Source/VVLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
return self;
}

- (void)addStorage:(VVStorage *)storage {
- (void)addStorage:(nullable VVStorage *)storage {
if (!storage) {
return;
}
Expand All @@ -70,7 +70,7 @@ - (void)addStorage:(VVStorage *)storage {
[self.totalStorages addObject:storage];
}

- (void)addStorages:(NSArray <VVStorage *> *)storages {
- (void)addStorages:(nullable NSArray <VVStorage *> *)storages {
if (!storages) {
return;
}
Expand All @@ -83,7 +83,7 @@ - (void)addStorages:(NSArray <VVStorage *> *)storages {
}


- (void)removeStorage:(VVStorage *)storage {
- (void)removeStorage:(nullable VVStorage *)storage {
if (!storage) {
return;
}
Expand All @@ -101,7 +101,7 @@ - (void)removeStorage:(VVStorage *)storage {
}
}

- (void)removeStorages:(NSArray <VVStorage *> *)storages {
- (void)removeStorages:(nullable NSArray <VVStorage *> *)storages {
if (!storages) {
return;
}
Expand All @@ -122,23 +122,23 @@ - (CGFloat)suggestHeightWithBottomMargin:(CGFloat)bottomMargin {

#pragma mark - Getter

- (NSMutableArray *)textStorages {
- (nullable NSMutableArray *)textStorages {
if (_textStorages) {
return _textStorages;
}
_textStorages = [NSMutableArray new];
return _textStorages;
}

- (NSMutableArray *)imageStorages {
- (nullable NSMutableArray *)imageStorages {
if (_imageStorages) {
return _imageStorages;
}
_imageStorages = [NSMutableArray new];
return _imageStorages;
}

- (NSMutableArray *)totalStorages {
- (nullable NSMutableArray *)totalStorages {
if (_totalStorages) {
return _totalStorages;
}
Expand Down
2 changes: 1 addition & 1 deletion VVRichText/Source/VVStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
@interface VVStorage : NSObject

@property(nullable, nonatomic, copy) NSString *identifier;//一个标示字符串,可以用于复用时取到属性相同的UIView对象
@property(nonatomic, copy, nonnull) NSString *identifier;//一个标示字符串,可以用于复用时取到属性相同的UIView对象
@property(nonatomic, assign) NSInteger tag;//一个标示符,跟UIView对象的tag属性作用一样
@property(nonatomic, assign) BOOL clipsToBounds;//是否在边缘剪切,跟UIView对象的clipsToBounds属性作用一样
@property(nonatomic, getter = isOpaque) BOOL opaque;//跟UIView对象的同名属性作用一样
Expand Down
2 changes: 1 addition & 1 deletion VVRichText/Source/VVStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ @implementation VVStorage

#pragma mark - Init

- (id)initWithIdentifier:(NSString *)identifier {
- (_Nonnull id)initWithIdentifier:(NSString *_Nullable)identifier {
self = [super init];
if (self) {
self.identifier = identifier;
Expand Down
4 changes: 0 additions & 4 deletions VVRichText/Source/WebCache/VVAsyncImageView+WebCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@

/**
* 设置VVAsyncImageView的图片内容
* @param imageStorage VVImageStorage对象
* @param placeholder 这个block用于VVHTMLDisplayView渲染时,自动调整图片的比例
* @param cornerRadius 这个block图像显示完毕后回调
*/

- (void)vv_setImageWihtImageStorage:(VVImageStorage *)imageStorage
resize:(VVHTMLImageResizeBlock)resizeBlock
completion:(VVAsyncCompleteBlock)completion;
Expand Down
4 changes: 2 additions & 2 deletions VVRichText/Source/WebCache/YYAnimatedImageView+WebCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ typedef void(^SDSetImageBlock)(UIImage *_Nullable image, NSData *_Nullable image

- (void)sd_setImageWithURL:(nullable NSURL *)url
placeholderImage:(nullable UIImage *)placeholder
imageStorage:(VVImageStorage *)imageStorage
imageStorage:(nullable VVImageStorage *)imageStorage
completed:(nullable SDExternalCompletionBlock)completedBlock;

- (void)sd_internalSetImageWithURL:(nullable NSURL *)url
placeholderImage:(nullable UIImage *)placeholder
imageStorage:(VVImageStorage *)imageStorage
imageStorage:(nullable VVImageStorage *)imageStorage
options:(SDWebImageOptions)options
context:(nullable SDWebImageContext *)context
setImageBlock:(nullable SDSetImageBlock)setImageBlock
Expand Down

0 comments on commit 567ff91

Please sign in to comment.