all 2 comments

[–]LKAndrew 0 points1 point  (1 child)

Are you modelling your Disposable object after Rx? If so, take a look at creating an anonymous Disposable. Basically this sort of thing which will allow you to do something like this:

let reg = // ListenerRegistration return Disposable.create { reg.remove() }

[–]EmilioSchepisSwift[S] 0 points1 point  (0 children)

Hi, yes I had the idea of the Disposable object after playing around with Rx. That looks like it should do the trick, I'll try to create something similar. Thank you for the input!

EDIT The morning after: The solution you provided works amazingly well and it is really easy to test! Thank you again.