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