I am trying to get JSON data from the API & I want to print it on the terminal to check whether I am receiving data on my terminal or not but I am getting this error. I am currently using Swift 5 .
import UIKit
import Alamofire
typealias JSON = [String: Any]
class NetworkingService {
static let shared = NetworkingService()
private init() {}
func getPeople(completion: () -> Void) {
AF.request("https://launchlibrary.net/1.4/launchstatus").responseJSON{ (response) in
if let json = response.result.value as? JSON { // here I am getting error
print(json)
}
}
}
}