diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2021-07-28 15:48:30 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2021-07-28 15:48:30 -0400 |
commit | 5a765239dfbe98419039dd67f43f48923750253b (patch) | |
tree | 1b03552e2c6da824b1e870e5dd7927cdcb707e10 /SmartDeviceLink/public | |
parent | 4d7d2713824f05d0f38e8a25210d236d7768cefe (diff) | |
download | sdl_ios-5a765239dfbe98419039dd67f43f48923750253b.tar.gz |
Starting updates of menu refactor
Diffstat (limited to 'SmartDeviceLink/public')
-rw-r--r-- | SmartDeviceLink/public/SDLMenuCell.m | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/SmartDeviceLink/public/SDLMenuCell.m b/SmartDeviceLink/public/SDLMenuCell.m index b189cc411..05ab2a786 100644 --- a/SmartDeviceLink/public/SDLMenuCell.m +++ b/SmartDeviceLink/public/SDLMenuCell.m @@ -92,16 +92,6 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Object Equality -- (id)copyWithZone:(nullable NSZone *)zone { - SDLMenuCell *newCell = [[SDLMenuCell allocWithZone:zone] initWithTitle:_title secondaryText:_secondaryText tertiaryText:_tertiaryText icon:_icon secondaryArtwork:_secondaryArtwork voiceCommands:_voiceCommands handler:_handler]; - - if (_subCells.count > 0) { - newCell.subCells = [[NSArray alloc] initWithArray:_subCells copyItems:YES]; - } - - return newCell; -} - - (NSUInteger)hash { return NSUIntRotateCell(self.title.hash, NSUIntBitCell / 2) ^ NSUIntRotateCell(self.icon.name.hash, NSUIntBitCell / 3) @@ -129,13 +119,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Copying - (id)copyWithZone:(nullable NSZone *)zone { - SDLMenuCell *copy = [[SDLMenuCell allocWithZone:zone] initWithTitle:_title icon:[_icon copy] submenuLayout:_submenuLayout subCells:[_subCells copy]]; - copy->_voiceCommands = [_voiceCommands copy]; - copy->_cellId = _cellId; - copy->_parentCellId = _parentCellId; - copy->_handler = [_handler copy]; + SDLMenuCell *newCell = [[SDLMenuCell allocWithZone:zone] initWithTitle:_title secondaryText:_secondaryText tertiaryText:_tertiaryText icon:_icon secondaryArtwork:_secondaryArtwork voiceCommands:_voiceCommands handler:_handler]; + newCell->_cellId = _cellId; + newCell->_parentCellId = _parentCellId; + newCell->_uniqueTitle = _uniqueTitle; + + if (_subCells.count > 0) { + newCell.subCells = [[NSArray alloc] initWithArray:_subCells copyItems:YES]; + } - return copy; + return newCell; } @end |