Objective-C enum

How to create Objective-C enum.

Create it as protocol(.h)

Sample

@protocol Type <NSObject>

typedef enum type : NSUInteger {
    FIRST,
    SECOND
} type;

@end

FIRST indicates 0, SECOND is 1.

We can use it as switch statement. 🙂

int type = 0
switch ( type )
{
   case FIRST:
            break;
   case SECOND:
            break;
}