iOS/Objective-C "if" best practice I've got this code that I found in a project and I'm wondering how can it be done better:

- (void) setAlpha:(float)alpha {
    if (self.superview.tag == noDisableVerticalScrollTag) {
        if (alpha == 0 &amp;&amp; self.autoresizingMask == UIViewAutoresizingFlexibleLeftMargin) {
            if (self.frame.size.width &lt; 10 &amp;&amp; self.frame.size.height &gt; self.frame.size.width) {
                UIScrollView *sc = (UIScrollView*)self.superview;
                if (sc.frame.size.height &lt; sc.contentSize.height) {
                    return;
                }
            }
        }
    }
    if (self.superview.tag == noDisableHorizontalScrollTag) {
        if (alpha == 0 &amp;&amp; self.autoresizingMask == UIViewAutoresizingFlexibleTopMargin) {
            if (self.frame.size.height &lt; 10 &amp;&amp; self.frame.size.height &lt; self.frame.size.width) {
                UIScrollView *sc = (UIScrollView*)self.superview;
                if (sc.frame.size.width &lt; sc.contentSize.width) {
                    return;
                }
            }
        }
    }

    [super setAlpha:alpha];
}
First of all, using the tag to distinguish between views is almost everytime (there are exceptions) a bad idea. It's much cleaner to use your own variable (pointers to view, BOOL flags).

10 is a magic number. What does it mean? Use a constant.

Use methods. Four levels of if are terrible. Extract the code into methods.

if ([self isVerticalScrollingDisabled] || [self isHorizontalScrollingDisabled]) {
    return;
}

[super setAlpha:alpha];


By the way, changing the behavior of a method in a subclass (the method sets alpha only if some conditions are valid) is smelly from architecture point of view. Declaring a special method, e.g. setAlphaIfScrollingEnabled: would be better.