user3497292
user3497292

Reputation: 69

How to install new pods witout affecting other pods?

I'm facing a problem with my pods. I edited some pods, and when I request a new pods using "pod install", the edited pods will be cleaned and installed again. Is there a way to install new pods or update specific one without affecting others?

Upvotes: 2

Views: 219

Answers (2)

arturdev
arturdev

Reputation: 11039

Actually, there is a workaround: just specify exact versions of pods in your Podfile.
For example:

Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

target 'TestApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for TestApp
  pod 'RxSwift',    '4.1.2'
  pod 'RxCocoa',    '4.1.2'
  pod 'Alamofire',  '4.6'
  pod 'SwiftyJSON', '4.0'
  pod 'ObjectMapper', '3.1'
  pod 'SVProgressHUD', '2.2',  :inhibit_warnings => true
  pod 'IQKeyboardManagerSwift', '5.0.7'
  pod 'Validator', '3.0', :inhibit_warnings => true    
end

As you can see in my Podfile all pods have exact specified versions (i.e. without ~>).
So if you add your pod in this kind of Podfile, then only it will be installed, cause the other ones are already installed.

Upvotes: 1

danialzahid94
danialzahid94

Reputation: 4223

No. When you install new pods, all the pods will be reset accordingly. If you need to make changes to an API you want, you should rather add it in your project manually instead of using it as a pod.

This way, you can add any amount of pods without affecting that particular API, and your changes will be saved properly as well.

Upvotes: 2

Related Questions