Skip to content

Commit ecfd011

Browse files
author
Lucian Boboc
committed
- added __nullable and __nonnull type annotations for the headers.
1 parent 88e99fc commit ecfd011

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

LBCache.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "LBCache"
4-
s.version = "1.0.1"
4+
s.version = "1.0.2"
55
s.summary = "LBCache image cache framework"
66
s.description = <<-DESC
77
LBCache is an asynchronous image cache framework for iOS.
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
1515
s.license = "MIT"
1616
s.author = { "Lucian Boboc" => "[email protected]" }
1717
s.social_media_url = 'http://twitter.com/lucianboboc'
18-
s.source = { :git => "https://github.com/lucianboboc/LBCache.git", :tag => "1.0.1" }
18+
s.source = { :git => "https://github.com/lucianboboc/LBCache.git", :tag => s.version.to_s }
1919

2020
s.platform = :ios, '8.0'
2121
s.requires_arc = true

LBCache/ImageOperation.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#define kTimeoutInteral 30
1414
#define kMaxConcurrentOperations 2
1515

16-
typedef void(^LBCacheOperationBlock)(UIImage *image, NSError *error);
16+
typedef void(^LBCacheOperationBlock)( UIImage * __nullable image, NSError * __nullable error);
1717
// the ProgressBlock parameter is the percent
1818
typedef void(^ProgressBlock)(NSUInteger percent);
1919

20-
typedef void(^LBCacheImageBlock)(UIImage *image, NSError *error);
20+
typedef void(^LBCacheImageBlock)(UIImage * __nullable image, NSError * __nullable error);
2121

2222
typedef NS_ENUM(NSUInteger,LBCacheImageOptions){
2323

@@ -34,6 +34,6 @@ typedef NS_ENUM(NSUInteger,LBCacheImageOptions){
3434

3535
@interface ImageOperation : NSOperation
3636

37-
- (id) initWithURLString:(NSString *)urlString options:(LBCacheImageOptions)options progressBlock:(ProgressBlock)progressBlock completionBlock:(LBCacheOperationBlock)completionBlock;
37+
- (id __nonnull) initWithURLString:(NSString * __nonnull)urlString options:(LBCacheImageOptions)options progressBlock:(ProgressBlock __nullable)progressBlock completionBlock:(LBCacheOperationBlock __nonnull)completionBlock;
3838

3939
@end

LBCache/LBCacheManager.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ typedef NS_ENUM(NSUInteger, LBCacheError){
4343

4444
@interface LBCacheManager : NSObject
4545

46-
+ (LBCacheManager *) sharedInstance;
46+
+ (LBCacheManager * __nonnull) sharedInstance;
4747

48-
- (ImageOperation *) downloadImageFromURLString: (NSString *) urlString options: (LBCacheImageOptions) options progressBlock: (ProgressBlock) progressBlock completionBlock: (LBCacheImageBlock) completionBlock;
48+
- (ImageOperation * __nullable) downloadImageFromURLString: (NSString * __nonnull) urlString options: (LBCacheImageOptions) options progressBlock: (ProgressBlock __nullable) progressBlock completionBlock: (LBCacheImageBlock __nonnull) completionBlock;
4949

50-
- (NSString *) imagePathLocationForURLString: (NSString *) key;
50+
- (NSString * __nullable) imagePathLocationForURLString: (NSString * __nonnull) key;
5151

52-
- (UIImage *) imageForURLString: (NSString *) urlString;
52+
- (UIImage * __nullable) imageForURLString: (NSString * __nonnull) urlString;
5353

54-
- (NSURL *)applicationCachesDirectory;
55-
- (NSURL *) getLBCacheDirectory;
54+
- (NSURL * __nonnull)applicationCachesDirectory;
55+
- (NSURL * __nonnull) getLBCacheDirectory;
5656

5757
@end

LBCache/NSString+LBcategory.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ typedef NS_ENUM(NSUInteger, HashType){
1616
HashTypeSHA256
1717
};
1818

19-
- (NSString*) lbHashMD5;
20-
- (NSString*) lbHashSHA1;
21-
- (NSString*) lbHashSHA256;
22-
- (NSString*) lbHashWithType: (HashType) hashType;
19+
- (NSString* __nonnull) lbHashMD5;
20+
- (NSString* __nonnull) lbHashSHA1;
21+
- (NSString* __nonnull) lbHashSHA256;
22+
- (NSString* __nonnull) lbHashWithType: (HashType) hashType;
2323

2424
@end

LBCache/UIImageView+LBcategory.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
@interface UIImageView (LBcategory)
1313

14-
- (void) setImageWithURLString: (NSString *) urlString placeholderImage: (UIImage *) placeholderImage;
14+
- (void) setImageWithURLString: (NSString * __nonnull) urlString placeholderImage: (UIImage * __nullable) placeholderImage;
1515

16-
- (void) setImageWithURLString: (NSString *) urlString placeholderImage: (UIImage *) placeholderImage options: (LBCacheImageOptions) option;
16+
- (void) setImageWithURLString: (NSString * __nonnull) urlString placeholderImage: (UIImage * __nullable) placeholderImage options: (LBCacheImageOptions) option;
1717

18-
- (void) setImageWithURLString: (NSString *) urlString placeholderImage: (UIImage *) placeholderImage options: (LBCacheImageOptions) option completionBlock: (LBCacheImageBlock) completionBlock;
18+
- (void) setImageWithURLString: (NSString * __nonnull) urlString placeholderImage: (UIImage * __nullable) placeholderImage options: (LBCacheImageOptions) option completionBlock: (LBCacheImageBlock __nullable) completionBlock;
1919

20-
- (void) setImageWithURLString: (NSString *) urlString placeholderImage: (UIImage *) placeholderImage options: (LBCacheImageOptions) option progressBlock: (ProgressBlock) progressBlock completionBlock: (LBCacheImageBlock) completionBlock;
20+
- (void) setImageWithURLString: (NSString * __nonnull) urlString placeholderImage: (UIImage * __nullable) placeholderImage options: (LBCacheImageOptions) option progressBlock: (ProgressBlock __nullable) progressBlock completionBlock: (LBCacheImageBlock __nullable) completionBlock;
2121

22-
- (UIImage *) imageForURLString: (NSString *) urlString;
22+
- (UIImage * __nullable) imageForURLString: (NSString * __nonnull) urlString;
2323

2424
- (void) cancelDownload;
2525

0 commit comments

Comments
 (0)