Mutable Dictionary Keys in Swift: A Bug Waiting to Happen
Let's imagine we have cartItems dictionary that has product as key and number of items as value
struct Product: Hashable {
var id: Int
var name: String
}
var cartItems = [Product: Int]()
var
hudaios.hashnode.dev3 min read