Show animation images using UIImageView

We want to animate the images using animationImages propery of UIImageView in our app. There are 45 heif images with dimensions of 1668x2388. Below is the code i am using to animate images.

	let imageViewAnimation = UIImageView()
	imgViewAnimation.animationImages = images
  imgViewAnimation.animationDuration = 5.0 
  imgViewAnimation.animationRepeatCount = 1
  imgViewAnimation.startAnimating()

    Timer.scheduledTimer(withTimeInterval: 5.0 + 0.5,  repeats: false) { _ in
        DispatchQueue.main.async {
            self.showAlert()
        }
    }

The issue i am facing is, it takes more than 5.0 seconds (animationDuration) to display all the images. Alert is shown before all the images are shown.

We face this issue only for few sets of images. For some other sets, it is working fine. Is this issue due to heif images used, or due to memory and CPU load of using large number of images.

Answered by Frameworks Engineer in 794103022

It's hard to say what's happening here from the sample code alone. Could you please file a feedback report and attach a sample project reproducing this? Thanks!

It's hard to say what's happening here from the sample code alone. Could you please file a feedback report and attach a sample project reproducing this? Thanks!

45 1668x2388 images is nominally 683MB of image data, which all need to be decoded and sent to the render server at the time you initiate this animation.

For this much image data, you should use a video instead.

Show animation images using UIImageView
 
 
Q