Skip to content

Instantly share code, notes, and snippets.

@bright23
Created November 29, 2016 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bright23/ff63106d4cd687aa874fdc9de3334d24 to your computer and use it in GitHub Desktop.
Save bright23/ff63106d4cd687aa874fdc9de3334d24 to your computer and use it in GitHub Desktop.
/**
* 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