IOS production framework Static library graphics and text tutorial _ios

Source: Internet
Author: User

This example for you to share the iOS production framework Static Library tutorial for your reference, the specific content as follows

Environment:

Hardware: MacBook Air

System: OS X EI Capitan version: 10.11.3

Xcode:version 7.2.1 (7c1002)

A static library of iOS (which is said to be not uploaded to the App Store). A and the framework have been done, here is the framework of the production process:

1. First under the Xcode New Cocoa Touch Framework Project:

2. After the new project, add the code to be encapsulated inside, and include the header containing the public API into the automatically generated header file.

or under the build phases headers the public header file

3. Find the Mach-o Type value in Build setting-->linking: Dynamic Library to: Static Library, the lack of this step generated by the framework is the DLL

4. Find edit scheme under Run-->info to change the value of build configure from the default value debug to release

5. Select the hardware environment to compile: generic IOS device and IPhone 6s Plus (select the latest simulator) compile once, After compiling, you can see the xxx.framework from red to black in the project's products file (note: If only the iphone 6s Plus Simulator is compiled and Generic IOS Device is not compiled, So the xxx.framework still doesn't turn black.

When the 6.xxx.framework becomes black, select the Xxx.framework right button to show the in finder to see the generated framework static library. There are Release-iphoneos and Release-iphonesimulator simulators respectively, which means that the generated versions can only be used in their respective hardware environments respectively.

7. Merging the real machine and emulator version of the framework static library, this can be done in the simulator and the real machine, but note that the generated static library size is equal to the size of the true and the emulator version, so to shrink the program, you can use only one version

Lipo with Xcode can be merged into two versions: Use commands under the terminal: lipo-create/user/...../release-iphoneos/xxx.framework/xxx/user/...../ Release-iphonesimular/xxx.framework/xxx-output./xxx

where xxx is the name of your library, path for the generated static library path, and then put the generated XXX into the real machine or simulator version of the xxx.framework inside replace the original XXX library

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Related Article

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.