TIL: A pleasant surprise when passing closures as parameters

This one might be obvious, but it was a very pleasant surprise.

Let’s say we have something like this:

And a regular function like:

Then, Xcode will provide this code hint:

And now I can do:

Which I guess is not that unexpected. But still, a pleasant surprise.

Leave a Reply

Your email address will not be published. Required fields are marked *