Я получаю ноль в let restResponse = try? JSONDecoder().decode(SelectCourseResponse.self, from: data)
по каким-либо причинам?
func getMotherLangRequest() {
showActivityIndicatory(uiView: view, show: true)
AF.request(NetworkUrl.motherLang_getRequest,
method: .get)
.responseJSON { response in
self.showActivityIndicatory(uiView: self.view, show: false)
debugPrint(response)
switch response.result {
case .success:
guard let data = response.data else { return }
let restResponse = try? JSONDecoder().decode(SelectCourseResponse.self, from: data)
if restResponse?.status == 0 {
} else { self.showErrorResponse(data: data) }
case let .failure(error): print(error)
}
}
}
здесь получите запрос
Моя структура SelectCourseResponse