Instrument metrics for iOS for the IA project #5401

- Added last needed metrics
This commit is contained in:
Gil Eluard
2022-03-16 16:56:27 +01:00
parent 0158373fdd
commit aad08cf6a2
5 changed files with 91 additions and 3 deletions
@@ -73,13 +73,16 @@ final class SpaceListViewModel: SpaceListViewModelType {
self.loadData()
case .selectRow(at: let indexPath, from: let sourceView):
guard self.selectedIndexPath != indexPath else {
Analytics.shared.trackInteraction(.spacePanelSelectedSpace)
return
}
let section = self.sections[indexPath.section]
switch section {
case .home:
self.selectHome()
self.selectedIndexPath = indexPath
Analytics.shared.trackInteraction(.spacePanelSwitchSpace)
self.update(viewState: .selectionChanged(indexPath))
case .spaces(let viewDataList):
let spaceViewData = viewDataList[indexPath.row]
@@ -88,6 +91,7 @@ final class SpaceListViewModel: SpaceListViewModelType {
} else {
self.selectSpace(with: spaceViewData.spaceId)
self.selectedIndexPath = indexPath
Analytics.shared.trackInteraction(.spacePanelSwitchSpace)
self.update(viewState: .selectionChanged(indexPath))
}
case .addSpace: