1// The semicolons at the end of these declarations are not superfluous. 2typedef NS_ENUM (NSUInteger, MyEnum) {MyValue1, MyValue2, MyValue3}; 3typedef NS_OPTIONS (NSUInteger, MyBitmask) {MyBit1, MyBit2, MyBit3}; 4 5// NS_ENUM specifies the type and name of the enum. 6typedef enum { 7MyValue1, 8MyValue2, 9MyValue3 10} MyEnum; 11typedef NS_ENUM (NSUInteger, MyEnum) { 12MyValue1, 13MyValue2, 14MyValue3 15}; 16 17// NS_OPTIONS is equivalent to NS_ENUM, but semantically used for bitmask enums. 18typedef enum { 19MyBit1 = (1u << 0), 20MyBit2Longer = (1u << 1), 21MyBit3ThatIsConsiderablyMoreVerbose = (1u << 2) 22} MyBitmask; 23typedef NS_OPTIONS (NSUInteger, MyBitmask) { 24MyBit1 = (1u << 0), 25MyBit2Longer = (1u << 1), 26MyBit3ThatIsConsiderablyMoreVerbose = (1u << 2) 27}; 28