Reprinted from: http://blog.csdn.net/nine_yao/article/details/72845087
Environment: Xcode 8
1. Create the framework
2. Modify the relevant configuration 1) set the iOS system version number of the SDK adaptation
2) optional add: armv7s
Reason:
ARMv6, ARMv7, armv7s is a different set of instructions for ARM CPUs,
ARMV6 devices: iphone, IPhone2, iphone 3G, first-generation, second-generation ipod Touch;
ARMV7 device: IPhone 3gs,iphone 4,iphone 4s,ipad, IPad 2,ipod touch 3g,ipod touch 4;
armv7s equipment: IPhone 5,ipad4;
Arm64 equipment: IPhone 5s,ipad air,iphone6,iphone6plus,iphone6s,iphone6s Plus,iphone7,iphone7 Plus, etc.;
Xcode6 Update, the default does not support armv7s, if you provide the framework by default does not support the armv7s schema, but the user to support the armv7s schema, there will be a conflict, so you need to selectively support armv7s
3) "Build Active Architecture only" is set to "NO"
When set to No, all supported versions are compiled
When set to Yes, it is faster for debug, it compiles only the current version of architecture
4) "Mach-o Type" is set to "Static Library"
The framework can be either a dynamic library or a static library, a dynamic library for the framework of a system, and a user-created framework that can only be a static library.
In Xcode7 and above, Dead Code stripping, Link with standard libraries no longer need to be set to NO5) according to the SDK function needs, to decide whether to retain the original header file, Personal habits Delete and recreate a file that inherits from NSObject
Drag files you create that you want to open into public
6) respectively in the simulator and the real machine environment to compile the SDK, in the Products folder to select the package, show in Finder, fallback a directory, you can see two folders (Debug or Release mode optional)
7) using the terminal Merge SDK
Command line statement: sudo lipo-create true machine sdktest file path (circled file in step 6) Simulator Sdktest-output custom composition file storage path (the name of the composite file sdktest)
Note: framework-related issues 1. A third-party framework issue was used in 2.SDK for XXXXX is not an object file (not allowed in a library)
iOS development: Creating the Framework