The integration of a high number of cocoapods in your iOS application leads to a relatively slow application. I was searching over the internet when suddenly I found this plugin. It is a Cocoapods plugin to merge dependencies (or pods) used by your Xcode project, to reduce the number of dynamic frameworks your app has to load on app startup.
Pod-merge introduces a new file to your project; the MergeFile, and hooks into the pre-install phase of pod install to merge your dependencies.
It is highly recommended to use bundler for using this plugin. So, open your terminal and type the following
$ sudo gem install bundler
Now, open your Xcode project in the terminal and type the following
$ bundler init
This command will create a file named Gemfile, open this file and add the following
gem 'cocoapods', ‘1.8.4’ # change cocoapods version to the version you are using gem 'cocoapods-pod-merge', :path => '../'
Now, run the following command
$ bundler install
Let’s move to the next step, create a file called MergeFile which will hold the pods grouped like the following
group ‘Networking’ # Networking is the name you choose for a group of pods pod 'AFNetworking' pod 'SDWebImage' end
Add the following line to the top of your Podfile
How to use
Now, also add the libraries group to your Podfile like the following. Notice that the “MargedPods” directory is automatically generated.
pod 'Networking', :path => 'MergedPods/Networking'
That’s it, let the magic begin by running
$ bundle exec pod install
Don’t miss the chance to test it, for more information navigate to plugin GitHub through this link.