0

我找到了一些相关的帖子:

UIImagePickerControllerDelegate 到 Swift?

如何在 swift 中使用 UIImagePickerController 捕获相机?

但是它们都不适用于 beta 3,因为 UIImagePickerControllerDelegate 发生了变化:

func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]!)

我的问题是如何从 info Array 中获取 UIImage 对象?谢谢

4

1 回答 1

5

它是一本字典,用它索引UIImagePickerControllerOriginalImage

let image = info[UIImagePickerControllerOriginalImage] as UIImage
于 2014-07-16T16:31:10.190 回答