macOS, iOS

swift에서 기본 제공하는 json 파서: codable

SweetDev 2020. 6. 9. 14:21

struct AutoLoginResponse: Codable {

  let session: String?

  let error: Int?

}

 

let result = try? decoder.decode(AutoLoginResponse.self, from: data)