diff options
author | BrettyWhite <geekman3454@protonmail.com> | 2017-07-21 09:18:54 -0400 |
---|---|---|
committer | BrettyWhite <geekman3454@protonmail.com> | 2017-07-21 09:18:54 -0400 |
commit | 9134036503de44a2e8d3b65a7c842ed80ef9d573 (patch) | |
tree | 603eb99855efb3cfc378477c64662a7c2eecc904 | |
parent | edfa9bf229b7e14bed055fbeee70664c24d64b39 (diff) | |
download | sdl_ios-9134036503de44a2e8d3b65a7c842ed80ef9d573.tar.gz |
added in old function w/ deprecation
-rw-r--r-- | SmartDeviceLink/SDLSyncMsgVersion.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSyncMsgVersion.m | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLSyncMsgVersion.h b/SmartDeviceLink/SDLSyncMsgVersion.h index abfacf5c5..72c2b5f9e 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.h +++ b/SmartDeviceLink/SDLSyncMsgVersion.h @@ -24,6 +24,8 @@ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; // TODO: (Alex M.)[2016-12-1] Change from NSInteger to UInt8 +- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion __deprecated_msg("Include patchVersion"); + - (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion patchVersion:(NSInteger)patchVersion; /** diff --git a/SmartDeviceLink/SDLSyncMsgVersion.m b/SmartDeviceLink/SDLSyncMsgVersion.m index 94d33487a..8ef8b7cd3 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.m +++ b/SmartDeviceLink/SDLSyncMsgVersion.m @@ -20,6 +20,19 @@ return self; } +- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion { + self = [self init]; + if (!self) { + return nil; + } + + self.majorVersion = @(majorVersion); + self.minorVersion = @(minorVersion); + self.patchVersion = @(0); + + return self; +} + - (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion patchVersion:(NSInteger)patchVersion { self = [self init]; if (!self) { @@ -70,6 +83,6 @@ } - (NSString *)description { - return [NSString stringWithFormat:@"%@.%@", self.majorVersion, self.minorVersion]; + return [NSString stringWithFormat:@"%@.%@.%@", self.majorVersion, self.minorVersion, self.patchVersion]; } @end |