Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share cocoapods with custom framework included in project

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 :-/

like image 461
Marc Avatar asked Oct 02 '14 18:10

Marc


1 Answers

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
like image 173
euthimis87 Avatar answered Sep 28 '22 07:09

euthimis87