This Soundcloud SDK has a great API and source code – I've just started using it and it seems exceptionally well designed + implemented to me. It makes use of advanced Swift features such as generic structs that make the code a pleasure to read and use.
I understand that class Soundcloud holds a static variable for the OAuth session, named session. Since class Soundcloud is the owner of that static variable, I would suggest to move the static login function (and related login/logout functions) from Session to Soundcloud itself. I argue that Session.login and Session.destroy shouldn't access Soundcloud's static variable session. As said, Soundcloud should manage this variable itself. This also makes it easier to read:
This Soundcloud SDK has a great API and source code – I've just started using it and it seems exceptionally well designed + implemented to me. It makes use of advanced Swift features such as generic structs that make the code a pleasure to read and use.
I understand that class
Soundcloud
holds a static variable for the OAuth session, namedsession
. Since classSoundcloud
is the owner of that static variable, I would suggest to move the staticlogin
function (and related login/logout functions) fromSession
toSoundcloud
itself. I argue thatSession.login
andSession.destroy
shouldn't accessSoundcloud
's static variablesession
. As said,Soundcloud
should manage this variable itself. This also makes it easier to read:instead of
What are your thoughts on this @delannoyk?