-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass observer to the callback closure, to avoid retain cycle or [weak self] boilerplate #59
Comments
This would work and some might prefer it, but I do like the bare bones closure approach. This would work even better if you could name observer as "self", overriding the instance reference complectly in the closure, so that one would not have any way of accidentally capturing the actual instance. |
@artman rebinding of self is coming in Swift 4.2 I believe: swiftlang/swift#15306 Would you accept this functionality I mentioned in the library? If yes, I may invest some time and look into it. |
For sure! |
Hey there, first thanks a lot for this library, pretty neat and useful! I'm wondering if there's any plans to implement passing the observer to the callback closure? Thanks! |
It is not in my scope at the moment :/ |
Would it make sense to pass the observer as a parameter in the callback closure? Something like:
This will allow to convert this:
Or this:
Into this:
The text was updated successfully, but these errors were encountered: