SwiftyDrop icon indicating copy to clipboard operation
SwiftyDrop copied to clipboard

Completion handler

Open talk2cerlin opened this issue 7 years ago • 3 comments

Does this plugin has a completion handler?

I want to run a callback method on closing of the message

talk2cerlin avatar Oct 10 '17 07:10 talk2cerlin

I can open a PR for this. Should it run when the user manually closes the message, or also when the message automatically closes itself after the timeout? I'd prefer the latter for my use case. Maybe there's an elegant way to provide an option.

andreyrd avatar Nov 20 '17 16:11 andreyrd

Maybe pass an enum parameter to the closure that says why it was called? Closed manually, or timed out.

DavidLari avatar Nov 20 '17 17:11 DavidLari

Errr, now that I think about it, the completion handler for being closed manually is already there...DropAction.

Edit: Sort of..not for swiping. :P

andreyrd avatar Nov 20 '17 17:11 andreyrd