redak105
redak105

Reputation: 569

Creating universal Cocoapods framework

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

Upvotes: 0

Views: 193

Answers (1)

Yonat
Yonat

Reputation: 4608

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

Upvotes: 1

Related Questions