3

I keep seeing block declarations like this:

typedef returnType (^TypeName)(parameterTypes);

And I would like to know, why would I declare a block as a typedef?

1 Answers1

1

You do it that way to reduce the likelihood of typos and make the code more readable. For an extreme example, see my answer here: Syntax to define a Block that takes a Block and returns a Block in Objective-C

Community
  • 1
  • 1
Nick
  • 2,361
  • 16
  • 27