diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2019-07-31 13:05:00 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2019-07-31 13:05:00 -0400 |
commit | ce66fa5c090713938921c7cacf1a690bdceaf3d1 (patch) | |
tree | d86e565f497324d41d581a59bb6cfd9b0ad3d337 | |
parent | 6b896946693cd6a7efc5c5afd678c6cadebf8638 (diff) | |
download | sdl_ios-feature/issue-995-alert-icon.tar.gz |
Review fixesfeature/issue-995-alert-icon
-rw-r--r-- | Example Apps/Example ObjC/AlertManager.m | 11 | ||||
-rw-r--r-- | Example Apps/Example Swift/AlertManager.swift | 1 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/Example Apps/Example ObjC/AlertManager.m b/Example Apps/Example ObjC/AlertManager.m index ddc3aad72..d95bd2fc8 100644 --- a/Example Apps/Example ObjC/AlertManager.m +++ b/Example Apps/Example ObjC/AlertManager.m @@ -26,11 +26,12 @@ NS_ASSUME_NONNULL_BEGIN } /** - * Creates an alert with up to two lines of text and a close button that will dismiss the alert when tapped - * - * @param textField1 The first line of a message to display in the alert - * @param textField2 The second line of a message to display in the alert - * @return An SDLAlert object + Creates an alert with up to two lines of text and a close button that will dismiss the alert when tapped + + @param textField1 The first line of a message to display in the alert + @param textField2 The second line of a message to display in the alert + @param iconName The name of the uploaded icon artwork + @return An SDLAlert object */ + (SDLAlert *)alertWithMessageAndCloseButton:(NSString *)textField1 textField2:(nullable NSString *)textField2 iconName:(nullable NSString *)iconName { return [[SDLAlert alloc] initWithAlertText1:textField1 alertText2:textField2 alertText3:nil ttsChunks:nil playTone:NO progressIndicator:NO duration:5000 softButtons:@[[self sdlex_okSoftButton]] alertIcon:[[SDLImage alloc] initWithName:iconName isTemplate:YES]]; diff --git a/Example Apps/Example Swift/AlertManager.swift b/Example Apps/Example Swift/AlertManager.swift index 490002406..820f69f40 100644 --- a/Example Apps/Example Swift/AlertManager.swift +++ b/Example Apps/Example Swift/AlertManager.swift @@ -29,6 +29,7 @@ class AlertManager { /// - Parameters: /// - textField1: The first line of a message to display in the alert /// - textField2: The second line of a message to display in the alert + /// - iconName: The name of the uploaded icon artwork /// - Returns: An SDLAlert object class func alertWithMessageAndCloseButton(_ textField1: String, textField2: String? = nil, iconName: String? = nil) -> SDLAlert { return SDLAlert(alertText1: textField1, alertText2: textField2, alertText3: nil, ttsChunks: nil, playTone: false, progressIndicator: false, duration: 5000, softButtons: [AlertManager.okSoftButton], alertIcon: (iconName != nil) ? SDLImage(name: iconName!, isTemplate: true) : nil) diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m index 5be603e35..22fc58cba 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m @@ -214,7 +214,7 @@ describe(@"Alert spec", ^{ expect(testAlert.alertIcon).to(beNil()); }); - it(@"should initialize correctly with initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons:", ^{ + it(@"should initialize correctly with initWithAlertText1:alertText2:alertText3:ttsChunks:playTone:progressIndicator:duration:softButtons:alertIcon:", ^{ SDLAlert *testAlert = [[SDLAlert alloc] initWithAlertText1:testText1 alertText2:testText2 alertText3:testText3 ttsChunks:@[tts] playTone:testPlayTone progressIndicator:testProgressIndicator duration:testDuration softButtons:@[button] alertIcon:testImage]; expect(testAlert.alertText1).to(equal(testText1)); @@ -324,5 +324,4 @@ describe(@"Alert spec", ^{ }); }); - QuickSpecEnd |