How can i get original nsdata of uiimage?

后端 未结 2 2124
闹比i
闹比i 2020-12-11 12:35

In my app, user can select a pic from album or camera where i can get uiimage representation. Since the album may have pic from web, the file type is not only jpg. Then i ne

2条回答
  •  Happy的楠姐
    2020-12-11 12:44

    On iOS 8.0+ use PHImageManager.default().requestImageData() after you locate the corresponding asset in the assets (you can get to assets with PHAsset.fetchAssets().

    See more info and example code in my answer to very similar question How to upload image that was taken from UIImagePickerController.

提交回复
热议问题