attachments is a CFDictionaryRef. How do I accomplish the (_bridge NSDictionary *) functionality in Swift?
CIImage *ciImage = [[CIImage alloc] initWithCVPixelBuffer:pixelBuffer
options:(__bridge NSDictionary *)attachments];
UPDATE
here is the full code section I have tried for creating the CIImage.
func captureOutput(captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, fromConnection connection: AVCaptureConnection!) {
var pixelBuffer:CVPixelBufferRef = CMSampleBufferGetImageBuffer(sampleBuffer)
var attachmentMode = CMAttachmentMode(kCMAttachmentMode_ShouldPropagate)
var attachments = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, attachmentMode)
var ciImage:CIImage = CIImage(CVPixelBuffer: pixelBuffer, options: attachments)
}
ANSWER
@NobodyNada's answer is correct, but because attachments is an 'unmanaged' CFDictionary you have to take the unretainedValue of the dictionary in order to clear the error. The correct answer is:
var ciImage:CIImage = CIImage(CVPixelBuffer: pixelBuffer, options: attachments.takeUnretainedValue())