From 2fceb8de9e50f158f04972a7b9b5a620fbe321f7 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 20 Jul 2020 14:46:56 -0400 Subject: [PATCH 1/2] tab list fix --- .../Molecules/HorizontalCombinationViews/Tabs.swift | 2 ++ MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index f9a75e7d..54a33a1b 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -133,11 +133,13 @@ import UIKit public func selectIndex(_ index: Int, animated: Bool) { guard let _ = collectionView, tabsModel?.tabs.count ?? 0 > 0 else { selectedIndex = index + tabsModel?.selectedIndex = index return } MVMCoreDispatchUtility.performBlock(onMainThread: { let currentIndex = self.selectedIndex self.selectedIndex = index + self.tabsModel?.selectedIndex = index self.deselect(indexPath: IndexPath(row: currentIndex, section: 0)) self.selectItem(atIndexPath: IndexPath(row: index, section: 0), animated: animated) }) diff --git a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift index f9ed4243..28355e86 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift @@ -45,8 +45,7 @@ import UIKit public override func reset() { super.reset() - // TODO: Uncomment when finished with Ryan Tab pr. - //tabs.reset() + tabs.reset() } public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { @@ -66,9 +65,11 @@ extension TabsTableViewCell: TabsDelegate { public func didSelectItem(_ indexPath: IndexPath, tabs: Tabs) { let index = indexPath.row - if let model = tabsListItemModel, index < model.molecules.count { + if let model = tabsListItemModel, + index < model.molecules.count, + let cellIndexPath = delegateObject?.moleculeDelegate?.getIndexPath(for: model) { let molecules = model.molecules[index] - delegateObject?.moleculeDelegate?.addMolecules(molecules, indexPath: indexPath, animation: index < previousTabIndex ? .left : .right) + delegateObject?.moleculeDelegate?.addMolecules(molecules, indexPath: cellIndexPath, animation: index < previousTabIndex ? .left : .right) } } } From 2b3375693e3a6179344f60b3692bc2aef753de32 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 20 Jul 2020 15:02:30 -0400 Subject: [PATCH 2/2] add missing calls --- .../DesignedComponents/LockUps/LockUpsPlanNames.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockUpsPlanNames.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockUpsPlanNames.swift index e8f77b2b..e947322f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockUpsPlanNames.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockUpsPlanNames.swift @@ -41,6 +41,11 @@ import Foundation stack.restack() } + open override func updateView(_ size: CGFloat) { + super.updateView(size) + stack.updateView(size) + } + //---------------------------------------------------- // MARK: - Molecule //------------------------------------------------------ @@ -59,6 +64,7 @@ import Foundation open override func reset() { super.reset() + stack.reset() headline.setFontStyle(.Title2XLarge) subHeadline.setFontStyle(.RegularTitleLarge) body.setFontStyle(.RegularBodySmall)