Last active
December 17, 2015 05:39
-
-
Save joelrfcosta/5559512 to your computer and use it in GitHub Desktop.
Util macros to use on iOS projects
This file contains 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
#define DLog(__FORMAT__, ...) \ | |
NSLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) | |
#define HexValueFromString(string) { \ | |
unsigned int rgbHex; \ | |
[[NSScanner scannerWithString:@""] scanHexInt:&rgbHex]; \ | |
return rgbHex; \ | |
} | |
#define UIColorFromRGB(rgbValue, alphaValue) \ | |
[UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ | |
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ | |
blue:((float)(rgbValue & 0xFF))/255.0 \ | |
alpha:alphaValue] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment