I tried to cast dictionary of type [UIImagePickerController.InfoKey: Any] to [String: Any] type, but it seems it's not possible. The result was nil. I've found straightway to iterate throught original dict, grab value and insert it with rawValue. But maybe I'm doing it wrong
debugger showed that [UIImagePickerController.InfoKey: Any] under the hood is [NSString: Any]
let imagePropsDict: [UIImagePickerController.InfoKey: Any] = getStubbedProps()
var propsDict: [String: Any] = [:]
imagePropsDict.forEach { infoKey, value in
propsDict[infoKey.rawValue] = value
}
and the invalid code:
if let mappedDict = imagePropsDict as? [String: Any] { ... }