Skip to content

Commit 3e1af93

Browse files
committed
change prefix to lowercase #138
1 parent b126d92 commit 3e1af93

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

FastImageCache/FastImageCache/FastImageCache/FICEntity.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ typedef void (^FICEntityImageDrawingBlock)(CGContextRef context, CGSize contextS
2424
@discussion Within each image table, each entry is identified by an entity's UUID. Ideally, this value should never change for an entity. For example, if your entity class is a person
2525
model, its UUID might be an API-assigned, unchanging, unique user ID. No matter how the properties of the person change, its user ID should never change.
2626
*/
27-
@property (nonatomic, copy, readonly) NSString *FIC_UUID;
27+
@property (nonatomic, copy, readonly) NSString *fic_UUID;
2828

2929
/**
3030
A string that uniquely identifies an entity's source image.
3131
3232
@discussion While `<UUID>` should be unchanging, a source image UUID might change. For example, if your entity class is a person model, its source image UUID might change every time the
3333
person changes their profile photo. In this case, the source image UUID might be a hash of the profile photo URL (assuming each image is given a unique URL).
3434
*/
35-
@property (nonatomic, copy, readonly) NSString *FIC_sourceImageUUID;
35+
@property (nonatomic, copy, readonly) NSString *fic_sourceImageUUID;
3636

3737
/**
3838
Returns the source image URL associated with a specific format name.
@@ -52,7 +52,7 @@ typedef void (^FICEntityImageDrawingBlock)(CGContextRef context, CGSize contextS
5252
@see FICImageFormat
5353
@see [FICImageCacheDelegate imageCache:wantsSourceImageForEntity:withFormatName:completionBlock:]
5454
*/
55-
- (NSURL *)FIC_sourceImageURLWithFormatName:(NSString *)formatName;
55+
- (NSURL *)fic_sourceImageURLWithFormatName:(NSString *)formatName;
5656

5757
/**
5858
Returns the drawing block for a specific image and format name.
@@ -73,14 +73,14 @@ typedef void (^FICEntityImageDrawingBlock)(CGContextRef context, CGSize contextS
7373
7474
@note This block will always be called from the serial dispatch queue used by the image cache.
7575
*/
76-
- (FICEntityImageDrawingBlock)FIC_drawingBlockForImage:(UIImage *)image withFormatName:(NSString *)formatName;
76+
- (FICEntityImageDrawingBlock)fic_drawingBlockForImage:(UIImage *)image withFormatName:(NSString *)formatName;
7777

7878
@optional
7979
/**
8080
Returns the image for a format
8181
8282
@param format The image format that identifies which image table is requesting the source image.
8383
*/
84-
- (UIImage *)FIC_imageForFormat:(FICImageFormat *)format;
84+
- (UIImage *)fic_imageForFormat:(FICImageFormat *)format;
8585

8686
@end

FastImageCache/FastImageCache/FastImageCache/FICImageCache.m

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ - (BOOL)_retrieveImageForEntity:(id <FICEntity>)entity withFormatName:(NSString
163163
BOOL imageExists = NO;
164164

165165
FICImageTable *imageTable = [_imageTables objectForKey:formatName];
166-
NSString *entityUUID = [entity FIC_UUID];
167-
NSString *sourceImageUUID = [entity FIC_sourceImageUUID];
166+
NSString *entityUUID = [entity fic_UUID];
167+
NSString *sourceImageUUID = [entity fic_sourceImageUUID];
168168

169169
if (loadSynchronously == NO && [imageTable entryExistsForEntityUUID:entityUUID sourceImageUUID:sourceImageUUID]) {
170170
imageExists = YES;
@@ -196,7 +196,7 @@ - (BOOL)_retrieveImageForEntity:(id <FICEntity>)entity withFormatName:(NSString
196196

197197
if (image == nil) {
198198
// No image for this UUID exists in the image table. We'll need to ask the delegate to retrieve the source asset.
199-
NSURL *sourceImageURL = [entity FIC_sourceImageURLWithFormatName:formatName];
199+
NSURL *sourceImageURL = [entity fic_sourceImageURLWithFormatName:formatName];
200200

201201
if (sourceImageURL != nil) {
202202
// We check to see if this image is already being fetched.
@@ -216,9 +216,9 @@ - (BOOL)_retrieveImageForEntity:(id <FICEntity>)entity withFormatName:(NSString
216216
if (needsToFetch) {
217217
@autoreleasepool {
218218
UIImage *image;
219-
if ([entity respondsToSelector:@selector(FIC_imageForFormat:)]){
219+
if ([entity respondsToSelector:@selector(fic_imageForFormat:)]){
220220
FICImageFormat *format = [self formatWithName:formatName];
221-
image = [entity FIC_imageForFormat:format];
221+
image = [entity fic_imageForFormat:format];
222222
}
223223

224224
if (image){
@@ -274,7 +274,7 @@ - (void)_imageDidLoad:(UIImage *)image forURL:(NSURL *)URL {
274274
}
275275

276276
static void _FICAddCompletionBlockForEntity(NSString *formatName, NSMutableDictionary *entityRequestsDictionary, id <FICEntity> entity, FICImageCacheCompletionBlock completionBlock) {
277-
NSString *entityUUID = [entity FIC_UUID];
277+
NSString *entityUUID = [entity fic_UUID];
278278
NSMutableDictionary *requestDictionary = [entityRequestsDictionary objectForKey:entityUUID];
279279
NSMutableDictionary *completionBlocks = nil;
280280

@@ -315,7 +315,7 @@ - (void)setImage:(UIImage *)image forEntity:(id <FICEntity>)entity withFormatNam
315315
completionBlocksDictionary = [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:[completionBlock copy]] forKey:formatName];
316316
}
317317

318-
NSString *entityUUID = [entity FIC_UUID];
318+
NSString *entityUUID = [entity fic_UUID];
319319
FICImageTable *imageTable = [_imageTables objectForKey:formatName];
320320
if (imageTable) {
321321
[imageTable deleteEntryForEntityUUID:entityUUID];
@@ -338,21 +338,21 @@ - (void)_processImage:(UIImage *)image forEntity:(id <FICEntity>)entity completi
338338

339339
- (void)_processImage:(UIImage *)image forEntity:(id <FICEntity>)entity imageTable:(FICImageTable *)imageTable completionBlocks:(NSArray *)completionBlocks {
340340
if (imageTable != nil) {
341-
if ([entity FIC_UUID] == nil) {
341+
if ([entity fic_UUID] == nil) {
342342
[self _logMessage:[NSString stringWithFormat:@"*** FIC Error: %s entity %@ is missing its UUID.", __PRETTY_FUNCTION__, entity]];
343343
return;
344344
}
345345

346-
if ([entity FIC_sourceImageUUID] == nil) {
346+
if ([entity fic_sourceImageUUID] == nil) {
347347
[self _logMessage:[NSString stringWithFormat:@"*** FIC Error: %s entity %@ is missing its source image UUID.", __PRETTY_FUNCTION__, entity]];
348348
return;
349349
}
350350

351-
NSString *entityUUID = [entity FIC_UUID];
352-
NSString *sourceImageUUID = [entity FIC_sourceImageUUID];
351+
NSString *entityUUID = [entity fic_UUID];
352+
NSString *sourceImageUUID = [entity fic_sourceImageUUID];
353353
FICImageFormat *imageFormat = [imageTable imageFormat];
354354
NSString *imageFormatName = [imageFormat name];
355-
FICEntityImageDrawingBlock imageDrawingBlock = [entity FIC_drawingBlockForImage:image withFormatName:imageFormatName];
355+
FICEntityImageDrawingBlock imageDrawingBlock = [entity fic_drawingBlockForImage:image withFormatName:imageFormatName];
356356

357357
dispatch_async([FICImageCache dispatchQueue], ^{
358358
[imageTable setEntryForEntityUUID:entityUUID sourceImageUUID:sourceImageUUID imageDrawingBlock:imageDrawingBlock];
@@ -412,7 +412,7 @@ - (NSSet *)formatsToProcessForCompletionBlocks:(NSDictionary *)completionBlocksD
412412
}
413413

414414
// If the image already exists, keep going
415-
if ([table entryExistsForEntityUUID:entity.FIC_UUID sourceImageUUID:entity.FIC_sourceImageUUID]) {
415+
if ([table entryExistsForEntityUUID:entity.fic_UUID sourceImageUUID:entity.fic_sourceImageUUID]) {
416416
continue;
417417
}
418418

@@ -427,8 +427,8 @@ - (NSSet *)formatsToProcessForCompletionBlocks:(NSDictionary *)completionBlocksD
427427

428428
- (BOOL)imageExistsForEntity:(id <FICEntity>)entity withFormatName:(NSString *)formatName {
429429
FICImageTable *imageTable = [_imageTables objectForKey:formatName];
430-
NSString *entityUUID = [entity FIC_UUID];
431-
NSString *sourceImageUUID = [entity FIC_sourceImageUUID];
430+
NSString *entityUUID = [entity fic_UUID];
431+
NSString *sourceImageUUID = [entity fic_sourceImageUUID];
432432

433433
BOOL imageExists = [imageTable entryExistsForEntityUUID:entityUUID sourceImageUUID:sourceImageUUID];
434434

@@ -439,13 +439,13 @@ - (BOOL)imageExistsForEntity:(id <FICEntity>)entity withFormatName:(NSString *)f
439439

440440
- (void)deleteImageForEntity:(id <FICEntity>)entity withFormatName:(NSString *)formatName {
441441
FICImageTable *imageTable = [_imageTables objectForKey:formatName];
442-
NSString *entityUUID = [entity FIC_UUID];
442+
NSString *entityUUID = [entity fic_UUID];
443443
[imageTable deleteEntryForEntityUUID:entityUUID];
444444
}
445445

446446
- (void)cancelImageRetrievalForEntity:(id <FICEntity>)entity withFormatName:(NSString *)formatName {
447-
NSURL *sourceImageURL = [entity FIC_sourceImageURLWithFormatName:formatName];
448-
NSString *entityUUID = [entity FIC_UUID];
447+
NSURL *sourceImageURL = [entity fic_sourceImageURLWithFormatName:formatName];
448+
NSString *entityUUID = [entity fic_UUID];
449449

450450
BOOL cancelImageLoadingForEntity = NO;
451451
@synchronized (_requests) {

FastImageCache/FastImageCacheDemo/Classes/FICDPhoto.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ - (void)deleteThumbnail {
167167

168168
#pragma mark - FICImageCacheEntity
169169

170-
- (NSString *)FIC_UUID {
170+
- (NSString *)fic_UUID {
171171
if (_UUID == nil) {
172172
// MD5 hashing is expensive enough that we only want to do it once
173173
NSString *imageName = [_sourceImageURL lastPathComponent];
@@ -178,15 +178,15 @@ - (NSString *)FIC_UUID {
178178
return _UUID;
179179
}
180180

181-
- (NSString *)FIC_sourceImageUUID {
182-
return [self FIC_UUID];
181+
- (NSString *)fic_sourceImageUUID {
182+
return [self fic_UUID];
183183
}
184184

185-
- (NSURL *)FIC_sourceImageURLWithFormatName:(NSString *)formatName {
185+
- (NSURL *)fic_sourceImageURLWithFormatName:(NSString *)formatName {
186186
return _sourceImageURL;
187187
}
188188

189-
- (FICEntityImageDrawingBlock)FIC_drawingBlockForImage:(UIImage *)image withFormatName:(NSString *)formatName {
189+
- (FICEntityImageDrawingBlock)fic_drawingBlockForImage:(UIImage *)image withFormatName:(NSString *)formatName {
190190
FICEntityImageDrawingBlock drawingBlock = ^(CGContextRef contextRef, CGSize contextSize) {
191191
CGRect contextBounds = CGRectZero;
192192
contextBounds.size = contextSize;

0 commit comments

Comments
 (0)