tab list fix
This commit is contained in:
parent
192a590817
commit
2fceb8de9e
@ -133,11 +133,13 @@ import UIKit
|
|||||||
public func selectIndex(_ index: Int, animated: Bool) {
|
public func selectIndex(_ index: Int, animated: Bool) {
|
||||||
guard let _ = collectionView, tabsModel?.tabs.count ?? 0 > 0 else {
|
guard let _ = collectionView, tabsModel?.tabs.count ?? 0 > 0 else {
|
||||||
selectedIndex = index
|
selectedIndex = index
|
||||||
|
tabsModel?.selectedIndex = index
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
||||||
let currentIndex = self.selectedIndex
|
let currentIndex = self.selectedIndex
|
||||||
self.selectedIndex = index
|
self.selectedIndex = index
|
||||||
|
self.tabsModel?.selectedIndex = index
|
||||||
self.deselect(indexPath: IndexPath(row: currentIndex, section: 0))
|
self.deselect(indexPath: IndexPath(row: currentIndex, section: 0))
|
||||||
self.selectItem(atIndexPath: IndexPath(row: index, section: 0), animated: animated)
|
self.selectItem(atIndexPath: IndexPath(row: index, section: 0), animated: animated)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -45,8 +45,7 @@ import UIKit
|
|||||||
|
|
||||||
public override func reset() {
|
public override func reset() {
|
||||||
super.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? {
|
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) {
|
public func didSelectItem(_ indexPath: IndexPath, tabs: Tabs) {
|
||||||
let index = indexPath.row
|
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]
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user