title: Use Swift `is` to check type of generic type
body: <p>Lets say that I have a variable of type <code>Any</code>, and I would like to know wether this is an array or not, here is what I would like to do:  </p>
  
  <pre><code>if myVariable is Array { /* Do what I want */ }
  </code></pre>
  
  <p>But Swift requires to give the generic type of the array such as :  </p>
  
  <pre><code>if myVariable is Array&lt;Int&gt; { }
  </code></pre>
  
  <p>But I don't want to check the generic type, I just want to know wether this is an array or not, I tried :  </p>
  
  <pre><code>if myVariable is Array&lt;Any&gt; { }  
  </code></pre>
  
  <p>Hoping that it would match every type of array, but that doesn't work either... (it doesn't match arrays of all types, so if my variable is an Int array, this code doesn't get called for instance)</p>
  
  <p>What should I do ?  </p>
  
  <p>Thank you.  </p>
  
  <p><strong>Edit with example of an approach solution that doesn't seem to work:</strong>  </p>
  
  <pre><code>struct Foo&lt;T&gt; {}
  
  struct Bar {
      var property = Foo&lt;String&gt;()
  }
  
  var test = Bar()
  
  let mirror = Mirror(reflecting: test)
  
  // This code is trying to count the number of properties of type Foo
  var inputCount = 0
  for child in mirror.children {
      print(String(describing: type(of: child))) // Prints "(Optional&lt;String&gt;, Any)"
      if String(describing: type(of: child)) == "Foo" {
          inputCount += 1 // Never called
      }
  }
  
  print(inputCount) // "0"
  </code></pre>