自定义ios framework-iOS Universal Framework

github:https://github.com/kstenerud/iOS-Universal-Framework/blob/master/README.md

安装:


  1. 首先下载zip文件.

  2. 保证你放在一个地方,并方便日后使用。B/C工程模板,每次你更新XCode的时候,你都需要重新安装这个项目模板(不要担心,安装过程非常的快)。

  3. 确保XCode已完全关闭

  4. 解压缩zip文件并转到文件夹:Real Framework/install.sh

  5. 如果你熟悉使用命令终端,只需运行install.sh。如果你不熟悉,那么只需把它改名为 install.sh.command
    并双击运行它。

  6. 当它开始运行,它会询问你:XCode安装在哪里。如果你没有修改过默认XCODE的安装路径,只需回车确认。

  7. 然后它会再询问你,需要安装在什么地方。只需敲入y并回车。

  8. 输入密码,回车

  9. 等待安装结束

创建 iOS Framework Project


  1. Start a new project. 新建xcode工程

  2. Framework & Library中选择Static iOS
    Framework
     (or Fake Static iOS
    Framework
    )

  3. 最好选中单元测试

  4. Add the auto-generated header file to
    the Public section of the Copy
    Headers
     build phase (workaround for Xcode bug).

  5. Turn off Show environment variables in build
    log
     for both Run Script build phases
    (workaround for Xcode bug).

  6. Add your classes, resources, etc with your framework as the target.

  7. 其他项目需要使用的头文件必须定义为public. 在Build Phases 
    中展开 Copy Headers,
    将需要的头文件拖拽到Public下面.

  8. 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.

生成 iOS Framework


  1. Select your framework‘s scheme, iOS Device target.

  2. 选择 Product -> Archive.

  3. 完成后,会打开finder,里面有两种文件*.framework和*.embeddedframework(可能没有).

 如果framework只有代码没有资源(如images, scripts, xibs,
core data momd
files等),可以直接使用*.framework。如果包含有其他的资源,需要使用*.embeddedframework.

使用iOS Framework

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

时间: 2024-08-24 13:45:34

自定义ios framework-iOS Universal Framework的相关文章

Universal Framework for iOS

Hello my friends, Due to some bugs and questions with the old tutorial, I'm creating this new one, much more simpler and less bugs than the another one. I'll not post the old link here because everything you need to know you can find right here. Nowa

【iOS开发-115】静态库的制作以及第三方框架iOS Universal Framework,DEBUG和RELEASE

(1)概念介绍 --我们平时在项目中用的最多的就是开源的第三方库,这种库是开源的,我们不仅能用,还能查看源代码甚至可以修改源代码. --与开源库对应的就是闭源,闭源库分为动态库和静态库.动态库就是.dylib或者.framework结尾的文件.就是苹果官方提供给我们用的那些库.开发者不能在项目中使用自制的动态库,否则无法上传到APPStore. --所以,对于闭源库,我们主要讨论的是静态库.静态库的样子就是用户拿到的文件有很多头文件.h+资源包+编译过的一个二进制文件.a(.framework)

iOS封装功能生成 .framework

前言 如果你想将你开发的控件与别人分享,一种方法是直接提供源代码文件.然而,这种方法并不是很优雅.它会暴露所有的实现细节,而这些实现你可能并不想开源出来.此外,开发者也可能并不想看到你的所有代码,因为他们可能仅仅希望将你的这份漂亮代码的一部分植入自己的应用中. 另一种方法是将你的代码编译成静态库(library),让其他开发者添加到自己的项目中.然而,这需要你一并公布所有的公开的头文件,实在是非常不方便. 你需要一种简单的方法来编译你的代码,这种方法应该使得你的代码易分享,并且在多个工程中易复用

WWDC2014之iOS使用动态库 framework【转】

from:http://www.cocoachina.com/industry/20140613/8810.html JUN 12TH, 2014 苹果的开放态度 WWDC2014上发布的Xcode6 beta版有了不少更新,其中令我惊讶的一个是苹果在iOS上开放了动态库,在Xcode6 Beta版的更新文档中是这样描述的: Frameworks for iOS. iOS developers can now create dynamic frameworks. Frameworks are a

iOS库--.a与.framework

一.什么是库? 库是共享程序代码的方式,一般分为静态库和动态库. 二.静态库与动态库的区别? 静态库:链接时完整地拷贝至可执行文件中,被多次使用就有多份冗余拷贝. 动态库:链接时不复制,程序运行时由系统动态加载到内存,供程序调用,系统只加载一次,多个程序共用,节省内存. 三.iOS里静态库形式? .a和.framework 四.iOS里动态库形式? .dylib和.framework 五.framework为什么既是静态库又是动态库? 系统的.framework是动态库,我们自己建立的.fram

iOS+Swift: 使用MessageUI.framework发送短信

在iOS中, 可以使用MessageUI.framework框架发送短信, 步骤如下: 代码下载http://git.oschina.net/yao_yu/swift_cnblogs_samples/tree/master/Y0001_SendSMS 添加MessageUI.framework框架 为ViewController类 添加UINavigationControllerDelegate, MFMessageComposeViewControllerDelegate 接口 实现func

iOS:iOS开发非常全的三方库、插件、大牛博客等等

iOS开发非常全的三方库.插件.大牛博客等等 github排名:https://github.com/trending, github搜索:https://github.com/search. 此文章转自github:https://github.com/Tim9Liu9/TimLiu-iOS UI 下拉刷新 EGOTableViewPullRefresh- 最早的下拉刷新控件. SVPullToRefresh- 下拉刷新控件. MJRefresh- 仅需一行代码就可以为UITableView或

iOS开发--iOS及Mac开源项目和学习资料

文/零距离仰望星空(简书作者)原文链接:http://www.jianshu.com/p/f6cdbc8192ba著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”. 原文出处:codecloud UI下拉刷新EGOTableViewPullRefresh – 最早的下拉刷新控件. SVPullToRefresh – 下拉刷新控件. MJRefresh – 仅需一行代码就可以为UITableView或者CollectionView加上下拉刷新或者上拉刷新功能.可以自定义上下拉刷新的文字

【整理】Xcode中的iOS模拟器(iOS Simulator)的介绍和使用心得

[整理]Xcode中的iOS模拟器(iOS Simulator)的介绍和使用心得 iOS模拟器简介 iOS功能简介 iOS模拟器,是在Mac下面开发程序时,开发iOS平台的程序时候,可以使用的辅助工具. 其功能是,帮你模拟iOS平台设备,在模拟器上运行对应的程序,以方便你没有实体设备的时候去调试程序. iOS所支持(模拟)的设备 我此处的iOS 5.1的模拟器,支持的设备有4个: 即: iPad iPad(Retina) iPhone iPhone (Retina) 如何打开iOS模拟器 Xco