Using SwiftyJSON with Swift3
Asked Answered
H

3

13

How do I use SwiftyJSON with Swift3? I've installed the pod.

pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'swift3'

But it throws a lot of errors using Xcode 8 GM.

Can someone help me install it properly?

Holzer answered 13/9, 2016 at 16:41 Comment(0)
G
7

SwiftyJSON now supports Swift 3.

pod 'SwiftyJSON', '3.0.0'

Germinative answered 1/10, 2016 at 15:53 Comment(0)
T
27

Update: as Marcus notes, SwiftyJSON now supports Swift 3. In order to get bug fixes, I recommend not pinning yourself to 3.0.0, but rather:

pod 'SwiftyJSON', '>= 3.0.0'

…or if you don’t want to accidentally pick up whatever API-breaking changes may arrive in 4.x:

pod 'SwiftyJSON', '~> 3.0'

[Old answer] There is an actively maintained fork that works:

pod 'SwiftyJSON', git: 'https://github.com/BaiduHiDeviOS/SwiftyJSON.git', branch: 'swift3'

Hopefully the project maintainers merge it. Until then, you can just use the fork.

Taiwan answered 14/9, 2016 at 3:43 Comment(1)
Trying to build via Carthage didn't work for me, but I pulled this code on its own from their Github, and it works fine! Thank you for posting this!Mease
G
7

SwiftyJSON now supports Swift 3.

pod 'SwiftyJSON', '3.0.0'

Germinative answered 1/10, 2016 at 15:53 Comment(0)
S
0

Please try this. I had a trouble for days. And this solve the issue for me.

pod 'SwiftyJSON', '3.1.4'
Sentry answered 1/3, 2017 at 13:15 Comment(1)
There's no need to post a new answer every time the version changes. Existing answers already show how to update the repository version.Diagnostic

© 2022 - 2024 — McMap. All rights reserved.