I'm creating a tableView from a set of different inheritance classes, but i can't seem to figure out what is the best way to add them all in to a tableView, without creating multiple arrays, which isn't ideal?
Lets for instance take a classic example, how would i be able to add multiple different cat and dog objects into an tableView? what is the best way to do this?
class Pet {
var id: Int = 0
var name: String = ""
}
class Dog: Pet {
var Type: String = ""
}
class Cat: Pet {
var Type: String = ""
}