title: checking if scene contains nodes of specific type
body: <p>In my SKScene, I want to check if there are any nodes that are of a specific type. And because I need something like this multiple times, I was trying to create the following function, that takes a type as a function, but it doesn't compile, any help please?</p>
  
  <pre><code>extension SKNode {
      func containsObject(ofType type: Any) -&gt; Bool {
          return children.contains(where {$0 is type}) ? true : false
      }  
  }
  </code></pre>
  
  <p>The error:</p>
  
  <blockquote>
    <p>Use of undeclared type 'type'</p>
  </blockquote>