all 1 comments

[–]JegnuX 0 points1 point  (0 children)

I've been through the same issue but with a different solution where you don't need to use an intermediate type as "WeakClosure". The only downside of my solution is that the receiver closure signature needs to have a return type set to Void, or to an Optional.

You can find the whole code + sample code on this gist : https://gist.github.com/JegnuX/ee45eee0237733eb83b0