Created
November 29, 2016 01:34
-
-
Save bright23/ff63106d4cd687aa874fdc9de3334d24 to your computer and use it in GitHub Desktop.
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
/** | |
* UIStoryboard (InstantiateViewController) | |
*/ | |
UIKIT_STATIC_INLINE __kindof UIViewController *InstantiateViewControllerOnStoryboard(NSString *storyboardName, NSString *identifier) { | |
return [[UIStoryboard storyboardWithName:storyboardName bundle:nil] instantiateViewControllerWithIdentifier:identifier]; | |
} | |
UIKIT_STATIC_INLINE __kindof UIViewController *InstantiateInitialViewControllerOnStoryboard(NSString *storyboardName) { | |
return [[UIStoryboard storyboardWithName:storyboardName bundle:nil] instantiateInitialViewController]; | |
} | |
/** | |
* UIColor (Macro) | |
*/ | |
#define RGB(r, g, b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1.0f] | |
#define RGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:a] | |
/** | |
* switch (Macro) | |
*/ | |
#define CASE(str) if ([__s__ isEqualToString:(str)]) | |
#define SWITCH_BY_STRING(s) for (NSString *__s__ = (s); ; ) | |
#define DEFAULT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment