iOS Framework uses picture resources

Source: Internet
Author: User

Framework of the production of the project see: http://www.cocoachina.com/ios/20141126/10322.html;

Problems encountered:

Two solutions were found because of the use of picture resources in their own framework.

1. Use the new bundle;

Use the first method:

Create a new bundle type of project, get bundles, or if it's just a picture, you can rename the picture folder directly, Xxx.bundle line. You need to drag the. Framework and. bundle files into your project when you use them.

How to use the framework:

[UIImage imagenamed:@ "mybundlename.bundle/myimagename"];

2. Package directly as a resource file into the framework,

How to use: Drag the. Framework into the project and add the framework to the copy bundle resources.

[UIImage imagenamed:@ "mybundlename.framework/myimagename"];

Advantages and Disadvantages

1. The first requires two resource files to be put into the project, but the bundled bundles will be small because there is no redundant binary (after the code in the framework is compiled) packaged into bundles.

2. The second type has only one resource file, but the bundle will be larger than the first, since a portion of the redundant binary (the code in the framework is compiled) is packaged into the bundle.

iOS Framework uses picture resources

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.