2016-10-03 00:39:06 +00:00
|
|
|
//
|
|
|
|
// NSBundle+DataResource.m
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 02/10/2016.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2016 Thomas Harte. All rights reserved.
|
2016-10-03 00:39:06 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import "NSBundle+DataResource.h"
|
|
|
|
|
|
|
|
@implementation NSBundle (DataResource)
|
|
|
|
|
2018-01-01 21:04:13 +00:00
|
|
|
- (NSData *)dataForResource:(NSString *)resource withExtension:(NSString *)extension subdirectory:(NSString *)subdirectory {
|
2016-10-03 00:39:06 +00:00
|
|
|
NSURL *url = [self URLForResource:resource withExtension:extension subdirectory:subdirectory];
|
|
|
|
if(!url) return nil;
|
|
|
|
return [NSData dataWithContentsOfURL:url];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|