I am attempting to use CFStringCompare to compare strings, but I keep getting a Could not find an overload for == that accepts the supplied arguments.
More specifically, the bit of code looks like:
func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info: NSDictionary!)
{
let mediaType = info.objectForKey(UIImagePickerControllerMediaType) as String
if CFStringCompare(mediaType as NSString!, kUTTypeMovie, compareOptions: 0) == CFComparisonResult.CompareEqualTo
{
var moviePath : NSString = info.objectForKey(UIImagePickerControllerMediaURL).path
if UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath)
{
UISaveVideoAtPathToSavedPhotosAlbum(moviePath, nil, nil, nil)
}
}
else ...
I'm sure I'm just screwing up the syntax, however I've tried making mediaType an Optional String and unwrapping it:
let mediaType = info.objectForKey(UIImagePickerControllerMediaType) as String?
and still could not find overload for ==
.
Any ideas? Thank you in advance!