Swift Hashable

up:: Swift ⚐

Iteration

Iterables needs to conform to Hashable.

The Foundation types like string, int etc are all hashable. So if your struct only has foundation types, it automatically conforms to Hashable.

struct Framework: Hashable, Identifiable {
    let id = UUID()
    
    let name: String
    let imageName: String
    let urlString: String
    let description: String
}
ForEach(MockData.frameworks) { framework in
	FrameworkTitleView(name: framework.name, imageName: framework.imageName)
}