Using Blocks

You call blocks in much the same way you call functions. For a named block, this works just as you would expect:

<ReturnVariable> = <BlockName>(<Arguments>);

Image ReturnVariable is an optional variable for holding the value returned by a block. If the block has no return value, you omit both ReturnVariable and the equals sign.

Image BlockName is the symbol used for calling the block.

Image Arguments is an optional list ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.