0

I have project with 10+ targets in Xcode. I am using cocoapods to provide me some frameworks. But Pod projects starting to grow (many files) It is possible somehow configure Pod file to create one universal configuration, which is imported to other projects? Something like abstract target? I don't need for each target create new pod framework, because all my targets using same pods.

Thanks for suggestion.

Something like this:

platform :ios, '11.0'

custom config 'Pods-framewrks' do
 use_frameworks!
 pod 'Alamofire'
end

project = Xcodeproj::Project.open “./MyProject.xcodeproj"

project.targets.each do |t|
 target t.name do
   import framework Pods  // ???
 end
end

1 Answer 1

1

If you put pod 'Alamofire' outside of any specific target, then it will be included in all targets.

For example:

platform :ios, '11.0'

pod 'Alamofire'

target 'FirstTarget' do
end

target 'SecondTarget' do
  pod 'SwifterSwift'
end

Sign up to request clarification or add additional context in comments.

5 Comments

But this will create Pod_FirstTarget.framework and Pod_SecondTarget framweworks. I want to avoid that and have only Pod.framework linked to both of them.
Ah, I see. Why do you want to avoid these frameworks?
I have many apps (I want reduce number of files and size o project) And I found that pods have problems with some targets names, which are using some local diacritic.
I tried to replace Pods with Carthage recently, but some frameworks, which I am using, not supporting it. :-(
Maybe github.com/leavez/cocoapods-binary (never tried it myself)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.