// // SDLAsychronousOperation.m // SmartDeviceLink-iOS // // Created by Joel Fischer on 8/25/16. // Copyright © 2016 smartdevicelink. All rights reserved. // #import "SDLAsynchronousOperation.h" @implementation SDLAsynchronousOperation { BOOL executing; BOOL finished; } - (void)start { if (self.isCancelled) { [self willChangeValueForKey:@"isFinished"]; finished = YES; [self didChangeValueForKey:@"isFinished"]; return; } [self willChangeValueForKey:@"isExecuting"]; executing = YES; [self didChangeValueForKey:@"isExecuting"]; } - (void)finishOperation { [self willChangeValueForKey:@"isExecuting"]; [self willChangeValueForKey:@"isFinished"]; executing = NO; finished = YES; [self didChangeValueForKey:@"isFinished"]; [self didChangeValueForKey:@"isExecuting"]; } #pragma mark - Property Overrides - (BOOL)isAsynchronous { return YES; } - (BOOL)isExecuting { return executing; } - (BOOL)isFinished { return finished; } @end