Declaring Blocks

Blocks use a modified function syntax. Like functions, blocks can take arguments and return values. This is the basic format of a declaration:

<ReturnType>(^<BlockName>)<(Arguments)>

Image ReturnType is the variable type returned by a block, if any.

Image BlockName is the symbol used for calling the block. The caret (^) is the system-wide indicator preceding the declaration of a block.

Image Arguments is an optional ...

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.