首先說創(chuàng)建靜態(tài)庫步驟
1、 file - new - project 選擇 framework
2、framework 配置 不能缺少步驟 此處采用cocoapod引入三方庫,但不參與編譯
Build active Architecture only 設(shè)置為 no
Mach-o Type 選擇 static library
調(diào)整最低支持的iOS系統(tǒng)
如果SDK有用的SDK,other linker flags 添加 -ObjC
Enable bitcode 設(shè)置為 no
Edit scheme - run - info - build configuration選擇release
所需要.h文件需要添加到public中,.m文件需要加入compile source中 資源加入bundle resource中
3、正常引入pod管理三方庫,編譯后到靜態(tài)庫不包含三方庫源碼,防止用戶引入時沖突
4、腳本編譯或手動編譯即可
現(xiàn)在說使用時注意事項
1、把SDK添加到工程中
2、enable bitcode 設(shè)置為no
3、pods 引入所依賴的三方庫
4、other linker 添加 &(inherited)、-all_load、-ObjC