Adds cocoapods for libraries.

Adds OCMockito and OCHamcrest libs.
This commit is contained in:
2020-09-05 22:06:51 -07:00
parent f688898d96
commit bab5a55c3b
364 changed files with 17147 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
#import "HCRunloopRunner.h"
@implementation HCRunloopRunner
{
CFRunLoopObserverRef _observer;
}
- (instancetype)initWithFulfillmentBlock:(BOOL (^)(void))fulfillmentBlock
{
self = [super init];
if (self)
{
_observer = CFRunLoopObserverCreateWithHandler(NULL, kCFRunLoopBeforeWaiting, YES, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) {
if (fulfillmentBlock())
CFRunLoopStop(CFRunLoopGetCurrent());
else
CFRunLoopWakeUp(CFRunLoopGetCurrent());
});
CFRunLoopAddObserver(CFRunLoopGetCurrent(), _observer, kCFRunLoopDefaultMode);
}
return self;
}
- (void)dealloc
{
CFRunLoopRemoveObserver(CFRunLoopGetCurrent(), _observer, kCFRunLoopDefaultMode);
CFRelease(_observer);
}
- (void)runUntilFulfilledOrTimeout:(CFTimeInterval)timeout
{
CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeout, false);
}
@end