13. Introducing Blocks

Blocks are one of the most powerful and underutilized features of Objective-C. It is important that you understand blocks as more system calls start taking them as arguments. Blocks are part function, part method, and part variable. For many, blocks can appear magical, especially the way they seem to pull in the variables around them.

This chapter introduces you to blocks and helps you avoid the most common mistakes. You start by learning the basics of blocks: what they are and how to declare, use, and write them. Then you use your understanding of blocks to make the About taxi more inviting.

Next, you learn more about blocks, including other variables, their most powerful feature and the source of most mistakes. Then you ...

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.