github:https://github.com/kstenerud/iOS-Universal-Framework/blob/master/README.md
Start a new project. 新建xcode工程
Framework & Library中选择Static iOS Framework (or Fake Static iOS Framework)
最好选中单元测试
Add the auto-generated header file to the Public section 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.
其他项目需要使用的头文件必须定义为public. 在Build Phases 中展开 Copy Headers, 将需要的头文件拖拽到Public下面.
Any static libraries or static frameworks that you‘d like to have linked into your framework must be included in the Link 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.
Select your framework‘s scheme, iOS Device target.
选择 Product -> Archive.
完成后,会打开finder,里面有两种文件*.framework和*.embeddedframework(可能没有).
如果framework只有代码没有资源(如images, scripts, xibs, core data momd files等),可以直接使用*.framework。如果包含有其他的资源,需要使用*.embeddedframework.
iOS frameworks are basically the same as regular dynamic Mac OS X frameworks, except they are statically linked.
使用方法跟自带的framework一样,只不过他们是静态链接的
将*.framework或者*.embeddedframework文件拖拽到工程中即可。在工程中引用头文件使用<>,不要使用"".
For example, with framework "MyFramework":
#import <MyFramework/MyClass.h>
自定义ios framework-iOS Universal Framework,码迷,mamicode.com
自定义ios framework-iOS Universal Framework
原文地址:http://www.cnblogs.com/fengyunyu/p/3700120.html