Created
April 27, 2012 20:27
-
-
Save Sahil/2512744 to your computer and use it in GitHub Desktop.
Easier way to create a UIViewAutoresizing mask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the last param must be NSNotFound | |
+ (UIViewAutoresizing)autoresizeWithMask:(UIViewAutoresizing)firstMask, ... { | |
va_list args; | |
va_start(args, firstMask); | |
UIViewAutoresizing autoresizingMask = UIViewAutoresizingNone; | |
for (UIViewAutoresizing nextMask = firstMask; nextMask != NSNotFound; nextMask = va_arg(args, UIViewAutoresizing)) { | |
autoresizingMask |= nextMask; | |
} | |
va_end(args); | |
return autoresizingMask; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment