Re: macOS animation works once, then not again


Quincey Morris
 

On Jan 30, 2018, at 09:52 , Steve Mills <sjmills@...> wrote:

Shouldn't that just work? Why isn't it redrawing the bez view at alphaValue 1 before fading to 0?

I don’t know, but your code made me wonder what happens (if you haven’t tried it already) if you remove this line from your completion handler:

self.bezView.alphaValue = 1;

and add this variation to the initiating animation block:

self.bezView.animator.alphaValue = 1;

(Not the exact animation you were looking for, but the question is whether it works at all.)

Or, going at the opposite end of that same thought, is it in fact meaningful to use the animator proxy:

self.bezView.animator.alphaValue = 0;

inside an explicit animation block? Maybe you can’t mix the two mechanisms.

(I looked back at some code I wrote years ago that used explicit animations to fade views in and out, but it was not much help. I used NSViewAnimation objects, and I had commented it out anyway, because at some macOS update it stopped working reliably and I had no idea why.)



Join cocoa@apple-dev.groups.io to automatically receive all group messages.