问题
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.
here's and import example
and an error example
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'
回答1:
that is Easy.
just do this and Run it...import Alamofire
import SwiftyJSON
and
Replace JSON?
to JSON
that it..
try thisif responseObject.result.isSuccess {
let resJson = JSON(responseObject.result.value!)
success(resJson)
}
if responseObject.result.isFailure {
let error : Error = responseObject.result.error!
failure(error)
}
来源:https://stackoverflow.com/questions/41757877/use-of-undeclared-type-json-and-use-of-unresolved-identifier-jsonencoding