To run the example project, clone the repo, and run pod install
from the Example directory first.
需要在 pod install 之后调用脚本配置预编译宏:HOLO_POD_NAME
,例如在 Pofile 里:
post_install do |installer|
system "sh Pods/HoloResource/HoloResource/Assets/holo_pod_name_config.sh"
end
该脚本默认给所有 Pod 添加配置,如果想指定 Pod 添加配置的话给脚本传入参数,例如在 Pofile 里:
post_install do |installer|
system "sh Pods/HoloResource/HoloResource/Assets/holo_pod_name_config.sh PodA PodB PodC"
end
或者你可以用我写的一个 CocoaPods 插件:cocoapods-resource
# 安装
gem install cocoapods-resource
# 调用
pod resource HOLO_POD_NAME
or
pod resource HOLO_POD_NAME --pods='PodA, PodB, PodC'
UIImage *image = HoloImageNamed(@"icon");
// or
UIImage *image = [UIImage holo_imageNamed:@"icon" inBundle:HOLO_POD_NAME];
NSBundle *bundle = HoloCurrentBundle;
// or
NSBundle *bundle = [NSBundle holo_bundleNamed:HOLO_POD_NAME];
// 注册字体
HoloRegisterFont(@"GOTHIC", @"TTF");
// or
[UIFont holo_registerFont:@"GOTHIC" withExtension:@"TTF" bundleName:HOLO_POD_NAME];
NSString *string = HoloLocalizedStringFromTable(@"key", @"table", nil);
// or
NSString *string = HoloLocalizedStringWithDefaultValue(@"key", @"table", @"value", nil);
HoloResource is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'HoloResource'
gonghonglou, [email protected]
HoloResource is available under the MIT license. See the LICENSE file for more info.