Codable2 [27일차] Codable 이란? Swift4에서 JSON 데이터를 손쉽게 파싱이 가능한 기술이 나왔다고 한다. 그 기술이 바로 'Codable'이다. Swift 공식 홈페이지에서 말하는 정의는 다음과 같다. "A type that can convert itself into and out of an external representation." 자신을 변환하거나 외부표현(external representation)으로 변환할 수 있는 타입입니다. 여기서 말하는 Decodable, Encodable 이란 무엇일까요? - Decodable : 자신을 외부표현(external representation)에서 디코딩 할 수 있는 타입 - Encodable : 자신을 외부표현(external representation)으로 인코딩 할 수 있는 타.. 2020. 8. 19. [21일차] Codable 이란? 실무에서 자주 사용하는 JSON 데이터를 실제로 활용하기 위해서는 파싱이라는 과정이 꼭 필요하다. 하지만, Swift에서는 Codable이라는 것이 이를 자동으로 처리해준다. (매우 간편하고 활용도가 높은 최고!) Codable의 사전적인 의미는 아래와 같다. "A type that can convert itself into and out of an external representation." 자신을 변환하거나 외부표현(external representation)으로 변환할 수 있는 타입입니다. Codable은 Decodable과 Encodable 프로토콜을 준수하는 타입(프로토콜) 이다. - Decodable : 자신을 외부표현(external representation)에서 디코딩 할 수 있는 타입.. 2020. 8. 10. 이전 1 다음