I have a custom class Product defined as
class Product: NSObject {
var name: String
var priceLabel: String
var productImage: UIImage
init(name: String, priceLabel: String, productImage: UIImage) {
self.name = name
self.priceLabel = priceLabel
self.productImage = productImage
super.init()
}
}
and I've created an array with that custom class
let toy = [
Product(name: "Car", priceLabel: "$5.00"),
Product(name: "Train", priceLabel: "$2.50")
]
How would I insert the UIImage into that array? I would need to insert a different picture for each toy.
Thanks in advance