Swift: 구조를 JSON으로 변환하시겠습니까? 작성했습니다.structJSON 파일로 저장하려고 합니다. struct Sentence { var sentence = "" var lang = "" } var s = Sentence() s.sentence = "Hello world" s.lang = "en" print(s) ...그 결과, Sentence(sentence: "Hello world", lang: "en") 하지만 어떻게 하면struct다음과 같은 것에 반대합니다. { "sentence": "Hello world", "lang": "en" } Swift 4는Codable사용자 지정 구조를 인코딩 및 디코딩하는 매우 편리한 방법을 제공하는 프로토콜입니다. struct Sentence : Cod..