matomo-org / matomo-sdk-ios

Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift
MIT License
388 stars 164 forks source link

Specify Swift 4.2 in podspecs #297

Closed notjosh closed 5 years ago

notjosh commented 5 years ago

Hiya 👋!

I bumped my project to Swift 5, and started getting some classic "this isn't Swift 5" errors:

Add () to forward @autoclosure parameter

Looking into the podspec, PiwikTracker.podspec specifies Swift 4.1 (via #267, #260), but MatomoTracker.podspec doesn't mention anything at all. Meanwhile .swift-version specifies Swift 4.2.

This PR brings them all into line as Swift 4.2 consistently.

And just in case anyone else is having issues, here's the workaround in your Podfile until this is published:

post_install do |installer|
  swifts = {
    'MatomoTracker' => '4.2'
    # ...specify any other Pods with Swift 4.x requirements here if necessary
  }

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = swifts[target.name] if swifts.has_key?(target.name)
    end
  end
end
brototyp-bot commented 5 years ago
1 Warning
:warning: Are there any changes that should be explained in the README.md?

Generated by :no_entry_sign: Danger

brototyp commented 5 years ago

Hey @notjosh, thanks a lot! Looks really good.

notjosh commented 5 years ago

Do you think you'd be able to bump a 6.0.1 release with support for this some time soon?

brototyp commented 5 years ago

Hey @notjosh, absolutely. Thanks for asking. I just released v6.0.1 including this.