iOS: Using HanekeSwift with SwiftyJSON

醉酒当歌 提交于 2019-12-05 20:16:19

So, the solution that I've found works for me is just to declare the full type of JSON object you are trying to use. E.g. - declare SwiftyJSON.JSON rather than just JSON when expecting or using a SwiftyJSON struct, or Haneke.JSON when you want to use Haneke's JSON enum.

For example, for SwiftyJSON:

var json = SwiftyJSON.JSON(inputObject!)

or for Haneke:

var json = Haneke.JSON(inputObject!)

Found a nice solution for me at the HanekeSwift/issues.

Inside my class with conflicting imports declared as follows

typealias JSON = SwiftyJSON.JSON

Hope it might be usefull for someone

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