Share cocoapods with custom framework included in project

≡放荡痞女 提交于 2019-12-08 18:11:13

问题


For the following Architecture:

_Code
___CustomFramework
___ProjectA
_____ProjectA
_____Workspace
_____Podfile
_____Pods

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.

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.

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'

link_with 'ProjectA', 'CustomFramework'

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

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


回答1:


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


来源:https://stackoverflow.com/questions/26167222/share-cocoapods-with-custom-framework-included-in-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!