title: Swift - How to conform this struct to Codable?
body: <p>I have this struct</p>
  <pre><code>struct Photo: Codable {
      var image: UIImage
      let caption: String?
      let location: CLLocationCoordinate2D?
  }
  
  private enum CodingKeys: String, CodingKey {
      case image = &quot;image&quot;
      case caption = &quot;caption&quot;
      case location = &quot;location&quot;
  }
  </code></pre>
  <p>I get this 2 errors:</p>
  <blockquote>
  <p>Type 'Photo' does not conform to protocol 'Decodable'</p>
  <p>Type 'Photo' does not conform to protocol 'Encodable'</p>
  </blockquote>