Created
September 25, 2014 17:23
-
-
Save frankus/c0fa1b732b073810e9c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSValueTransformer *)URLArrayTransformer { | |
return [MTLValueTransformer reversibleTransformerWithForwardBlock:^NSArray *(NSArray *URLStrings) { | |
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[URLStrings count]]; | |
for (NSString *URLString in URLStrings) { | |
[result addObject:[NSURL URLWithString:URLString]]; | |
} | |
return result; | |
} reverseBlock:^NSArray *(NSArray *URLs) { | |
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[URLs count]]; | |
for (NSURL *URL in URLs) { | |
[result addObject:URL.absoluteString]; | |
} | |
return result; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment