I am currently working on a simple photo and video capture application. The application successfully allows the user to take a picture or video at the touch of a button. However, as soon as you finish taking your photo or video, it gives you 2 options: Repeat and Use photo or Use video, depending on which one you are using.
If the user clicks “Retake”, then he simply allows them to re-upload a new photo or video, but when the user clicks “Use photo” or “Use video”, the screen freezes.
If I exit the frozen application and look into my camera roll, the photo that I just saved using the application has been saved. Therefore, when you click the "Use photo" button, it successfully saves in the camera roll, despite the fact that the application screen freezes.
Someone told me that "it freezes because it takes some time to save the photo and it works in the main thread. You can use ALAssetLibrary to fix the freeze problem."
However, I am not familiar with ALAssetLibrary or the theory of why this would be useful in this situation. I just looked through some of the documentation and I'm still lost.
Any help would be greatly appreciated.
Here is the code that I still have:
ViewController.h:
ViewController.m:
ios objective-c uiimagepickercontroller alassetslibrary
user3117509
source share