smartdevicelink/sdl_ios

Swapping de-duplicated menu items causes incorrect unique titles

joeljfischer opened this issue · 1 comments

Bug Report

In certain circumstances, the menu manager will not create a correct unique title for menu cells.

Reproduction Steps
  1. Disable secondary text (such as by modifying SDLWindowCapability+ScreenManagerExtensions.m/hasTextFieldOfName
  2. Connect to a v7.0+ Core
  3. Create a menu like the following:
let cell1 = SDLMenuCell(title: "A", secondaryText: "Secondary Text", tertiaryText: nil, icon: nil, secondaryArtwork: nil, voiceCommands: nil) { _ in
    print("Cell 1")
}
let cell2 = SDLMenuCell(title: "A", secondaryText: nil, tertiaryText: nil, icon: nil, secondaryArtwork: nil, voiceCommands: nil) { _ in
    print("Cell 2")
}
let cell3 = SDLMenuCell(title: "C", secondaryText: nil, tertiaryText: nil, icon: nil, secondaryArtwork: nil, voiceCommands: nil) { _ in
    manager.screenManager.menu = [cell2, cell1];
}

return [cell1, cell2, cell3]
  1. Enter the menu and press "C"
  2. Go back to the menu.
Expected Behavior

It should display A and A(2) again (or perhaps A(2) and A?)

Observed Behavior

It displays A and A

OS & Version Information
  • iOS Version: n/a
  • SDL iOS Version: v7.2.0
  • Testing Against: Manticore
Test Case, Sample Code, and / or Example App

[Paste a link to a PR, gist, or other code that exemplifies this behavior]

Corresponding Java Suite issue: smartdevicelink/sdl_java_suite#1723