I use UIImagePickerViewController to pick a photo in my photo editing app. My user complained that the usage of my app's 'Documents & Data' is increasing every time he uses the app and now it's consuming nearly 1GByte.
After some investigation, I found that each time I picked a photo using the UIImagePickerViewController, the usage of 'Documents & Data' of the app increase. This can also be seen in the UIImagePickerViewController sample program provided by Apple.
After launching the sample app and pick a photo from PhotoLibrary, you see the usage of "Document & data" in the Settings app is higher than before picking the photo. In most cases, it will increase each time you pick a photo.
It's OK if it stays at some limited value as cache, but it seems that it keeps increasing every time I pick a photo.
Is there a way to clear the data used by UIImagePickerViewController? or is there a way to stop it from consuming storage?
I have also tried it with the PHPickerViewController (the newer version of official image picker) using the sample project below, but the same problem occurs.
https://developer.apple.com/documentation/photokit/selecting_photos_and_videos_in_ios
I have tried on my iPhone12 pro(iOS14.4) using iOS SDK 14.4