I have an array with custom objects by 2 types. Also I have TableView, which shows objects from array. I need to select tableViewCell and check, if the element already in array - remove it from array, otherwise add it to array. I know, there is method for the checking array.contains(element) but my array looks like [Any] and it doesn't have this method.
I'm trying to check it with use for-in, but it's not good solution.
How can I do this?
let a: Int = 5
let b: String = "3"
let array: [Any] = [a, b]