Github:https://github.com/kstenerud/ios-universal-framework/blob/master/readme.md
Installation:
- Download the zip file first.
- Make sure you're in one place and easy to use later on. B/C project template, every time you update Xcode, you will need to reinstall the project template (Don't worry, the installation process is very fast).
- Make sure Xcode is completely off
- Unzip the zip file and go to the folder: Real framework/install.sh
- If you are familiar with the command terminal, just run install.sh. If you are unfamiliar, simply rename it to Install.sh.command and double-click to run it.
- When it starts running, it will ask you: where Xcode is installed. If you have not modified the default Xcode installation path, just enter confirm.
- Then it will ask you where it needs to be installed. Just hit Y and enter.
- Input password, enter
- Wait for installation to finish
Create an IOS Framework Project
Start a new project. New Xcode Project
selection in the Framework & library Static iOS framework (or Fake static iOS framework)
It's best to check unit tests
Add the auto-generated header file to the public sections of the Copy Headers Build phase (workaround for Xcode bug).
Turn off Show environment variables in build log for both Run Script Build Phases (workaround for Xcode Bug).
Add your classes, resources, etc with your framework as the target.
header files that need to be used by other projects must be defined as public. In Build phases , expand Copy Headersand drag the desired header file to public.
Any static libraries or static frameworks this you ' d like to has linked into your framework must is included in the L Ink Binary with Libraries build phase. Be careful doing this, however, as it can cause linker issues if the users of your framework also try to include the same Library in their project for other purposes.
Build the IOS Framework
Select your framework ' s scheme, IOS Device target.
Select Product -- Archive.
When done, the Finder opens with two files *.framework and *.embeddedframework (probably not).
If the framework has no resources (such as images, scripts, xibs, core data momd files, etc.), you can use *.framework directly. If other resources are included, you need to use *.embeddedframework.
using the iOS Framework
IOS frameworks is basically the same as regular dynamic Mac OS X frameworks, except they is statically linked.
Use the same framework as your own, except that they are statically linked
Drag the *.framework or *.embeddedframework file to the project. Refer to the header file in the project using <>, do not use "".
For example, with framework "myframework":
#import <MyFramework/MyClass.h>