title: Using isKindOfClass with Swift
body: <p>I'm trying to pick up a bit of Swift lang and I'm wondering how to convert the following Objective-C into Swift:</p>
  
  <pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
      [super touchesBegan:touches withEvent:event];
  
      UITouch *touch = [touches anyObject];
  
      if ([touch.view isKindOfClass: UIPickerView.class]) {
        //your touch was in a uipickerview ... do whatever you have to do
      }
  }
  </code></pre>
  
  <p>More specifically I need to know how to use <code>isKindOfClass</code> in the new syntax.</p>
  
  <pre><code>override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
  
      ???
  
      if ??? {
          // your touch was in a uipickerview ...
  
      }
  }
  </code></pre>