Build and use of the IOS Framework

Source: Internet
Author: User

Start by creating

1. Create the Cocoa Touch framework under iOS as

2. Select the build Setting search Mach-o type to change to STATICB Library

3. Support Bitcode

Need to search for other C Flags in Tagets build setting, add Command "-fembed-bitcode"

If you do not add cflags, you may get an error when you use it. The error message keywords are as follows: ... does not contain bitcode. You must rebuild it with Bitcode enabled (Xcode setting Enable_bitcode), obtain a updated library from the vendor, ...

4. Add armv7s

Under architectures, add armv7s and select. Set build Active Architecture only to No

5. Pull the files you want to use into the project

6. Set Header

Move the header file you want to expose to public, hide it under private or project, and, of course, the hidden header file can no longer be referenced.

7. Introduce the required. h file (if it is not added to the. h in the same name as the project, it will appear when the file is not found)

8. Build

1. Check simulator, compile program

2, check the test machine, compile the program

3. In the Finder, locate the framework that was just compiled, select the framework indicated in the figure, and then right-click the show in Finder. Find the test file shown in, one is Debug-iphoneos (real machine), one is under the Debug-iphonesimulator (simulator).

9. Open the terminal (synthesize one of the simulator and the real machine)

打开控制台输入 lipo -create iphoneos下frameworkTest的路径 simulator下frameworkTest的路径 -output 新的路径

10. Change the myfirstframework name on the desktop to the same name as the binary file I'm here for DL.

Save the modified framework by copying it, and this is the framework that we are finally making.

Use your own layer of framework

1. Pull the framework we just created into the project you need (not here)

2. Import Header File

3. Initializing the use of

Build and use of the IOS Framework

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.