iOS 定义枚举

来源:互联网 发布:69端口 编辑:程序博客网 时间:2024/06/08 06:09
typedef NS_ENUM(NSInteger, TopViewType) {

    star = 
1,
    hot = 
2,
    fresh = 
3
};

@interface StarShowModel : NSObject


@property(nonatomic,assignTopViewType topViewType;


使用:

 StarShowModel *star1 = [[StarShowModel allocinit];
 star1.
topViewType = hot;




 if (self.starModel.topViewType == hot) {
        
        
self.star.hidden = YES;
        
self.hot.hidden = NO;
        
self.fresh.hidden = YES;
       
    }



0 0
原创粉丝点击