diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2016-10-24 11:32:16 -0600 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2016-10-24 11:32:16 -0600 |
commit | 02007d34a9bf3aa5fbbe08f6355a7ea6ea7f1303 (patch) | |
tree | 61e6b0e9a860a970071b44031b4e9976dceac9cf /SmartDeviceLink | |
parent | 588e2d0b57d83680a159ef0fc8a7cc00255c6ef8 (diff) | |
download | sdl_ios-02007d34a9bf3aa5fbbe08f6355a7ea6ea7f1303.tar.gz |
Added missing generics and removed remaining NSNumbers used in initializers
Diffstat (limited to 'SmartDeviceLink')
-rw-r--r-- | SmartDeviceLink/SDLAddCommand.m | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAddSubMenu.h | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAddSubMenu.m | 18 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAlert.h | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAlert.m | 8 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAlertManeuver.m | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLPerformInteraction.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLPermissionConstants.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRPCRequestFactory.h | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRPCRequestFactory.m | 10 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRegisterAppInterface.h | 3 | ||||
-rw-r--r-- | SmartDeviceLink/SDLScrollableMessage.h | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLScrollableMessage.m | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLShow.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLShow.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLShowConstantTBT.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSlider.h | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSlider.m | 20 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSpeak.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLUpdateTurnList.m | 2 |
20 files changed, 71 insertions, 45 deletions
diff --git a/SmartDeviceLink/SDLAddCommand.m b/SmartDeviceLink/SDLAddCommand.m index 3ed0672bc..72eee7f41 100644 --- a/SmartDeviceLink/SDLAddCommand.m +++ b/SmartDeviceLink/SDLAddCommand.m @@ -34,11 +34,11 @@ return self; } -- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray *)vrCommands handler:(SDLRPCNotificationHandler)handler { +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands handler:(SDLRPCNotificationHandler)handler { return [self initWithId:commandId vrCommands:vrCommands menuName:nil handler:handler]; } -- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCNotificationHandler)handler { +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCNotificationHandler)handler { self = [self init]; if (!self) { return nil; @@ -57,7 +57,7 @@ } -- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType *)iconType handler:(SDLRPCNotificationHandler)handler { +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType *)iconType handler:(SDLRPCNotificationHandler)handler { self = [self initWithId:commandId vrCommands:vrCommands menuName:menuName handler:handler]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLAddSubMenu.h b/SmartDeviceLink/SDLAddSubMenu.h index 3285da168..94577ba68 100644 --- a/SmartDeviceLink/SDLAddSubMenu.h +++ b/SmartDeviceLink/SDLAddSubMenu.h @@ -31,9 +31,9 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; -- (instancetype)initWithId:(NSNumber<SDLInt> *)menuId menuName:(NSString *)menuName; +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName; -- (instancetype)initWithId:(NSNumber<SDLInt> *)menuId menuName:(NSString *)menuName position:(NSNumber *)position; +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName position:(UInt8)position; /** * @abstract a Menu ID that identifies a sub menu diff --git a/SmartDeviceLink/SDLAddSubMenu.m b/SmartDeviceLink/SDLAddSubMenu.m index f30a23c16..983325dee 100644 --- a/SmartDeviceLink/SDLAddSubMenu.m +++ b/SmartDeviceLink/SDLAddSubMenu.m @@ -18,21 +18,29 @@ return self; } -- (instancetype)initWithId:(NSNumber *)menuId menuName:(NSString *)menuName { - return [self initWithId:menuId menuName:menuName position:nil]; + +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName position:(UInt8)position { + self = [self initWithId:menuId menuName:menuName]; + if (!self) { + return nil; + } + + self.position = @(position); + + return self; } -- (instancetype)initWithId:(NSNumber *)menuId menuName:(NSString *)menuName position:(NSNumber *)position { +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName { self = [self init]; if (!self) { return nil; } - self.menuID = menuId; + self.menuID = @(menuId); self.menuName = menuName; - self.position = position; return self; + } - (void)setMenuID:(NSNumber *)menuID { diff --git a/SmartDeviceLink/SDLAlert.h b/SmartDeviceLink/SDLAlert.h index 068e1a67b..303c8b439 100644 --- a/SmartDeviceLink/SDLAlert.h +++ b/SmartDeviceLink/SDLAlert.h @@ -66,9 +66,9 @@ - (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone; -- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone softButtons:(NSArray *)softButtons; +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone softButtons:(NSArray<SDLSoftButton *> *)softButtons; -- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(NSArray *)softButtons; +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons; /** diff --git a/SmartDeviceLink/SDLAlert.m b/SmartDeviceLink/SDLAlert.m index e325c0811..4c6110e21 100644 --- a/SmartDeviceLink/SDLAlert.m +++ b/SmartDeviceLink/SDLAlert.m @@ -35,7 +35,7 @@ static UInt16 const SDLDefaultDuration = 5000; return [self initWithAlertText1:alertText1 alertText2:alertText2 alertText3:alertText3 duration:duration softButtons:nil]; } -- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(UInt16)duration softButtons:(NSArray *)softButtons { +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(UInt16)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons { return [self initWithTTSChunks:nil alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:NO duration:duration softButtons:softButtons]; } @@ -52,15 +52,15 @@ static UInt16 const SDLDefaultDuration = 5000; return [self initWithTTSChunks:ttsChunks alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:playTone duration:duration softButtons:nil]; } -- (instancetype)initWithTTSChunks:(NSArray *)ttsChunks playTone:(BOOL)playTone { +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone { return [self initWithTTSChunks:ttsChunks alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:SDLDefaultDuration softButtons:nil]; } -- (instancetype)initWithTTSChunks:(NSArray *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone softButtons:(NSArray *)softButtons { +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone softButtons:(NSArray<SDLSoftButton *> *)softButtons { return [self initWithTTSChunks:ttsChunks alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:playTone duration:SDLDefaultDuration softButtons:softButtons]; } -- (instancetype)initWithTTSChunks:(NSArray *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(NSArray *)softButtons { +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLAlertManeuver.m b/SmartDeviceLink/SDLAlertManeuver.m index ab29bde16..0bda5acaf 100644 --- a/SmartDeviceLink/SDLAlertManeuver.m +++ b/SmartDeviceLink/SDLAlertManeuver.m @@ -23,12 +23,12 @@ return self; } -- (instancetype)initWithTTS:(NSString *)ttsText softButtons:(NSArray *)softButtons { +- (instancetype)initWithTTS:(NSString *)ttsText softButtons:(NSArray<SDLSoftButton *> *)softButtons { NSMutableArray* ttsChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:ttsText]; return [self initWithTTSChunks:ttsChunks softButtons:softButtons]; } -- (instancetype)initWithTTSChunks:(NSArray *)ttsChunks softButtons:(NSArray *)softButtons { +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks softButtons:(NSArray<SDLSoftButton *> *)softButtons { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLPerformInteraction.h b/SmartDeviceLink/SDLPerformInteraction.h index a85c9b7ad..d023c3a73 100644 --- a/SmartDeviceLink/SDLPerformInteraction.h +++ b/SmartDeviceLink/SDLPerformInteraction.h @@ -6,6 +6,7 @@ @class SDLInteractionMode; @class SDLLayoutMode; +@class SDLTTSChunk; @class SDLVRHelpItem; diff --git a/SmartDeviceLink/SDLPermissionConstants.h b/SmartDeviceLink/SDLPermissionConstants.h index 73d8bf0bb..d5e0250b0 100644 --- a/SmartDeviceLink/SDLPermissionConstants.h +++ b/SmartDeviceLink/SDLPermissionConstants.h @@ -8,6 +8,7 @@ #import <Foundation/Foundation.h> +#import "NSNumber+NumberType.h" NS_ASSUME_NONNULL_BEGIN diff --git a/SmartDeviceLink/SDLRPCRequestFactory.h b/SmartDeviceLink/SDLRPCRequestFactory.h index afd33602e..fce7c64e8 100644 --- a/SmartDeviceLink/SDLRPCRequestFactory.h +++ b/SmartDeviceLink/SDLRPCRequestFactory.h @@ -52,6 +52,7 @@ @class SDLSubscribeVehicleData; @class SDLSystemAction; @class SDLTextAlignment; +@class SDLTTSChunk; @class SDLUnregisterAppInterface; @class SDLUnsubscribeButton; @class SDLUnsubscribeVehicleData; @@ -93,12 +94,12 @@ __deprecated_msg("use class's initializers instead") @interface SDLRPCRequestFac + (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTS:playTone:duration: instead"); //*** -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons: instead"); ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons: instead"); -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:playTone: instead"); ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:playTone: instead"); //*** -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber *)duration softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:alertText3:duration:softButtons: instead"); ++ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:alertText3:duration:softButtons: instead"); + (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:alertText3:duration: instead"); @@ -162,7 +163,7 @@ __deprecated_msg("use class's initializers instead") @interface SDLRPCRequestFac + (SDLSendLocation *)buildSendLocationWithLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude locationName:(NSString *)locationName locationDescription:(NSString *)locationDescription address:(NSArray *)address phoneNumber:(NSString *)phoneNumber image:(SDLImage *)image __deprecated_msg("use SDLSendLocation's initWithLongitude:latitude:locationName:locationDescription:address:phoneNumber:image: instead"); -+ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber *)timeout softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLScrollableMessage's initWithMessage:timeout:softButtons: instead"); ++ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber *)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLScrollableMessage's initWithMessage:timeout:softButtons: instead"); + (SDLSetAppIcon *)buildSetAppIconWithFileName:(NSString *)syncFileName correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSetAppIcon's initWithFileName: instead"); @@ -184,7 +185,7 @@ __deprecated_msg("use class's initializers instead") @interface SDLRPCRequestFac //***** Show ***** -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment *)textAlignment graphic:(SDLImage *)graphic softButtons:(NSArray *)softButtons customPresets:(NSArray *)customPresets correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLShow's initWithMainField1:mainField2:mainField3:mainField4:alignment:statusBar:mediaClock:mediaTrack:graphic:softButtons:customPresets: instead"); ++ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment *)textAlignment graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray *)customPresets correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLShow's initWithMainField1:mainField2:mainField3:mainField4:alignment:statusBar:mediaClock:mediaTrack:graphic:softButtons:customPresets: instead"); + (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment *)textAlignment correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLShow's initWithMainField1:mainField2:alignment:statusBar:mediaClock:mediaTrack: instead"); @@ -201,7 +202,7 @@ __deprecated_msg("use class's initializers instead") @interface SDLRPCRequestFac + (SDLSoftButton *)buildSoftButtonWithType:(SDLSoftButtonType *)type text:(NSString *)text image:(SDLImage *)image highlighted:(BOOL)highlighted buttonID:(UInt16)buttonID systemAction:(SDLSystemAction *)systemAction handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLSoftButton's initWithType:text:image:highlighted:buttonId:systemAction:handler: instead"); //***** Speak ***** -+ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray *)ttsChunks correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSpeak's initWithTTSChunks: instead"); ++ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSpeak's initWithTTSChunks: instead"); //*** + (SDLSpeak *)buildSpeakWithTTS:(NSString *)ttsText correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSpeak's initWithTTS: instead"); diff --git a/SmartDeviceLink/SDLRPCRequestFactory.m b/SmartDeviceLink/SDLRPCRequestFactory.m index 0d94c5a39..4424cea9c 100644 --- a/SmartDeviceLink/SDLRPCRequestFactory.m +++ b/SmartDeviceLink/SDLRPCRequestFactory.m @@ -167,7 +167,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt } //*** -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID { ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID { SDLAlert *msg = [[SDLAlert alloc] init]; msg.correlationID = correlationID; msg.alertText1 = alertText1; @@ -180,7 +180,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt return msg; } -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID { ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID { return [SDLRPCRequestFactory buildAlertWithTTSChunks:ttsChunks alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:nil softButtons:nil correlationID:correlationID]; } @@ -460,7 +460,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt return msg; } -+ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber *)timeout softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID { ++ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber *)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID { SDLScrollableMessage *msg = [[SDLScrollableMessage alloc] init]; msg.scrollableMessageBody = scrollableMessageBody; msg.timeout = timeout; @@ -548,7 +548,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt //***** Show ***** -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment *)textAlignment graphic:(SDLImage *)graphic softButtons:(NSArray *)softButtons customPresets:(NSArray *)customPresets correlationID:(NSNumber *)correlationID { ++ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment *)textAlignment graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray *)customPresets correlationID:(NSNumber *)correlationID { SDLShow *msg = [[SDLShow alloc] init]; msg.correlationID = correlationID; msg.mainField1 = mainField1; @@ -642,7 +642,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt //***** Speak ***** -+ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray *)ttsChunks correlationID:(NSNumber *)correlationID { ++ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks correlationID:(NSNumber *)correlationID { SDLSpeak *msg = [[SDLSpeak alloc] init]; msg.correlationID = correlationID; msg.ttsChunks = [ttsChunks mutableCopy]; diff --git a/SmartDeviceLink/SDLRegisterAppInterface.h b/SmartDeviceLink/SDLRegisterAppInterface.h index 6f9e3eb76..3c4093d2d 100644 --- a/SmartDeviceLink/SDLRegisterAppInterface.h +++ b/SmartDeviceLink/SDLRegisterAppInterface.h @@ -3,11 +3,12 @@ #import "SDLRPCRequest.h" +@class SDLAppInfo; @class SDLDeviceInfo; @class SDLLanguage; @class SDLLifecycleConfiguration; @class SDLSyncMsgVersion; -@class SDLAppInfo; +@class SDLTTSChunk; /** * Registers the application's interface with SDL®, declaring properties of diff --git a/SmartDeviceLink/SDLScrollableMessage.h b/SmartDeviceLink/SDLScrollableMessage.h index 3087b2dc9..3a1fe8415 100644 --- a/SmartDeviceLink/SDLScrollableMessage.h +++ b/SmartDeviceLink/SDLScrollableMessage.h @@ -4,6 +4,8 @@ #import "SDLRPCRequest.h" +@class SDLSoftButton; + /** * Creates a full screen overlay containing a large block of formatted text that * can be scrolled with up to 8 SoftButtons defined @@ -29,7 +31,7 @@ - (instancetype)initWithMessage:(NSString *)message; -- (instancetype)initWithMessage:(NSString *)message timeout:(NSNumber *)timeout softButtons:(NSArray *)softButtons; +- (instancetype)initWithMessage:(NSString *)message timeout:(UInt16)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons; /** * @abstract A Body of text that can include newlines and tabs diff --git a/SmartDeviceLink/SDLScrollableMessage.m b/SmartDeviceLink/SDLScrollableMessage.m index 1aa74807a..ada0d0a98 100644 --- a/SmartDeviceLink/SDLScrollableMessage.m +++ b/SmartDeviceLink/SDLScrollableMessage.m @@ -21,13 +21,13 @@ return self; } -- (instancetype)initWithMessage:(NSString *)message timeout:(NSNumber *)timeout softButtons:(NSArray *)softButtons { +- (instancetype)initWithMessage:(NSString *)message timeout:(UInt16)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons { self = [self initWithMessage:message]; if (!self) { return nil; } - self.timeout = timeout; + self.timeout = @(timeout); self.softButtons = [softButtons mutableCopy]; return self; diff --git a/SmartDeviceLink/SDLShow.h b/SmartDeviceLink/SDLShow.h index ce375038d..c692bd84c 100644 --- a/SmartDeviceLink/SDLShow.h +++ b/SmartDeviceLink/SDLShow.h @@ -49,7 +49,7 @@ - (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack; -- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray *)customPresets; +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray<NSString *> *)customPresets; /** diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m index e4b1a67fa..a6edbdf09 100644 --- a/SmartDeviceLink/SDLShow.m +++ b/SmartDeviceLink/SDLShow.m @@ -36,7 +36,7 @@ return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:nil mainField4:nil alignment:alignment statusBar:statusBar mediaClock:mediaClock mediaTrack:mediaTrack graphic:nil softButtons:nil customPresets:nil]; } -- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack graphic:(SDLImage *)graphic softButtons:(NSArray *)softButtons customPresets:(NSArray *)customPresets { +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray<NSString *> *)customPresets { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLShowConstantTBT.m b/SmartDeviceLink/SDLShowConstantTBT.m index 9ac4de89c..0e021d831 100644 --- a/SmartDeviceLink/SDLShowConstantTBT.m +++ b/SmartDeviceLink/SDLShowConstantTBT.m @@ -23,7 +23,7 @@ return self; } -- (instancetype)initWithNavigationText1:(NSString *)navigationText1 navigationText2:(NSString *)navigationText2 eta:(NSString *)eta timeToDestination:(NSString *)timeToDestination totalDistance:(NSString *)totalDistance turnIcon:(SDLImage *)turnIcon nextTurnIcon:(SDLImage *)nextTurnIcon distanceToManeuver:(CGFloat)distanceToManeuver distanceToManeuverScale:(CGFloat)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(NSArray *)softButtons { +- (instancetype)initWithNavigationText1:(NSString *)navigationText1 navigationText2:(NSString *)navigationText2 eta:(NSString *)eta timeToDestination:(NSString *)timeToDestination totalDistance:(NSString *)totalDistance turnIcon:(SDLImage *)turnIcon nextTurnIcon:(SDLImage *)nextTurnIcon distanceToManeuver:(CGFloat)distanceToManeuver distanceToManeuverScale:(CGFloat)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(NSArray<SDLSoftButton *> *)softButtons { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLSlider.h b/SmartDeviceLink/SDLSlider.h index b81f6adec..1c4e074de 100644 --- a/SmartDeviceLink/SDLSlider.h +++ b/SmartDeviceLink/SDLSlider.h @@ -25,9 +25,11 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(NSNumber *)timeout; +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position; -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(NSArray *)sliderFooters timeout:(NSNumber *)timeout; +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(UInt16)timeout; + +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(NSArray *)sliderFooters timeout:(UInt16)timeout; /** * @abstract Represents a number of selectable items on a horizontal axis diff --git a/SmartDeviceLink/SDLSlider.m b/SmartDeviceLink/SDLSlider.m index 0ac38edc0..b94a16b3e 100644 --- a/SmartDeviceLink/SDLSlider.m +++ b/SmartDeviceLink/SDLSlider.m @@ -20,7 +20,7 @@ return self; } -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(NSNumber *)timeout { +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(UInt16)timeout { NSMutableArray *sliderFooters = [NSMutableArray arrayWithCapacity:numTicks]; // Populates array with the same footer value for each position @@ -31,7 +31,20 @@ return [self initWithNumTicks:numTicks position:position sliderHeader:sliderHeader sliderFooter:[sliderFooters copy] timeout:timeout]; } -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(NSArray *)sliderFooters timeout:(NSNumber *)timeout { +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(NSArray *)sliderFooters timeout:(UInt16)timeout { + self = [self initWithNumTicks:numTicks position:position]; + if (!self) { + return nil; + } + + self.sliderHeader = sliderHeader; + self.sliderFooter = [sliderFooters mutableCopy]; + self.timeout = @(timeout); + + return self; +} + +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position { self = [self init]; if (!self) { return nil; @@ -39,9 +52,6 @@ self.numTicks = @(numTicks); self.position = @(position); - self.sliderHeader = sliderHeader; - self.sliderFooter = [sliderFooters mutableCopy]; - self.timeout = timeout; return self; } diff --git a/SmartDeviceLink/SDLSpeak.m b/SmartDeviceLink/SDLSpeak.m index 60eaa1380..deefde886 100644 --- a/SmartDeviceLink/SDLSpeak.m +++ b/SmartDeviceLink/SDLSpeak.m @@ -27,7 +27,7 @@ return [self initWithTTSChunks:ttsChunks]; } -- (instancetype)initWithTTSChunks:(NSArray *)ttsChunks { +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLUpdateTurnList.m b/SmartDeviceLink/SDLUpdateTurnList.m index f615faa81..65cb06fb0 100644 --- a/SmartDeviceLink/SDLUpdateTurnList.m +++ b/SmartDeviceLink/SDLUpdateTurnList.m @@ -22,7 +22,7 @@ return self; } -- (instancetype)initWithTurnList:(NSArray *)turnList softButtons:(NSArray *)softButtons { +- (instancetype)initWithTurnList:(NSArray *)turnList softButtons:(NSArray<SDLSoftButton *> *)softButtons { self = [self init]; if (!self) { return nil; |