does not conform to protocol Decodable / Codable : <p>I'm using the following struct:</p>

<pre><code>struct Item : Codable {

    var category:String
    var birthDate:Date
    var switch:Bool
    var weightNew: [Weight]
    var weightOld: Array&lt;Double&gt;
    var createdAt:Date
    var itemIdentifier:UUID
    var completed:Bool

    func saveItem() {
        DataManager.save(self, with: itemIdentifier.uuidString)
    }

    func deleteItem() { DataManager.delete(itemIdentifier.uuidString)
    }

    mutating func markAsCompleted() {
        self.completed = true
        DataManager.save(self, with: itemIdentifier.uuidString)
    }

}
</code></pre>

<p>And for weight:</p>

<pre><code>struct Weight {
    var day:Int
    var weight:Double
    var type:Bool
}
</code></pre>

<p>After changing weightOld to weightNew I get two errors:
- Type 'Item' does not conform to protocol 'Decodable'
- Type 'Item' does not conform to protocol 'Codable'</p>

<p>If I leave out 'var weightNew: [Weight]' it works. Don't know what is happening and how to solve it... Help is appreciated. </p>
