Saving file to disk while running AVCaptureVideoPreviewLayer and CMMotionManager
-
09-09-2020 - |
Question
Good day, hope someone can help me up with this situation:
I working on an iPhone app that takes series of images, assisted by gyroscope. So both AVCamCaptureManager and CMMotionManager sessions are running at the same time.
after taking a still image, i am: - processing the image in a background thread (which works fine without affecting anything) - then saving processed image data to disk
[imageData writeToFile:imagePath atomically:YES];
The issue: both AVCamCaptureManager and CMMotionManager sessions freeze for less then 1/2 second, right after initiating writeToFile function.
Does anyone have any experience with such scenario? Thanks for your time! :)
Solution
It appears that saving to disk does not affect sessions.
I am also setting UIImageView.image to a large image in the end of my routine, and this is what was freezing everything for 1/2 second.