Skip to content

Instantly share code, notes, and snippets.

View RbBtSn0w's full-sized avatar
💭
I may be slow to respond.

Hamilton Snow RbBtSn0w

💭
I may be slow to respond.
View GitHub Profile
@RbBtSn0w
RbBtSn0w / iflet.m
Created August 14, 2019 03:18 — forked from CraigSiemens/iflet.m
if-let and guard macros for Objective C
#import <Foundation/Foundation.h>
// VARIABLE must be a variable declaration (NSString *foo)
// VALUE is what you are checking is not nil
// WHERE is an additional BOOL condition
#define iflet(VARIABLE, VALUE) \
ifletwhere(VARIABLE, VALUE, YES)
#define ifletwhere(VARIABLE, VALUE, WHERE) \