morizotter / SwiftyDrop

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

Completion handler #61

Open andreyrd opened 6 years ago

andreyrd commented 6 years ago

Added a completion handler to the dropdown, as discussed in #55

I kept action as the last parameter to drop(), so that we don't break anyone using trailing closure syntax. Based on a compile of my own project that uses SwiftyDrop, this doesn't seem to be a breaking change, but I'm not sure how adding this optional parameter will affect other projects.

morizotter commented 6 years ago

Thanks! I think it's a good approach. But I have a same concern about existing action. It'll maybe good for adding deprecated for exiting action .. mm.

andreyrd commented 6 years ago

Ah, right now action handles tap, while completion handles swipe or timeout. Maybe for a v5, completion could handle tap, swipe, and timeout!