Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 3 Support #647

Closed
zhigang1992 opened this issue Sep 23, 2016 · 10 comments
Closed

Swift 3 Support #647

zhigang1992 opened this issue Sep 23, 2016 · 10 comments
Labels

Comments

@zhigang1992
Copy link
Contributor

First of all, apologize for this really really late response.

tl;dr

We have landed Swift3 support in master branch, also Swift2.3 support in swift2 branch.


### Upgrade to Swift3 #### With CocoaPods

Update your Podfile

pod 'SwiftyJSON', '3.0.0'

Also, at the time of writing, CocoaPods 1.1 is still not released.
So in order to get it working with Xcode8, we need the rc version

gem install cocoapods -v 1.1.0.rc.2

Or, if you can't upgrade your cocoapods, try this solution from RxSwift

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
      config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.10'
    end
  end
end

Carthage

github "SwiftyJSON/SwiftyJSON" "3.0.0"

Upgrade to Swift2.3

CocoaPods

Update your Podfile

pod 'SwiftyJSON', '2.4.0'

Carthage

github "SwiftyJSON/SwiftyJSON" "swift2"

Please file new issues or comment if you're still having issues upgrading


Unfortunately, all the previous notification and mentioning to the authors had somehow fall through the cracks.

Even through Swift3 support was something hanging in our mind, but we all thought that the other guy would had done it already.

like a old Chinese saying

三个和尚没水喝 / too many cooks spoil the broth

None of us actually go ahead and get this through.

We are very sorry for this.

Starting from now, I'll be more involved in this project, responding to issues, PRs and pushing out new roadmaps.


Thank you all for being involved here, especially for sending out those swift3 swift2.3 PRs.
We look through most of them, and most of them were alike, so we picked the most recent one from jeneumeier.

Cheers

@kas-kad
Copy link

kas-kad commented Oct 4, 2016

@zhigang1992
why don't you set this in your podspec?

s.pod_target_xcconfig =  {
        'SWIFT_VERSION' => '3.0',
}

No need to force people changing their podfiles with post_instal. So simple.

@oliverfoggin
Copy link

@kas-kad I've worked around this for now by forking the repo and specifying my own repo in the Podfile.

Hope that helps for now.

@kas-kad
Copy link

kas-kad commented Oct 6, 2016

@oliverfoggin yeah, I mean there are several ways to workaround the problem manually, but it can be solved once and forever without any need to explain people how to do it by themselves

@zhigang1992
Copy link
Contributor Author

@kas-kad I think it's a really good idea. Let's add it. 🍻

@zhigang1992
Copy link
Contributor Author

Seems like @fishcharlie already have a PR for it.

#673

merging away.

@gadget00
Copy link

not working for me; Xcode still tells me SwiftyJSON is not compatible with Swift3

@oliverfoggin
Copy link

@gadget00 you need to install the prerelease version of cocoa pods.

Suso gem install cocoapods --pre

@DavidLari
Copy link

Actually, release version 1.1 should do it. Pre is on 1.2 beta now.

@liufsd
Copy link

liufsd commented Nov 25, 2016

swift 3.0.1 xcode 8.1

@delajose90
Copy link

Updating pod 'SwiftyJSON', '3.0.0' is working for me. Really thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants