Rightpoint / BonMot

Beautiful, easy attributed strings in Swift
MIT License
3.54k stars 197 forks source link

Trying to build my project gives me 56 compiler errors #317

Closed SenorWesley closed 6 years ago

SenorWesley commented 6 years ago

I updated my pods about 20 minutes ago, and after that, whenever I try to compile and build my project, I get a total of 56 compiler errors back from Xcode.

schermafbeelding 2018-01-25 om 10 01 23

It this a problem anyone else experienced? Build settings:

schermafbeelding 2018-01-25 om 10 03 37
ZevEisenberg commented 6 years ago

@SenorWesley thanks for writing in. It looks like your project is building in Swift 3.2, but the latest BonMot only supports Swift 4. I should be able to add a swift_version flag to the podspec that will work as long as you're using CocoaPods 1.4. But until then, here's a fix that you can put at the bottom of you Podfile:

# This is a hack to support both 3.2 and 4.0 pods. Add the pod name to the array below to build in 4.0.
#
# https://github.com/CocoaPods/CocoaPods/issues/7134 is the official thread tracking the issue.
SWIFT_4_PODS=['BonMot']

post_install do |installer|
  require 'fileutils'
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = SWIFT_4_PODS.include?(target.name) ? '4.0' : '3.2'
    end
  end
end
Dimillian commented 6 years ago

See: https://github.com/Raizlabs/BonMot/pull/310