Commit d14ca90c by Demid Merzlyakov

IOS-316 / IOS-317: Minutely events: fix MINUTELY_PRECIP_TODAY_TAP not fired.

parent 0b5e2c29
...@@ -26,6 +26,7 @@ class PrecipitationCell: UITableViewCell { ...@@ -26,6 +26,7 @@ class PrecipitationCell: UITableViewCell {
private let descriptionView = ForecastDescriptionView(lightStyleBackgroundColor: UIColor(hex: 0xd9ebfe), private let descriptionView = ForecastDescriptionView(lightStyleBackgroundColor: UIColor(hex: 0xd9ebfe),
gradientColors: [UIColor(hex: 0x44a4ff).withAlphaComponent(0.65).cgColor, gradientColors: [UIColor(hex: 0x44a4ff).withAlphaComponent(0.65).cgColor,
UIColor(hex: 0x73bbff).withAlphaComponent(0).cgColor]) UIColor(hex: 0x73bbff).withAlphaComponent(0).cgColor])
public var onTodayScreen: Bool = false
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier) super.init(style: style, reuseIdentifier: reuseIdentifier)
...@@ -191,6 +192,13 @@ class PrecipitationCell: UITableViewCell { ...@@ -191,6 +192,13 @@ class PrecipitationCell: UITableViewCell {
AppAnalytics.shared.log(event: .ANALYTICS_MINUTELY_PRECIP_TODAY_SEEN) AppAnalytics.shared.log(event: .ANALYTICS_MINUTELY_PRECIP_TODAY_SEEN)
} }
} }
@objc
private func handleTapOnGraph() {
if onTodayScreen {
analytics(log: .ANALYTICS_MINUTELY_PRECIP_TODAY_TAP)
}
}
} }
//MARK:- Prepare //MARK:- Prepare
...@@ -259,6 +267,9 @@ private extension PrecipitationCell { ...@@ -259,6 +267,9 @@ private extension PrecipitationCell {
make.top.equalTo(periodSegmentedControl.snp.bottom).offset(40).priority(.medium) make.top.equalTo(periodSegmentedControl.snp.bottom).offset(40).priority(.medium)
make.height.equalTo(240) make.height.equalTo(240)
} }
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTapOnGraph))
minutelyForecastView.addGestureRecognizer(tapGestureRecognizer)
} }
func prepareStackView() { func prepareStackView() {
......
...@@ -160,6 +160,7 @@ class TodayCellFactory: CellFactory { ...@@ -160,6 +160,7 @@ class TodayCellFactory: CellFactory {
return cell return cell
case .precipitation: case .precipitation:
let cell = dequeueReusableCell(type: PrecipitationCell.self, tableView: tableView, indexPath: indexPath) let cell = dequeueReusableCell(type: PrecipitationCell.self, tableView: tableView, indexPath: indexPath)
cell.onTodayScreen = true
cell.delegate = self cell.delegate = self
if cellsToUpdate.contains(.precipitation) { if cellsToUpdate.contains(.precipitation) {
if let location = todayViewModel.location { if let location = todayViewModel.location {
......
...@@ -122,6 +122,7 @@ private extension TodayForecastTimePeriodCell { ...@@ -122,6 +122,7 @@ private extension TodayForecastTimePeriodCell {
@objc @objc
private func handleMinutelyTap() { private func handleMinutelyTap() {
AppCoordinator.instance.openForecast(timePeriod: .minutely) AppCoordinator.instance.openForecast(timePeriod: .minutely)
analytics.(log: .ANALYTICS_MINUTELY_TEMP_TODAY_TAP)
} }
func prepareDescriptionView() { func prepareDescriptionView() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment