diff options
author | Zoia Pribytkova <niakris90@gmail.com> | 2019-04-24 14:53:26 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-05-08 16:49:33 +0300 |
commit | 39ba8fc18ed67c682888644876c1de28be04ca29 (patch) | |
tree | 11362b999d31ad22fb8516ec44c7332ad00dd59d /iphone | |
parent | 8f7bbd952bc9ada7fc1a8f0169ef8ff4f4eaf040 (diff) |
[iOS] Statistic events for search tabs
Diffstat (limited to 'iphone')
-rw-r--r-- | iphone/Maps/Common/Statistics/StatisticsStrings.h | 2 | ||||
-rw-r--r-- | iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/iphone/Maps/Common/Statistics/StatisticsStrings.h b/iphone/Maps/Common/Statistics/StatisticsStrings.h index 674c583ee4..aa05c42328 100644 --- a/iphone/Maps/Common/Statistics/StatisticsStrings.h +++ b/iphone/Maps/Common/Statistics/StatisticsStrings.h @@ -359,6 +359,7 @@ static NSString * const kStatSearchFilterReset = @"Search_Filter_Reset"; static NSString * const kStatSearchRestaurants = @"Search.Restaurants"; static NSString * const kStatSearchSponsoredSelect = @"Search_SponsoredCategory_selected"; static NSString * const kStatSearchSponsoredShow = @"Search_SponsoredCategory_shown"; +static NSString * const kStatSearchTabSelected = @"Search_Tab_selected"; static NSString * const kStatSelectMap = @"Select map"; static NSString * const kStatSelectResult = @"Select result"; static NSString * const kStatSelectTab = @"Select tab"; @@ -388,6 +389,7 @@ static NSString * const kStatState = @"state"; static NSString * const kStatSwapRoutingPoints = @"Swap routing points"; static NSString * const kStatTTS = @"TTS"; static NSString * const kStatTTSSettings = @"TTS settings"; +static NSString * const kStatTab = @"tab"; static NSString * const kStatTable = @"Table"; static NSString * const kStatTags = @"tags"; static NSString * const kStatTaxi = @"Taxi"; diff --git a/iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift b/iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift index 4d950096cb..d4d787e350 100644 --- a/iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift +++ b/iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift @@ -47,6 +47,7 @@ final class SearchTabViewController: TabViewController { tabView.tintColor = .white() tabView.headerTextAttributes = [.foregroundColor: UIColor.whitePrimaryText(), .font: UIFont.medium14()] + tabView.delegate = self } override func viewDidDisappear(_ animated: Bool) { @@ -69,3 +70,10 @@ extension SearchTabViewController: SearchHistoryViewControllerDelegate { delegate?.searchTabController(self, didSearch: query) } } + +extension SearchTabViewController: TabViewDelegate { + func tabView(_ tabView: TabView, didSelectTabAt index: Int) { + let selectedTab = index == 0 ? kStatHistory.uppercased() : kStatCategories.uppercased() + Statistics.logEvent(kStatSearchTabSelected, withParameters: [kStatTab : selectedTab]) + } +} |