title: Swift Error : Use of module 'CMSampleBuffer' as a type
body: <p>I saw below question to use 'captureStillImageAsynchronouslyFromConnection' function in swift: 
  <a href="https://stackoverflow.com/questions/24288048/how-to-convert-code-avfoundation-objective-c-to-swift">How to convert code AVFoundation objective c to Swift?</a></p>
  
  <p>When I try to use a AVFoundation function as following:</p>
  
  <pre><code>var stillImageOutput: AVCaptureStillImageOutput!
  
  //...Initialize stillImageOutput
  
  stillImageOutput.captureStillImageAsynchronouslyFromConnection(videoConnection, completionHandler: {(imageSampleBuffer, error) in
          if imageSampleBuffer {
              var imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(imageSampleBuffer as CMSampleBuffer) // I get error on this line saying: 'Use of module ' CMSampleBuffer' as a type'
              self.processImage(UIImage(data: imageData))
          }
          })
  </code></pre>
  
  <p>I got the error on XCode, which says 'Use of module ' CMSampleBuffer' as a type'.
  I tried to rewrite that same line multiple times with slightly different ways, but I could not figure out the solution.</p>
  
  <p>Am I doing something wrong or is it possibly the shaky XCode Beta not working properly?</p>
  
  <p>Thank you in advance.</p>