typedef NS_ENUM(NSInteger,LoginState){
LoginStateSuccess,
LoginStateFail,
};
typedef NS_ENUM(NSInteger, UIInterfaceOrientation) {
UIInterfaceOrientationUnknown = 0,
UIInterfaceOrientationPortrait = 1 << 0,
UIInterfaceOrientationPortraitUpsideDown = 1 << 1,
UIInterfaceOrientationLandscapeLeft = 1 << 2,
UIInterfaceOrientationLandscapeRight = 1 << 3,
}
- (UIInterfaceOrientation)supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window{
return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight;
}
typedef NS_ENUM(NSInteger,LoginState){
LoginStateSuccess,
LoginStateFail,
};
- (void)change:(LoginState)state{
switch (state) {
case LoginStateFail:
break;
case LoginStateSuccess:
break;
}
}
Effective+Objective-C 2.0 编写高质量iOS与OS X代码的52个有效方法