From 5f7b66d3add5148cb3d67d9d93d42c694ec7c586 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Tue, 22 Oct 2019 17:14:40 -0400 Subject: [PATCH 1/2] Change example app resultCode check to the success bool instead --- Example Apps/Example ObjC/MenuManager.m | 4 ++-- Example Apps/Example Swift/MenuManager.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Example Apps/Example ObjC/MenuManager.m b/Example Apps/Example ObjC/MenuManager.m index ec9d221b3..e81f0c2e3 100644 --- a/Example Apps/Example ObjC/MenuManager.m +++ b/Example Apps/Example ObjC/MenuManager.m @@ -99,7 +99,7 @@ + (SDLMenuCell *)sdlex_menuCellChangeTemplateWithManager:(SDLManager *)manager { SDLMenuCell *cell = [[SDLMenuCell alloc] initWithTitle:@"Non - Media (Default)" icon:nil voiceCommands:nil handler:^(SDLTriggerSource _Nonnull triggerSource) { SDLSetDisplayLayout* display = [[SDLSetDisplayLayout alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia]; [manager sendRequest:display withResponseHandler:^(SDLRPCRequest *request, SDLRPCResponse *response, NSError *error) { - if (![response.resultCode isEqualToEnum:SDLResultSuccess]) { + if (!response.success) { [manager sendRequest:[AlertManager alertWithMessageAndCloseButton:errorMessage textField2:nil iconName:nil]]; } }]; @@ -110,7 +110,7 @@ + (SDLMenuCell *)sdlex_menuCellChangeTemplateWithManager:(SDLManager *)manager { SDLMenuCell *cell2 = [[SDLMenuCell alloc] initWithTitle:@"Graphic With Text" icon:nil voiceCommands:nil handler:^(SDLTriggerSource _Nonnull triggerSource) { SDLSetDisplayLayout* display = [[SDLSetDisplayLayout alloc] initWithPredefinedLayout:SDLPredefinedLayoutGraphicWithText]; [manager sendRequest:display withResponseHandler:^(SDLRPCRequest *request, SDLRPCResponse *response, NSError *error) { - if (![response.resultCode isEqualToEnum:SDLResultSuccess]) { + if (!response.success) { [manager sendRequest:[AlertManager alertWithMessageAndCloseButton:errorMessage textField2:nil iconName:nil]]; } }]; diff --git a/Example Apps/Example Swift/MenuManager.swift b/Example Apps/Example Swift/MenuManager.swift index 649de49a7..e7839971a 100644 --- a/Example Apps/Example Swift/MenuManager.swift +++ b/Example Apps/Example Swift/MenuManager.swift @@ -132,7 +132,7 @@ private extension MenuManager { submenuItems.append(SDLMenuCell(title: submenuTitleNonMedia, icon: nil, voiceCommands: nil, handler: { (triggerSource) in let display = SDLSetDisplayLayout(predefinedLayout: .nonMedia) manager.send(request: display) { (request, response, error) in - guard response?.resultCode == .success else { + guard !response?.success == .some(true) else { manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage)) return } @@ -144,7 +144,7 @@ private extension MenuManager { submenuItems.append(SDLMenuCell(title: submenuTitleGraphicText, icon: nil, voiceCommands: nil, handler: { (triggerSource) in let display = SDLSetDisplayLayout(predefinedLayout: .graphicWithText) manager.send(request: display) { (request, response, error) in - guard response?.resultCode == .success else { + guard !response?.success == .some(true) else { manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage)) return } From 3d38f0813db9747d6a9d3fae997a7ee80facee85 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Wed, 23 Oct 2019 10:00:52 -0400 Subject: [PATCH 2/2] Swift example app fixes --- Example Apps/Example Swift/MenuManager.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Example Apps/Example Swift/MenuManager.swift b/Example Apps/Example Swift/MenuManager.swift index e7839971a..e014fa44b 100644 --- a/Example Apps/Example Swift/MenuManager.swift +++ b/Example Apps/Example Swift/MenuManager.swift @@ -132,7 +132,7 @@ private extension MenuManager { submenuItems.append(SDLMenuCell(title: submenuTitleNonMedia, icon: nil, voiceCommands: nil, handler: { (triggerSource) in let display = SDLSetDisplayLayout(predefinedLayout: .nonMedia) manager.send(request: display) { (request, response, error) in - guard !response?.success == .some(true) else { + guard response?.success.boolValue == .some(true) else { manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage)) return } @@ -144,7 +144,7 @@ private extension MenuManager { submenuItems.append(SDLMenuCell(title: submenuTitleGraphicText, icon: nil, voiceCommands: nil, handler: { (triggerSource) in let display = SDLSetDisplayLayout(predefinedLayout: .graphicWithText) manager.send(request: display) { (request, response, error) in - guard !response?.success == .some(true) else { + guard response?.success.boolValue == .some(true) else { manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage)) return }