I am implementing the glowing red button as a subclass of NSImageView. You can see my code here.

When a background activity is in progress, the red circle image does not glow fluidly as it should. However, it starts to glow by the end of the background process.

Can anybody give me any suggestions by looking at my code ?

1

There are 1 best solutions below

2
Iman Nia On

If I understood you correctly, your red button doesn’t glow when you call it from a background thread.

Because you can not update UI from background thread. You may have two options here :

  1. Do what you want to do with your GlowingImageView instance in main thread by using DispatchQueue.main.async
  2. Implement your animation code on main thread! Which is crazy! And I am not recommending this!