0

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.

unknown
  • 788
  • 9
  • 24
  • Does this answer your question? [Dragging out of NSTableView to Remove](https://stackoverflow.com/questions/7707034/dragging-out-of-nstableview-to-remove) – Willeke Oct 18 '21 at 10:02
  • I have already implemented the item removal from the tableview. Now I'm trying to add an animation like the "puff of smoke" animation that played when a dock item is removed in previous builds of macOS. – unknown Oct 18 '21 at 12:20

1 Answers1

0

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))
}
unknown
  • 788
  • 9
  • 24