phimagemanager

PHImageResultIsDegradedKey/PHImageFileURLKey is not found

不羁岁月 提交于 2019-12-12 08:12:29
问题 iOS 13 beta4 no longer gives 1) PHImageFileURLKey 2) PHImageResultIsDegradedKey in image result info keys. Anyone knows a way to find the fileurl of the PHAsset? 回答1: You have to use this function from PHAsset object: - (PHContentEditingInputRequestID)requestContentEditingInputWithOptions:(nullable PHContentEditingInputRequestOptions *)options completionHandler:(void (^)(PHContentEditingInput *__nullable contentEditingInput, NSDictionary *info))completionHandler; Then you can retrieve URL

How to fix empty asset issue with PHImageManager in AssetsPickerController iOS?

一个人想着一个人 提交于 2019-12-11 23:54:42
问题 I am working on AssetsPickerController in Swift to select multiple Videos from Device gallery . Problem: When I am selecting multiple Videos or sometimes single video then sometimes my App is crashing due to Empty Video Asset . This is happening 5-10 times, out of 100 times of testing. Code: @IBAction func openAssetsAction(_ sender: UIButton) { let rootListAssets = AssetsPickerController() rootListAssets.didSelectAssets = {(assets: Array<PHAsset?>) -> () in for i in 0..<assets.count { let

PHImageResultIsDegradedKey/PHImageFileURLKey is not found

…衆ロ難τιáo~ 提交于 2019-12-03 14:47:43
iOS 13 beta4 no longer gives 1) PHImageFileURLKey 2) PHImageResultIsDegradedKey in image result info keys. Anyone knows a way to find the fileurl of the PHAsset? You have to use this function from PHAsset object: - (PHContentEditingInputRequestID)requestContentEditingInputWithOptions:(nullable PHContentEditingInputRequestOptions *)options completionHandler:(void (^)(PHContentEditingInput *__nullable contentEditingInput, NSDictionary *info))completionHandler; Then you can retrieve URL this way: NSURL *url = contentEditingInput.fullSizeImageURL; Some example Objective-C code for anyone else