iOS sdk开发步骤
1.打开xcode ->选择Framework&Library中的Cocoa Touch Static Library如下图

2.点击Next:取工程名:YDemoSDK(根据自己需求)完成后有这几个文件

3.删除没有必要的.m文件
4.添加UI这里:这里以alertView 为例如图


5.接下来就是在YDemoSDK.h 文件中引入#import "CustomIOSAlertView.h",此时的

6.第一种是在模拟器上,运行的sdk:选中一个模拟器:直接commend + B 编译:libYDemoSDK.a 变为黑色,接下来就可以来在其他工程里玩了。新建一个文件夹起名字为YDemoSDK:选中libYDemoSDK.a 右击show in finder 找到位置,将libYDemoSDK
.a YDemoSDK.h 以及CustomIOSAlertView.h三个放到一个文件夹

7.随便建一个工程,把你的sdk导入进去,引用一下就行了


8.当你把他换成真机运行时,就会出现报错,因为我们建立的只是在模拟器上运行的,如果想要在真机上运行就要:打开刚刚的YDemoSDK工程,编辑一下,就行了

9.但是问题来了,我们在换成模拟器时,在其他工程中跑会同样出错,接下来就是关键了,将两个.a 文件合并成一个使得两者都可以在工程中跑,
10.选中YDemo中libYDemoSDK.a 右击选着show In Finder ,打开终端 输入cd 再将.a文件拉进去去掉libYDemoSDK.a,按回车键

11.输入:lipo -info libYDemoSDK.a 查看信息会出来:Architectures in the fat file: libYDemoSDK.a are: armv7 arm64 这个是真机的编译器,
12.输入:cd ../ 回车,然后在ls 出来两个文件夹:Debug-iphoneos Debug-iphonesimulator,后者是模拟器,我们cd Debug-iphonesimulator 然后lipo -info libYDemoSDK.a查看信息出来:Non-fat file: libYDemoSDK.a is architecture: x86_64

13.合并两个.a文件输出到(-output /Users/Bruceyao/Desktop/libYDemoSDK.a):就是两个.a文件的绝对路径,
lipo -create "/Users/Bruceyao/Library/Developer/Xcode/DerivedData/YDemoSDK-abrksdjabebxkzflxvatgvupsysy/Build/Products/Debug-iphonesimulator/libYDemoSDK.a" "/Users/Bruceyao/Library/Developer/Xcode/DerivedData/YDemoSDK-abrksdjabebxkzflxvatgvupsysy/Build/Products/Debug-iphoneos/libYDemoSDK.a" -output /Users/Bruceyao/Desktop/libYDemoSDK.a
14.查看新的SDK后:arm7 x86_64 arm64,真机和模拟器都可以

14.最新运行之后都可以,真机和模拟器。demo地址:https://github.com/YaoChengZhen/YSDKDemo1.git