Swift ForEach requires that conform to Identifiable

Error while using ForEach in SwiftUI

error build: Referencing initializer 'init(_::)' on 'ForEach' requires 
that '..' conform to 'Identifiable'

Solution:

Solution is to add a property named id in your struct and make the struct Identifiable.

Let’s say the struct is:

struct MyModel: Codable {
    let myId: String
    let description: String
}

The solution will be to modify that struct and make it like this:

struct MyModel: Codable, Identifiable {
    let id: String {
            self.myId
        }
    let myId: String
    let description: String
}