morizotter / SwiftyDrop

Lightweight dropdown message bar in Swift. It's simple and beautiful.
MIT License
683 stars 74 forks source link

Completion handler #55

Open talk2cerlin opened 6 years ago

talk2cerlin commented 6 years ago

Does this plugin has a completion handler?

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

andreyrd commented 6 years ago

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.

DavidLari commented 6 years ago

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

andreyrd commented 6 years ago

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