-
Notifications
You must be signed in to change notification settings - Fork 6
/
MVImageService.m
50 lines (39 loc) · 922 Bytes
/
MVImageService.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#import "MVImageService.h"
@interface MVImageService ()
@property (readwrite) BOOL informationFetched;
@property (strong, readwrite) NSURL *url;
@end
@implementation MVImageService
@synthesize informationFetched = informationFetched_,
url = url_;
- (id)initWithURL:(NSURL*)url
{
self = [super init];
if(self)
{
url_ = url;
informationFetched_ = NO;
}
return self;
}
- (BOOL)error
{
return NO;
}
#pragma mark -
#pragma mark MVService Methods
- (void)fetchInformation
{
self.informationFetched = YES;
}
+ (MVImageService*)serviceForURL:(NSURL*)url;
{
NSSet *extensions = [NSSet setWithObjects:@"jpg", @"jpeg", @"png", @"bmp", @"gif", nil];
if([extensions containsObject:url.absoluteString.pathExtension.lowercaseString])
{
MVImageService *service = [[MVImageService alloc] initWithURL:url];
return service;
}
return nil;
}
@end