teodorpatras / Jukebox

Player for streaming local and remote audio files. Written in Swift.
MIT License
551 stars 122 forks source link

Clear playlist functionality #35

Open mattwritescode opened 8 years ago

mattwritescode commented 8 years ago

A nice feature that seems to be missing from this library is a public clearQueue() method. I managed to workaround it, but it involved creating a singleton-like subclass of Jukebox and re-initializing the Jukebox instance everytime I'd like to clear it. It seems like overkill and possibly memory leak prone, but here's the solution I came up with: https://gist.github.com/mattwritescode/963c343bd96488d87d156e056d6f8d7c

Also, I don't mind contributing to this code change if you like. Thanks for the Jukebox though, it works great!

teodorpatras commented 8 years ago

Hi, thanks for your input! Will definitely implement this in one of the next releases! And sure, if you want, you can open a PR in the meantime!

Cheers!