OC里枚举的两种类型.
NS_ENUMNS_OPTIONS
本质上是一样的都是枚举.

typedef NS_ENUM(NSInteger, UIViewAnimationTransition) {
UIViewAnimationTransitionNone,
UIViewAnimationTransitionFlipFromLeft,
UIViewAnimationTransitionFlipFromRight,
UIViewAnimationTransitionCurlUp,
UIViewAnimationTransitionCurlDown,
};
typedef NS_OPTIONS(NSUInteger, UIViewAutoresizing) {
UIViewAutoresizingNone = ,
UIViewAutoresizingFlexibleLeftMargin = << ,
UIViewAutoresizingFlexibleWidth = << ,
UIViewAutoresizingFlexibleRightMargin = << ,
UIViewAutoresizingFlexibleTopMargin = << ,
UIViewAutoresizingFlexibleHeight = << ,
UIViewAutoresizingFlexibleBottomMargin = <<
};

NS_ENUM这种声明出来的东西大部分是单选. NS_OPTIONS声明出来的大部分是多选.

像UIViewAnimationTransition这种在用的时候肯定是只能选一种效果,你要么从左翻到右,要么从右翻到左,你做动画的时候总不能同一时刻让他同时从左到右,又从右到左翻,对吧.

而UIViewAutosizing就不一样了.我要是让子view的宽高和父View一样,那么autoviewsizing的选项肯定是类似于这种.UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight

05-11 20:14