It is necessary to create simultaneously 20 infinitely repeating animations with different delay. An animation consists of a transition [_imageView setAlpha:0]; in [_imageView setAlpha:1]; Everything works well. The problem is that the device gets very hot and fast.

Single animation code

  [UIView animateWithDuration:3.0f delay:0 options:UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat animations:^{ _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(148, 0, 17, 18)]; _imageView.image = [UIImage imageNamed:@"imag.png"]; [self.view addSubview: _imageView]; [_star setAlpha:0]; [_star setAlpha:1]; } completion:nil]; 

Is it possible to reduce the load on the device?

  • can create 10 instead of alpha in advance or how many frames of animation of transition from one color to another will be there? What is your background? can I get rid of alpha? - Max Mikheyenko pm

2 answers 2

You have a strange creation and adding _imageView in the animation block. Try to make the creation somewhere a couple of levels higher. Also do it through your timer, so you can control the smoothness (and the heating, respectively).

If this does not help, then programmatically make 10-20-30 picture frames (what should be on the screen) and change them. Then the process will not need to constantly calculate transparency.

In a pinch - OpenGL :)

    It depends on the functions themselves, if they require a minimum of many resources, the device will warm up, their implementation is minimally simple, try using less demanding functions for drawing, and so it’s impossible to reduce the heat, and there are no good backgrounds for apple backgrounds cooling and heat removal, so that heating is a common thing, well, if it does not exceed 70 degrees