Skip to content

Instantly share code, notes, and snippets.

@Raztor0
Created April 13, 2017 23:22
Show Gist options
  • Save Raztor0/77dc35605c67d10f63e1e03e2366ab85 to your computer and use it in GitHub Desktop.
Save Raztor0/77dc35605c67d10f63e1e03e2366ab85 to your computer and use it in GitHub Desktop.
#ifdef CONFIG_DEBUG
static inline id _SKNonnullScreenGlobalForKey(id self, SEL _cmd, SKScreenGlobals * aGlobals, NSString * key) {
NSParameterAssert(self != nil);
NSParameterAssert(_cmd != NULL);
NSParameterAssert(aGlobals != nil);
NSParameterAssert(key != nil);
id object = [aGlobals objectForKey:key];
NSAssert(object != nil, @"%@ expects the screen global for key %@ to be set.", NSStringFromClass([self class]), key);
return object;
}
#define SKNonnullScreenGlobalForKey(key) _SKNonnullScreenGlobalForKey(self, _cmd, aGlobals, key)
#else
#define SKNonnullScreenGlobalForKey(key) [aGlobals objectForKey:key]
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment