Update to load Bundles by their class name if not found in typical bundle path.

This commit is contained in:
Tj 2015-08-27 13:30:57 -04:00
parent 115de57bc5
commit bfed7e0a32
1 changed files with 6 additions and 1 deletions

View File

@ -127,6 +127,11 @@ RCT_EXPORT_METHOD(pathForBundle:(NSString *)bundleNamed
{
NSString *path = [[NSBundle mainBundle].bundlePath stringByAppendingFormat:@"/%@.bundle", bundleNamed];
NSBundle *bundle = [NSBundle bundleWithPath:path];
if (!bundle) {
bundle = [NSBundle bundleForClass:NSClassFromString(bundleNamed)];
}
if (!bundle.isLoaded) {
[bundle load];
}
@ -134,7 +139,7 @@ RCT_EXPORT_METHOD(pathForBundle:(NSString *)bundleNamed
callback(@[[NSNull null], path]);
}
- (NSNumber *) dateToTimeIntervalNumber:(NSDate *)date
- (NSNumber *)dateToTimeIntervalNumber:(NSDate *)date
{
return @([date timeIntervalSince1970]);
}