skywinder / ActionSheetPicker-3.0

Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.
http://skywinder.github.io/ActionSheetPicker-3.0
BSD 3-Clause "New" or "Revised" License
3.4k stars 740 forks source link

Xcode 11 can not run successfully, ActionSheetPicker-3.0 version (2.4.0) ,use cocoaPods #454

Closed jianjianhao closed 4 years ago

jianjianhao commented 4 years ago
B99156BD-5894-4D5E-8EED-E30899883006 7ABBFD67-D17C-4D38-BBFC-B359E91260AE
ElfSundae commented 4 years ago
DEPLOYMENT_VERSION = '9.0'.freeze
DEPLOYMENT_TARGET_KEY = 'IPHONEOS_DEPLOYMENT_TARGET'.freeze
PODS_MIN_DEPLOYMENT_VERSION = '9.0'.freeze

platform :ios, DEPLOYMENT_VERSION

target 'xxx' do
    ...  
end

# https://github.com/CocoaPods/CocoaPods/issues/7314#issuecomment-489453484
def fix_deployment_targets(installer)
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configuration_list.build_configurations.each do |config|
        if config.build_settings[DEPLOYMENT_TARGET_KEY].to_f < PODS_MIN_DEPLOYMENT_VERSION.to_f
          config.build_settings[DEPLOYMENT_TARGET_KEY] = PODS_MIN_DEPLOYMENT_VERSION
          puts "Successfully set #{DEPLOYMENT_TARGET_KEY} of target #{target.name} for config #{config.display_name} to #{PODS_MIN_DEPLOYMENT_VERSION}"
        end
      end
    end
  end
end

post_install do |installer|
  fix_deployment_targets installer
end

https://github.com/CocoaPods/CocoaPods/issues/7314#issuecomment-489453484

jianjianhao commented 4 years ago

thank you for your help