I am wondering if its possible to have a an (||)”or” or (&&)”and” operator in ta switch statment case.
this is what I am thinking of.
switch (orientation) {
case UIDeviceOrientationPortrait:
{
case (UIDeviceOrientationLandscapeLeft || UIDeviceOrientationLandscapeRight):
}
break;
//...
if anyone can help me out I would really appreciate it 🙂
&& is not possible, but you can achieve something similar to || by having multiple cases without a break:
You can of course also work with
orientationinside your case block (ie evaluate it further)