diff --git a/VVRichText.podspec b/VVRichText.podspec index 5d8a6d8..4b56fe5 100644 --- a/VVRichText.podspec +++ b/VVRichText.podspec @@ -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 diff --git a/VVRichText/Source/VVLayout.h b/VVRichText/Source/VVLayout.h index 7521f86..46bbee8 100755 --- a/VVRichText/Source/VVLayout.h +++ b/VVRichText/Source/VVLayout.h @@ -12,28 +12,28 @@ * * @param storage 一个VVStorage对象 */ -- (void)addStorage:(VVStorage *)storage; +- (void)addStorage:(nullable VVStorage *)storage; /** * 添加一个包含VVStorage对象的数组的所有元素到VVLayout * * @param storages 一个包含VVStorage对象的数组 */ -- (void)addStorages:(NSArray *)storages; +- (void)addStorages:(nullable NSArray *)storages; /** * 移除一个VVStorage对象 * * @param storage 一个VVStorage对象 */ -- (void)removeStorage:(VVStorage *)storage; +- (void)removeStorage:(nullable VVStorage *)storage; /** * 移除一个包含VVStorage对象的数组的所有元素 * * @param storages 一个包含VVStorage对象的数组 */ -- (void)removeStorages:(NSArray *)storages; +- (void)removeStorages:(nullable NSArray *)storages; /** * 获取到一个建议的高度,主要用于UITabelViewCell的高度设定。 @@ -49,18 +49,18 @@ /** * 获取包含VVTextStorage的数组 */ -- (NSMutableArray *)textStorages; +- (nullable NSMutableArray *)textStorages; /** * 获取包含VVImageStorage的数组 */ -- (NSMutableArray *)imageStorages; +- (nullable NSMutableArray *)imageStorages; /** * 获取包含所有的VVStorage的数组 */ -- (NSMutableArray *)totalStorages; +- (nullable NSMutableArray *)totalStorages; @end diff --git a/VVRichText/Source/VVLayout.m b/VVRichText/Source/VVLayout.m index 89f9e26..d0f705e 100755 --- a/VVRichText/Source/VVLayout.m +++ b/VVRichText/Source/VVLayout.m @@ -54,7 +54,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder { return self; } -- (void)addStorage:(VVStorage *)storage { +- (void)addStorage:(nullable VVStorage *)storage { if (!storage) { return; } @@ -70,7 +70,7 @@ - (void)addStorage:(VVStorage *)storage { [self.totalStorages addObject:storage]; } -- (void)addStorages:(NSArray *)storages { +- (void)addStorages:(nullable NSArray *)storages { if (!storages) { return; } @@ -83,7 +83,7 @@ - (void)addStorages:(NSArray *)storages { } -- (void)removeStorage:(VVStorage *)storage { +- (void)removeStorage:(nullable VVStorage *)storage { if (!storage) { return; } @@ -101,7 +101,7 @@ - (void)removeStorage:(VVStorage *)storage { } } -- (void)removeStorages:(NSArray *)storages { +- (void)removeStorages:(nullable NSArray *)storages { if (!storages) { return; } @@ -122,7 +122,7 @@ - (CGFloat)suggestHeightWithBottomMargin:(CGFloat)bottomMargin { #pragma mark - Getter -- (NSMutableArray *)textStorages { +- (nullable NSMutableArray *)textStorages { if (_textStorages) { return _textStorages; } @@ -130,7 +130,7 @@ - (NSMutableArray *)textStorages { return _textStorages; } -- (NSMutableArray *)imageStorages { +- (nullable NSMutableArray *)imageStorages { if (_imageStorages) { return _imageStorages; } @@ -138,7 +138,7 @@ - (NSMutableArray *)imageStorages { return _imageStorages; } -- (NSMutableArray *)totalStorages { +- (nullable NSMutableArray *)totalStorages { if (_totalStorages) { return _totalStorages; } diff --git a/VVRichText/Source/VVStorage.h b/VVRichText/Source/VVStorage.h index 4ef0637..77a514d 100755 --- a/VVRichText/Source/VVStorage.h +++ b/VVRichText/Source/VVStorage.h @@ -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对象的同名属性作用一样 diff --git a/VVRichText/Source/VVStorage.m b/VVRichText/Source/VVStorage.m index 3fe7109..28e77b0 100755 --- a/VVRichText/Source/VVStorage.m +++ b/VVRichText/Source/VVStorage.m @@ -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; diff --git a/VVRichText/Source/WebCache/VVAsyncImageView+WebCache.h b/VVRichText/Source/WebCache/VVAsyncImageView+WebCache.h index c266453..4341abf 100755 --- a/VVRichText/Source/WebCache/VVAsyncImageView+WebCache.h +++ b/VVRichText/Source/WebCache/VVAsyncImageView+WebCache.h @@ -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; diff --git a/VVRichText/Source/WebCache/YYAnimatedImageView+WebCache.h b/VVRichText/Source/WebCache/YYAnimatedImageView+WebCache.h index 6b851ec..32c4d36 100644 --- a/VVRichText/Source/WebCache/YYAnimatedImageView+WebCache.h +++ b/VVRichText/Source/WebCache/YYAnimatedImageView+WebCache.h @@ -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