How to NSAnimationEffect in swift

166 Views Asked by At

I'm trying to play an animation when I remove an item from a NSTableView by dragging the item out of the window.

According to the documentation, its usually done using. NSAnimationEffect.

These effects are used to indicate that an item was removed from a collection, such as a toolbar, without deleting the underlying data. See NSShowAnimationEffect(::::::).

But I'm not sure how to use this.

1

There are 1 best solutions below

0
On

Didn't notice that NSAnimationEffect had a show() method. That seems to do the trick.

let loc = NSEvent.mouseLocation
NSAnimationEffect.poof.show(centeredAt: NSPoint(x: loc.x, y: loc.y), size: NSSize(width: 40, height: 40))
}