Skip to content

Instantly share code, notes, and snippets.

@mhuusko5
mhuusko5 / iflet.m
Created November 12, 2015 18:37 — 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) \