iOS bundle

This commit is contained in:
pengfei.zhou
2019-08-14 14:13:08 +08:00
parent b2057a088c
commit a8e93648b0
9 changed files with 18 additions and 10 deletions

View File

@@ -10,3 +10,5 @@
void DoricLog(NSString * _Nonnull format, ...);
UIColor* _Nonnull DoricColor(NSNumber * _Nonnull number);
NSBundle *DoricBundle();

View File

@@ -6,6 +6,7 @@
//
#import "DoricUtil.h"
#import "DoricContext.h"
void DoricLog(NSString * _Nonnull format, ...) {
va_list args;
@@ -23,3 +24,9 @@ void DoricLog(NSString * _Nonnull format, ...) {
b = ((colorValue >> 0) & 0xff)/255.0f;
return [UIColor colorWithRed:r green:g blue:b alpha:a];
}
NSBundle *DoricBundle() {
NSBundle *bundle = [NSBundle bundleForClass:[DoricContext class]];
NSURL *url = [bundle URLForResource:@"Doric" withExtension:@"bundle"];
return [NSBundle bundleWithURL:url];
}