nuclearace / Socket.IO-Client-Swift

socket.io-client for Swift
Other
361 stars 53 forks source link

Support for off(event:callback:) #97

Closed ostap0207 closed 8 years ago

ostap0207 commented 8 years ago

Are you planing to add support for off(event:callback:), so you can delete just specific call back if needed as in JS version?

nuclearace commented 8 years ago

That won't be easy since you can't compare functions in Swift

ostap0207 commented 8 years ago

Would you consider returning some handler object through which you can remove callback if later.

var handler = socket.on("event")  { ... }
socket.off("event", handler)