0

I have a UIButton with an image as a background. Because of the way i’ve structured the flows in my program, there’s a certain moment when I have to update a couple of properties sequentially (including the background image) which causes the button to blink for a millisecond.

I want to get rid of that blinking of course, and that’s the part that's bugging my brain since a couple of days: I don’t know how to prevent these updates from displaying until I’m ready to display them.

Ideally I'd like to do something like:

// the view "freezes" in its current state
[UIView stopDisplayingUpdates];

// many updates happen here
// without being displayed 

// now everything is ready and the view should be repainted 
[UIView refreshDisplay];
  • You can try a `performWithoutAnimation` block http://stackoverflow.com/questions/18946490/how-to-stop-unwanted-uibutton-animation-on-title-change/34168845#34168845 – Paulw11 Jun 19 '16 at 10:46
  • This has improved it a bit. Previously the blink was appearing in aprox. 35% of the cases when the update was happening. Now it's about 15% of the cases. There should be a different way of doing this. – Dimo Vanchev Jun 19 '16 at 12:55

0 Answers0