gpt4 book ai didi

ios - uiimagePickerController didFinishPickingMediaWithInfo 用法

转载 作者:行者123 更新时间:2023-11-28 15:33:38 25 4
gpt4 key购买 nike

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let image = (info[UIImagePickerControllerOriginalImage] as? UIImage) {
self.memeImage.image = image
}
dismiss(animated: true, completion: nil)
}

info 是一个有两个值的字典。但是在:

info[UIImagePickerControllerOriginalImage] as? UIImage

里面只有一个字符串值UIImagePickerControllerOriginalImage

为什么?以及如何使用它?

最佳答案

info[UIImagePickerControllerOriginalImage] as? UIImage

info 是字典,这是一个集合,其元素是键值对。

这里是字符串类型的键:- UIImagePickerControllerOriginalImage

值为:- UIImage 对象

此外,您可以在此处看到所有键: https://developer.apple.com/documentation/uikit/uiimagepickercontrollerdelegate/editing_information_keys

关于ios - uiimagePickerController didFinishPickingMediaWithInfo 用法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44515704/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com