Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change example app resultCode check to the success bool instead #1459

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Example Apps/Example ObjC/MenuManager.m
Expand Up @@ -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]];
}
}];
Expand All @@ -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]];
}
}];
Expand Down
4 changes: 2 additions & 2 deletions Example Apps/Example Swift/MenuManager.swift
Expand Up @@ -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.boolValue == .some(true) else {
manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage))
return
}
Expand All @@ -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.boolValue == .some(true) else {
manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage))
return
}
Expand Down