Skip to content

Commit

Permalink
- added __nullable and __nonnull type annotations for the headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianboboc committed Jun 18, 2015
1 parent 88e99fc commit ecfd011
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions LBCache.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "LBCache"
s.version = "1.0.1"
s.version = "1.0.2"
s.summary = "LBCache image cache framework"
s.description = <<-DESC
LBCache is an asynchronous image cache framework for iOS.
Expand All @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.license = "MIT"
s.author = { "Lucian Boboc" => "info@lucianboboc.com" }
s.social_media_url = 'http://twitter.com/lucianboboc'
s.source = { :git => "https://github.com/lucianboboc/LBCache.git", :tag => "1.0.1" }
s.source = { :git => "https://github.com/lucianboboc/LBCache.git", :tag => s.version.to_s }

s.platform = :ios, '8.0'
s.requires_arc = true
Expand Down
6 changes: 3 additions & 3 deletions LBCache/ImageOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#define kTimeoutInteral 30
#define kMaxConcurrentOperations 2

typedef void(^LBCacheOperationBlock)(UIImage *image, NSError *error);
typedef void(^LBCacheOperationBlock)( UIImage * __nullable image, NSError * __nullable error);
// the ProgressBlock parameter is the percent
typedef void(^ProgressBlock)(NSUInteger percent);

typedef void(^LBCacheImageBlock)(UIImage *image, NSError *error);
typedef void(^LBCacheImageBlock)(UIImage * __nullable image, NSError * __nullable error);

typedef NS_ENUM(NSUInteger,LBCacheImageOptions){

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

@interface ImageOperation : NSOperation

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

@end
12 changes: 6 additions & 6 deletions LBCache/LBCacheManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ typedef NS_ENUM(NSUInteger, LBCacheError){

@interface LBCacheManager : NSObject

+ (LBCacheManager *) sharedInstance;
+ (LBCacheManager * __nonnull) sharedInstance;

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

- (NSString *) imagePathLocationForURLString: (NSString *) key;
- (NSString * __nullable) imagePathLocationForURLString: (NSString * __nonnull) key;

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

- (NSURL *)applicationCachesDirectory;
- (NSURL *) getLBCacheDirectory;
- (NSURL * __nonnull)applicationCachesDirectory;
- (NSURL * __nonnull) getLBCacheDirectory;

@end
8 changes: 4 additions & 4 deletions LBCache/NSString+LBcategory.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ typedef NS_ENUM(NSUInteger, HashType){
HashTypeSHA256
};

- (NSString*) lbHashMD5;
- (NSString*) lbHashSHA1;
- (NSString*) lbHashSHA256;
- (NSString*) lbHashWithType: (HashType) hashType;
- (NSString* __nonnull) lbHashMD5;
- (NSString* __nonnull) lbHashSHA1;
- (NSString* __nonnull) lbHashSHA256;
- (NSString* __nonnull) lbHashWithType: (HashType) hashType;

@end
10 changes: 5 additions & 5 deletions LBCache/UIImageView+LBcategory.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

@interface UIImageView (LBcategory)

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

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

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

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

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

- (void) cancelDownload;

Expand Down

0 comments on commit ecfd011

Please sign in to comment.