0

There is a piece of code like

typedef void (^SignIn) (NSString *email, NSString *password);

What does the ^ mean before SignIn? Is this Objective-C specific usage?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Adam Lee
  • 24,710
  • 51
  • 156
  • 236

2 Answers2

4

It's the syntax for blocks.

That typedef declares SignIn to mean a block which takes two NSString* arguments and returns void (i.e. nothing).

Jeremy Roman
  • 16,137
  • 1
  • 43
  • 44
1

It is a block.

For a guide to understanding blocks, see this tutorial

Unless, you already know what a block is, and you just didn't know what the caret was for.

CaptJak
  • 3,592
  • 1
  • 29
  • 50