Sha256: 6dfb9caaeffa41e30cd9299b6282f75b5d317746d94917428e2631fa9d94f2d8
Contents?: true
Size: 899 Bytes
Versions: 17
Compression:
Stored size: 899 Bytes
Contents
#import "SensorSingleton.h" #import "SensorFactory.h" @implementation SensorSingleton -(void) makeSensorByType:(NSString*)type methodResult:(id<IMethodResult>)methodResult { if ([SENSOR_TYPE_ACCELEROMETER isEqualToString:type] && [SensorFactory isAccelerometerSupported]) { [methodResult setResult:SENSOR_TYPE_ACCELEROMETER]; } if ([SENSOR_TYPE_MAGNETOMETER isEqualToString:type] && [SensorFactory isMagnetometerSupported]) { [methodResult setResult:SENSOR_TYPE_MAGNETOMETER]; } } -(void) enumerate:(id<IMethodResult>)methodResult { NSMutableArray* list = [NSMutableArray arrayWithCapacity:2]; if ([SensorFactory isAccelerometerSupported]) { [list addObject:SENSOR_TYPE_ACCELEROMETER]; } if ([SensorFactory isMagnetometerSupported]) { [list addObject:SENSOR_TYPE_MAGNETOMETER]; } [methodResult setResult:list]; } @end
Version data entries
17 entries across 17 versions & 2 rubygems