美文网首页
建立本地pod的方法

建立本地pod的方法

作者: 咚咚嗒大人 | 来源:发表于2019-12-18 15:00 被阅读0次

1、

cd到你自己的工程路径

cd /Users/xxx/Desktop/SwiftTest

因为我这个是demo,所以需要初始化一下pod。如果你的工程已经是pod管理的就不需要了

pod init

2、创建podspec文件

cd /Users/xxx/Desktop/SwiftTest/LocalLib
pod spec create LocalLib

3、填写 LocalLib.podspec

4、把.podspec中关联的文件拖入本地库LocalLib文件夹下

5、填写Podfile
pod 'LocalLib', :path => 'LocalLib/LocalLib.podspec'

6、cd到你工程目录下
pod install --verbose --no-repo-update

注:填写podspec时resource和resource_bundle参数:
参考:https://blog.csdn.net/TuGeLe/article/details/85049392

resource管理xcassets的方式:
s.resource = ['resource.xcassets']
s.resource_bundle = { 'ResourceBundleA' => ['resource_bundle.xcassets'] }

resource管理png的方式:
s.resource = 'Resources/HockeySDK.bundle'
s.resources = ['Images/.png', 'Sounds/']

s.resource_bundle = { 'ResourceBundleA' => ['resource_bundle/*.png'] }

//指定一个目录下的所有png图片为一个资源包
spec.ios.resource_bundle = { 'MapBox' => 'MapView/Map/Resources/*.png' }

//指定多个资源包
spec.resource_bundles = {
'MapBox' => ['MapView/Map/Resources/.png'],
'OtherResources' => ['MapView/Map/OtherResources/
.png']
}

相关文章

网友评论

      本文标题:建立本地pod的方法

      本文链接:https://www.haomeiwen.com/subject/wnqunctx.html