Using SwiftyJSON with Swift3

时光毁灭记忆、已成空白 提交于 2019-11-29 07:05:37

问题


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?


回答1:


SwiftyJSON now supports Swift 3.

pod 'SwiftyJSON', '3.0.0'




回答2:


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.




回答3:


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

pod 'SwiftyJSON', '3.1.4'


来源:https://stackoverflow.com/questions/39475083/using-swiftyjson-with-swift3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!