title: Codable & Custom Getter Build Errors
body: <p>I am doing my first steps with the Codable Protocol and getting a Build Error when trying to mix my struct with a custom getter. How would I solve this problem. Do I have to write custom decode and encode functions?</p>
  
  <pre><code>struct MyStruct: Codable {
    var variable: String? {
      get { return variable?.lowercased() }
    }
  
    private enum CodingKeys: String, CodingKey {
      case variable = "variable1"
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/sYA0N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sYA0N.png" alt="enter image description here"></a></p>
  
  <p><strong>UPDATE: WORKAROUND</strong></p>
  
  <p>I found one workaround, which is not optimal but it does the job, by introducing a private variable holding the 'real' data:</p>
  
  <pre><code>struct MyStruct: Codable {
    private var _variable: String?
    var variable: String? {
      get { return _variable?.lowercased() }
    }
  
    private enum CodingKeys: String, CodingKey {
      case _variable = "variable1"
    }
  }
  </code></pre>