在iOS中枚舉類型的使用方式,NS_ENUM(類型,類名)。
typedef NS_ENUM(NSUInteger, ViewType) {
Contacts_Stranger,//陌生人
Contacts_NormalFriend,//普通好友
Contacts_SpecialFriend,//特別關(guān)心好友
};
typedef NS_OPTIONS(NSUInteger, PermittedDirection) {
PermittedDirectionUp = 1 << 0,
PermittedDirectionDown = 1 << 1,
PermittedDirectionLeft = 1 << 2,
PermittedDirectionRight = 1 << 3,
};
參考:http://blog.csdn.net/liu1347508335/article/details/51166911