与项目中包含的自定义框架共享cocoapods [英] Share cocoapods with custom framework included in project

查看:46
本文介绍了与项目中包含的自定义框架共享cocoapods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于以下体系结构:

_Code

___CustomFramework

___ProjectA

_____ ProjectA

_____Workspace

_____Podfile

_____Pods

_Code
___CustomFramework
___ProjectA
_____ProjectA
_____Workspace
_____Podfile
_____Pods

我正在使用ProjectA的工作空间(由podfile生成),并且我已经成功地将CustomFramework包含在ProjectA中,可以在ProjectA中使用CustomFramework中的方法。

I am using workspace of ProjectA (generated by podfile), and I have included CustomFramework inside ProjectA successfully, I can use methods from CustomFramework inside ProjectA.

现在,我想与CustomFramework共享ProjectA的吊舱。因此,我可以使用CustomFramework中ProjectA吊舱中的方法。在那里,我陷入了困境,需要帮助。

Now, I would like to share ProjectA's pods with CustomFramework. So I can use methods from ProjectA's pods inside CustomFramework. That's where i'm stuck and need help.

到目前为止我已经尝试过:

但是我不确定这是否是正确的方法,或链接CustomFramework的好语法

What I have tried so far:
But I am not sure if it is the right way, or the good syntax to link CustomFramework


PODFILE

platform:ios,'8.0'

PODFILE
platform :ios, '8.0'

具有'ProjectA','CustomFramework'的链接

link_with 'ProjectA', 'CustomFramework'

pod'nameofpod','3.1.0'

pod 'nameofpod', '3.1.0'

我还设置了允许在框架模块中包含非模块化包含项 ,并将其设置为,对于项目文件(蓝色)和自定义框架

I also have set 'Allow non-modular includes in Framework Modules' and set it to YES, for both the Project file (blue) and the Custom Framework

但是CustomFramework仍然无法识别我的吊舱:-/

But CustomFramework still doesn't recognize my pods :-/

推荐答案

尝试以这种方式编写podfile:

Try to write the podfile in that way:

workspace 'AllInOne.xcworkspace'
xcodeproj 'ProjectA/ProjectA.xcodeproj'
xcodeproj 'CustomFramework/CustomFramework.xcodeproj'

target 'ProjectA' do
  platform :ios, '8.0'
  xcodeproj 'ProjectA/ProjectA.xcodeproj'
  pod 'nameofpod', '~> 3.1'
end

target 'CustomFramework' do
  platform :ios, '8.0'
  xcodeproj 'CustomFramework/CustomFramework.xcodeproj'
  pod 'nameofpod', '~> 3.1'
end

这篇关于与项目中包含的自定义框架共享cocoapods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆