diff options
author | lapinskijw <jlapinski.dev@gmail.com> | 2020-05-05 12:00:14 -0400 |
---|---|---|
committer | lapinskijw <jlapinski.dev@gmail.com> | 2020-05-05 12:00:14 -0400 |
commit | a5337731e4c07590b22761ea382e9fcb9a8080b7 (patch) | |
tree | b7fdf4dcd8a7443cbd792b47642ae8f5fad7e598 | |
parent | eacb44fd09ca3148d6b1f9713d947d1ae7ab9cf9 (diff) | |
download | sdl_ios-a5337731e4c07590b22761ea382e9fcb9a8080b7.tar.gz |
added back old initializer and deprecated it
-rw-r--r-- | SmartDeviceLink/SDLButtonPress.h | 11 | ||||
-rw-r--r-- | SmartDeviceLink/SDLButtonPress.m | 13 |
2 files changed, 24 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLButtonPress.h b/SmartDeviceLink/SDLButtonPress.h index f22d870fe..c5769ca6d 100644 --- a/SmartDeviceLink/SDLButtonPress.h +++ b/SmartDeviceLink/SDLButtonPress.h @@ -32,6 +32,17 @@ Constructs a newly allocated SDLButtonPress object with the given parameters @param buttonName the name of the button @param moduleType the module where the button should be pressed @param moduleId the id of the module + +@return An instance of the SDLButtonPress class. +*/ +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId __deprecated_msg(("Use initWithButtonName:moduleType:moduleId:buttonPressMode: instead"));; + +/** +Constructs a newly allocated SDLButtonPress object with the given parameters + +@param buttonName the name of the button +@param moduleType the module where the button should be pressed +@param moduleId the id of the module @param buttonPressMode indicates LONG or SHORT button press event @return An instance of the SDLButtonPress class. diff --git a/SmartDeviceLink/SDLButtonPress.m b/SmartDeviceLink/SDLButtonPress.m index 4feb9a73f..419f0d7f6 100644 --- a/SmartDeviceLink/SDLButtonPress.m +++ b/SmartDeviceLink/SDLButtonPress.m @@ -32,6 +32,19 @@ NS_ASSUME_NONNULL_BEGIN return self; } +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId { + self = [self init]; + if (!self) { + return nil; + } + + self.buttonName = buttonName; + self.moduleType = moduleType; + self.moduleId = moduleId; + + return self; +} + - (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId buttonPressMode:(SDLButtonPressMode)buttonPressMode { self = [self init]; if (!self) { |