Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8주차] Codable에 대하여 설명하시오. #18

Open
kangddong opened this issue Jan 17, 2023 · 2 comments
Open

[8주차] Codable에 대하여 설명하시오. #18

kangddong opened this issue Jan 17, 2023 · 2 comments

Comments

@kangddong
Copy link
Contributor

No description provided.

@Lim-YongKwan
Copy link

Codable은 자신을 외부 표현으로 변환(Encode)하거나 외부 표현으로 부터 변환(Decode) 할 수 있는 타입으로 Encodable과 Decodable이로 이루어져있는 유니온 타입입니다.
여기서 Encodable이란 data를 Encoder에서 변화해주려는 프로토콜로 바꿔주는 것이며 반대로 Decodable이란 data를 원하는 모델로 Decode 해주는 것입니다.
Codable은 프로토콜이기 때문에 class, struct, enum 에 채택되어 사용이 가능합니다.

@obtusa07
Copy link

Codable

Decodable과 Encodable 프로토콜을 채택한 타입으로 JSON 파싱에 유용하게 사용된다.

JSONEncode나 PropertyListEncoder를 사용해서 encode 가능하다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants