diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
commit | fb8e9903a323acaf5fc78819bb3c203567542ab2 (patch) | |
tree | e40665103ac7db492e0a40e34cd92f3390defa55 /SmartDeviceLink/SDLInteractionMode.m | |
parent | f7540a02262832e34c67b0953dd8a1804a046fea (diff) | |
download | sdl_ios-fb8e9903a323acaf5fc78819bb3c203567542ab2.tar.gz |
Shift files into root directory
Diffstat (limited to 'SmartDeviceLink/SDLInteractionMode.m')
-rw-r--r-- | SmartDeviceLink/SDLInteractionMode.m | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLInteractionMode.m b/SmartDeviceLink/SDLInteractionMode.m new file mode 100644 index 000000000..07dc5f7b2 --- /dev/null +++ b/SmartDeviceLink/SDLInteractionMode.m @@ -0,0 +1,56 @@ +// SDLInteractionMode.m +// + + +#import "SDLInteractionMode.h" + +SDLInteractionMode *SDLInteractionMode_MANUAL_ONLY = nil; +SDLInteractionMode *SDLInteractionMode_VR_ONLY = nil; +SDLInteractionMode *SDLInteractionMode_BOTH = nil; + +NSArray *SDLInteractionMode_values = nil; + +@implementation SDLInteractionMode + ++ (SDLInteractionMode *)valueOf:(NSString *)value { + for (SDLInteractionMode *item in SDLInteractionMode.values) { + if ([item.value isEqualToString:value]) { + return item; + } + } + return nil; +} + ++ (NSArray *)values { + if (SDLInteractionMode_values == nil) { + SDLInteractionMode_values = @[ + SDLInteractionMode.MANUAL_ONLY, + SDLInteractionMode.VR_ONLY, + SDLInteractionMode.BOTH, + ]; + } + return SDLInteractionMode_values; +} + ++ (SDLInteractionMode *)MANUAL_ONLY { + if (SDLInteractionMode_MANUAL_ONLY == nil) { + SDLInteractionMode_MANUAL_ONLY = [[SDLInteractionMode alloc] initWithValue:@"MANUAL_ONLY"]; + } + return SDLInteractionMode_MANUAL_ONLY; +} + ++ (SDLInteractionMode *)VR_ONLY { + if (SDLInteractionMode_VR_ONLY == nil) { + SDLInteractionMode_VR_ONLY = [[SDLInteractionMode alloc] initWithValue:@"VR_ONLY"]; + } + return SDLInteractionMode_VR_ONLY; +} + ++ (SDLInteractionMode *)BOTH { + if (SDLInteractionMode_BOTH == nil) { + SDLInteractionMode_BOTH = [[SDLInteractionMode alloc] initWithValue:@"BOTH"]; + } + return SDLInteractionMode_BOTH; +} + +@end |