How can I check in Swift if a value is an Array. The problem is that an array of type Int
can apparently not be casted to an array of type Any
. Suppose I have an array myArray
of type Int
and execute the following:
if let array = myArray as? [Any] { return true }
it doesn't return true (which surprises me actually). The same thing appears with dictionaries. I want a dictionary of type String, Any
(meaning that Any
can be any type). How can I check if it is?
Thanks in advance.