I'm trying to convert the sample app AVMetadataRecordPlay from Objective C:
NSArray *specs = @[@{ (__bridge id)kCMMetadataFormatDescriptionMetadataSpecificationKey_Identifier : AVMetadataIdentifierQuickTimeMetadataLocationISO6709,
(__bridge id)kCMMetadataFormatDescriptionMetadataSpecificationKey_DataType : (__bridge id)kCMMetadataDataType_QuickTimeMetadataLocation_ISO6709 }];
CMFormatDescriptionRef locationMetadataDesc = NULL;
CMMetadataFormatDescriptionCreateWithMetadataSpecifications(kCFAllocatorDefault, kCMMetadataFormatType_Boxed, (__bridge CFArrayRef)specs, &locationMetadataDesc);
to Swift 2:
let specs = [[kCMMetadataFormatDescriptionMetadataSpecificationKey_Identifier as String: AVMetadataIdentifierQuickTimeMetadataLocationISO6709, kCMMetadataFormatDescriptionMetadataSpecificationKey_DataType as String: kCMMetadataDataType_QuickTimeMetadataLocation_ISO6709 as String]]
var locationMetadataDesc : CMFormatDescription
CMMetadataFormatDescriptionCreateWithMetadataSpecifications(kCFAllocatorDefault, kCMMetadataFormatType_Boxed, specs, &locationMetadataDesc)
Xcode 7.0 beta 2 reports error (not detailed enough):
Cannot invoke 'CMMetadataFormatDescriptionCreateWithMetadataSpecifications' with an argument list of type '(CFAllocator!, CMMetadataFormatType, [Dictionary<String, String>], inout CMFormatDescription)'
The function signature is
func CMMetadataFormatDescriptionCreateWithMetadataSpecifications(allocator: CFAllocator?, _ metadataType: CMMetadataFormatType, _ metadataSpecifications: CFArray, _ outDesc: UnsafeMutablePointer<Unmanaged<CMMetadataFormatDescription>?>) -> OSStatus
Any advice how to do this conversion properly?