![](/img/trans.png)
[英]CocoaPods How to add a custom Subclass of a Framework in a Podfile to a CocoaPods framework
[英]How to add third party libraries to custom framework with CocoaPods?
我想使用 CocoaPods 将第三方库(如 Swinject 或 AlamoFire)添加到我的自定义框架(使用 swift 创建)中。
我使用的方式是打开终端并导航到我的框架目录并运行pod init
。 之后将第三方库添加到 Podfile 然后运行pod install
。
这种方式对于稍后在我的应用程序项目中使用我的框架是否正确? 有没有更好的方法来做到这一点?
将第三方库安装到项目中:
第 1 步:打开终端并导航到项目目录。
第 2 步:在终端中输入pod init
并按 Enter。
第三步:将第三方库添加到 Podfile 中。
第 4 步:在终端中输入pod install
并回车。
因此,您需要在自定义 Pod Podspec中添加依赖项 -
s.dependency 'Alamofire', "~> 5.4"
s.dependency 'PromiseKit', "~> 5.4"
供进一步参考 - Cocopod 链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.