CocoaPods - Using multiple_pod_projects

Updated
Nov 26, 2020 6:29 PM
Created
Nov 26, 2020 6:25 PM
Tags
CocoapodsiOS
Keywords

CocoaPods now available to generate xcodeproj each spec.

Multiple Xcodeproj Generation Historically, CocoaPods has always generated a single Pods.xcodeproj that contains all the required targets and build settings for your project to compile. Using just one project that incorporates your entire Podfile works just fine for smaller projects; however, as your project grows, so will the size of your Pods.xcodeproj file. The larger the Pods.xcodeproj file, the longer Xcode has to spend parsing its contents, which we have discovered leads to a degraded Xcode experience. Instead of putting all of your targets into one monolithic Xcode project, we鈥檝e noticed some considerable performance improvements for larger CocoaPods projects by integrating each pod as its own separate Xcode project and nested under the top-level Pods.xcodeproj. Additionally, in large codebases this feature can prove particularly useful as developers may opt-in to open only the specific .xcodeproj they need to work on (found under the Pods/ directory) instead of opening the full workspace which can slow down their development process. Whether performance is a problem, or you just prefer setting up your workspace using multiple Xcode projects, CocoaPods now supports this setting using the generate_multiple_pod_projects installation option.

install! 'cocoapods', :generate_multiple_pod_projects => true

From 1.8, it can be grouped each category

install! 'cocoapods', :generate_multiple_pod_projects => true

target 'MyApp' do
  use_frameworks!

  pod 'Moya', :project_name => 'Networking'
  pod 'Alamofire', :project_name => 'Networking'
  pod 'Result', :project_name => 'Networking'

  target 'MyAppTests' do
    inherit! :search_paths
    pod 'OCMock', :project_name => 'Testing'
  end
end

How to convert post_install in current Podfile