sdk注意事項:
1.設置bitcode為no。
2.設置Mach-0 Type 為 Static Library
3.sdk有引入第三方的sdk,注意第三方sdk的路徑,尤其是.a靜態(tài)文件。
4.加入對應的系統(tǒng)framework。
5.sdk設置target。不能低于接入的第三方項目。
6.plist設置相機,語音的權限。
7.處理第三方庫(AFN,MBHud等)的方案:
1>修改成不相同的類名,類方法。
2>第三方接入的時候,提供第三方庫,sdk只保留第三方庫.h文件。
8.注意.pch文件的路徑
9.如果sdk中有xib。直接用initwithxib的方法是找不到對應的xib。一般會把xib丟入到bundle中。調用方法在bundle注意事項中。
第三方接入注意事項:
1.sdk如果有category實現(xiàn),需要設置other linker Flags 為-ObjC或者-all_load。重點重點重點!!!
制作bundle注意事項
1.設置supported platforms為ios。默認是macOS。如果沒有設置,加入sdk編譯的時候,會提示no loaded bundle。
2.設置skip install為yes
3.設置combine_hidpi_images為no。生成圖片的tiff格式會轉化為png。xib轉換成nib。
4.xib調用的方法
NSString* bundlePath = [[NSBundlemainBundle]pathForResource:@"SDKRes"ofType:@"bundle"];
NSBundle*resourceBundle = [NSBundlebundleWithPath:bundlePath];
ViewController*vc = [[ViewControlleralloc]initWithNibName:@"ViewController"bundle:resourceBundle];
5.img調用的方法(很多種)
[UIImage imageNamed:[NSString stringWithFormat:@"%@/%@",@"SDKRes.bundle", imgName]];