Use of undeclared type 'JSON' and use of u

2019-07-15 04:07发布

I am having the above error on every file in my Xcode 8.2 project (swift 3) that require JSON or JSONEncoding. I already have SwiftyJSON in my pod files and imported it in those files. I already added it in the list of dependancies and links.

Target Dependancies

link binary

here's and import example

enter image description here

and an error example

enter image description here

Any help to solve this issue would be greatly appreciated

here are more examples from different swift files

this errors says 'Could not infer type for 'arrFeeds''

this one is for use of undeclared type 'JSON' enter image description here

1条回答
干净又极端
2楼-- · 2019-07-15 04:39

that is Easy. just do this and Run it...
import Alamofire
import SwiftyJSON

and Replace JSON? to JSON
that it..

try this
if responseObject.result.isSuccess { let resJson = JSON(responseObject.result.value!) success(resJson) } if responseObject.result.isFailure { let error : Error = responseObject.result.error! failure(error) }

查看更多
登录 后发表回答