Skip to content

Instantly share code, notes, and snippets.

@Yoloabdo
Created September 23, 2018 11:04
Show Gist options
  • Select an option

  • Save Yoloabdo/784cc3bb3ae6640f601b1af953d17291 to your computer and use it in GitHub Desktop.

Select an option

Save Yoloabdo/784cc3bb3ae6640f601b1af953d17291 to your computer and use it in GitHub Desktop.
pod install for different swift version
post_install do |installer|
#setting all pods to 4.1
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
#some libs uses the old version 4 only.
installer.pods_project.targets.each do |target|
if ['Alamofire', 'AlamofireImage', 'DropDown', 'IQKeyboardManagerSwift', 'KeychainSwift', 'SideMenu'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4'
end
end
end
#some pods have already made the transition, they'd work on 4.2
installer.pods_project.targets.each do |target|
if ['SwiftMessages', 'AlamofireNetworkActivityIndicator'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment