Swift - UIImagePickerController - how to use it?

前端 未结 5 2085
天涯浪人
天涯浪人 2020-12-05 02:05

I am trying hard to understand how this works, but it\'s pretty hard for me. =) I have 1 view, there is one button and one small ImageView area for preview. The button trigg

5条回答
  •  情书的邮戳
    2020-12-05 02:19

    You're grabbing a UIImage named UIImagePickerControllerOriginalImage and there exists no such image. You're meant to grab the UIImage with the key UIImagePickerControllerOriginalImage from the editingInfo dictionary:

    let tempImage = editingInfo[UIImagePickerControllerOriginalImage] as! UIImage
    

提交回复
热议问题