     }
     
     for metadataObjectType in metadataObjectTypes! {
-      if !contains(output.availableMetadataObjectTypes, { $0 as String == metadataObjectType }) {
+      if !contains(output.availableMetadataObjectTypes, { $0 as! String == metadataObjectType }) {
         return false
       }
     }

    let captureDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) as AVCaptureDevice
    
    var error: NSError?
    let deviceInput = AVCaptureDeviceInput.deviceInputWithDevice(captureDevice, error: &error) as AVCaptureDeviceInput
    
    if let _error = error {
      return false


    // Setup components
    let captureDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) as AVCaptureDevice
    let deviceInput   = AVCaptureDeviceInput.deviceInputWithDevice(captureDevice, error: nil) as! AVCaptureDeviceInput
    let output        = AVCaptureMetadataOutput()
    let session       = AVCaptureSession()
    
