GithubHelp home page GithubHelp logo

jfswift / holoresource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from holofoundation/holoresource

0.0 0.0 0.0 91 KB

组件化资源文件管理方案

Home Page: http://gonghonglou.com/2020/05/14/pod-resource/

License: MIT License

Objective-C 79.62% Ruby 15.59% Shell 4.79%

holoresource's Introduction

HoloResource

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

1、shell 脚本

需要在 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

2、cocoapods-resource 插件(推荐)

或者你可以用我写的一个 CocoaPods 插件:cocoapods-resource

# 安装
gem install cocoapods-resource

# 调用
pod resource HOLO_POD_NAME
or
pod resource HOLO_POD_NAME --pods='PodA, PodB, PodC'

Usage

UIImage

UIImage *image = HoloImageNamed(@"icon");
// or
UIImage *image = [UIImage holo_imageNamed:@"icon" inBundle:HOLO_POD_NAME];

NSBundle

NSBundle *bundle = HoloCurrentBundle;
// or
NSBundle *bundle = [NSBundle holo_bundleNamed:HOLO_POD_NAME];

UIFont

// 注册字体
HoloRegisterFont(@"GOTHIC", @"TTF");
// or
[UIFont holo_registerFont:@"GOTHIC" withExtension:@"TTF" bundleName:HOLO_POD_NAME];

Localized

NSString *string = HoloLocalizedStringFromTable(@"key", @"table", nil);
// or
NSString *string = HoloLocalizedStringWithDefaultValue(@"key", @"table", @"value", nil);

Installation

HoloResource is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'HoloResource'

Author

gonghonglou, [email protected]

License

HoloResource is available under the MIT license. See the LICENSE file for more info.

holoresource's People

Contributors

gonghonglou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.