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) \
@RbBtSn0w
RbBtSn0w / RBSComboTask
Created January 10, 2018 03:33
Obj-C delay send message.
@interface RBSComboTask : NSObject
{
@private
dispatch_block_t _handlerBlock;
BOOL _waitingTask;
}
- (void)performDelay:(NSTimeInterval)time handlerBlock:(nonnull dispatch_block_t)handlerBlock;
- (void)stopCallCompletionIfNecessary:(BOOL)callCompletion;
@end
@implementation RBSComboTask