Created
September 23, 2018 11:04
-
-
Save Yoloabdo/784cc3bb3ae6640f601b1af953d17291 to your computer and use it in GitHub Desktop.
pod install for different swift version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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