Getting image from UIImagePickerController

后端 未结 4 762
野的像风
野的像风 2021-02-15 04:08

I want to get the image frm imagepickercontroller.But my code doesn\'t have any effect Here is the code..

- (void)imagePickerController:(UIImagePick         


        
4条回答
  •  甜味超标
    2021-02-15 04:34

    Updated for Swift 5, the following will safely unwrap the UIImage.

    // This uses the full key value
    guard let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else { return }
    
    // This uses only the info key value for shorter code
    guard let image = info[.originalImage] as? UIImage else { return }
    

提交回复
热议问题