summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Gluck <justin.gluck@livio.io>2019-09-26 13:20:33 -0400
committerJustin Gluck <justin.gluck@livio.io>2019-09-26 13:20:33 -0400
commit210f6212597a42c1eb88b3bb4ab2b650b02208d7 (patch)
tree7d70573f2f329d76cab2dece86a3aa22f1836171
parentb962a21d9d2e6901a8461c00dc2773a422904cf4 (diff)
downloadsdl_ios-210f6212597a42c1eb88b3bb4ab2b650b02208d7.tar.gz
changing inits to class methods to fix swift formatting issues
-rw-r--r--SmartDeviceLink/SDLCancelInteraction.h8
-rw-r--r--SmartDeviceLink/SDLCancelInteraction.m16
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCancelInteractionSpec.m16
3 files changed, 20 insertions, 20 deletions
diff --git a/SmartDeviceLink/SDLCancelInteraction.h b/SmartDeviceLink/SDLCancelInteraction.h
index f545b2df9..ee7e0f2ca 100644
--- a/SmartDeviceLink/SDLCancelInteraction.h
+++ b/SmartDeviceLink/SDLCancelInteraction.h
@@ -71,28 +71,28 @@ NS_ASSUME_NONNULL_BEGIN
@return A SDLCancelInteraction object
*/
-- (instancetype)initWithAlert;
++ (instancetype)alert;
/**
Convenience init for dismissing the currently presented slider.
@return A SDLCancelInteraction object
*/
-- (instancetype)initWithSlider;
++ (instancetype)slider;
/**
Convenience init for dismissing the currently presented scrollable message.
@return A SDLCancelInteraction object
*/
-- (instancetype)initWithScrollableMessage;
++ (instancetype)scrollableMessage;
/**
Convenience init for dismissing the currently presented perform interaction.
@return A SDLCancelInteraction object
*/
-- (instancetype)initWithPerformInteraction;
++ (instancetype)performInteraction;
/**
The ID of the specific interaction to dismiss. If not set, the most recent of the RPC type set in functionID will be dismissed.
diff --git a/SmartDeviceLink/SDLCancelInteraction.m b/SmartDeviceLink/SDLCancelInteraction.m
index 31a9ae613..40de4fbef 100644
--- a/SmartDeviceLink/SDLCancelInteraction.m
+++ b/SmartDeviceLink/SDLCancelInteraction.m
@@ -65,20 +65,20 @@ NS_ASSUME_NONNULL_BEGIN
return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction].unsignedIntValue cancelID:cancelID];
}
-- (instancetype)initWithAlert {
- return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAlert].unsignedIntValue];
++ (instancetype)alert {
+ return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAlert].unsignedIntValue];
}
-- (instancetype)initWithSlider {
- return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSlider].unsignedIntValue];
++ (instancetype)slider {
+ return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSlider].unsignedIntValue];
}
-- (instancetype)initWithScrollableMessage {
- return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameScrollableMessage].unsignedIntValue];
++ (instancetype)scrollableMessage {
+ return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameScrollableMessage].unsignedIntValue];
}
-- (instancetype)initWithPerformInteraction {
- return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction].unsignedIntValue];
++ (instancetype)performInteraction {
+ return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction].unsignedIntValue];
}
- (void)setCancelID:(nullable NSNumber<SDLInt> *)cancelID {
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCancelInteractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCancelInteractionSpec.m
index 63bcce755..c36c5de29 100644
--- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCancelInteractionSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCancelInteractionSpec.m
@@ -103,29 +103,29 @@ describe(@"Getter/Setter Tests", ^{
expect(testRequest.cancelID).to(equal(testCancelID));
});
- it(@"Should initialize correctly with initWithAlert:", ^{
- testRequest = [[SDLCancelInteraction alloc] initWithAlert];
+ it(@"Should initialize correctly with alert:", ^{
+ testRequest = [SDLCancelInteraction alert];
expect(testRequest.functionID).to(equal([SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAlert]));
expect(testRequest.cancelID).to(beNil());
});
- it(@"Should initialize correctly with initWithSlider:", ^{
- testRequest = [[SDLCancelInteraction alloc] initWithSlider];
+ it(@"Should initialize correctly with slider:", ^{
+ testRequest = [SDLCancelInteraction slider];
expect(testRequest.functionID).to(equal([SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSlider]));
expect(testRequest.cancelID).to(beNil());
});
- it(@"Should initialize correctly with initWithScrollableMessage:", ^{
- testRequest = [[SDLCancelInteraction alloc] initWithScrollableMessage];
+ it(@"Should initialize correctly with scrollableMessage:", ^{
+ testRequest = [SDLCancelInteraction scrollableMessage];
expect(testRequest.functionID).to(equal([SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameScrollableMessage]));
expect(testRequest.cancelID).to(beNil());
});
- it(@"Should initialize correctly with initWithPerformInteraction:", ^{
- testRequest = [[SDLCancelInteraction alloc] initWithPerformInteraction];
+ it(@"Should initialize correctly with performInteraction:", ^{
+ testRequest = [SDLCancelInteraction performInteraction];
expect(testRequest.functionID).to(equal([SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction]));
expect(testRequest.cancelID).to(beNil());