Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
80a15f6b
Commit
80a15f6b
authored
May 11, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Analytics: added missing events.
parent
f76e0e72
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
8 deletions
+42
-8
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
+3
-7
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
+17
-1
1Weather/UI/View controllers/NWSAlert/NWSAlertViewController.swift
+5
-0
1Weather/UI/View controllers/Notifications/NotificationsViewController.swift
+5
-0
1Weather/UI/View controllers/Radar/RadarViewController.swift
+6
-0
1Weather/UI/View controllers/Settings/SettingsViewController.swift
+5
-0
1Weather/ViewModels/MenuViewModel.swift
+1
-0
No files found.
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
View file @
80a15f6b
...
...
@@ -39,7 +39,7 @@ class ForecastCellFactory: CellFactoryProtocol {
//Private
private
var
cellsToUpdate
:
CellsToUpdate
=
[
.
dailyTimePeriod
,
.
hourlyTimePeriod
,
.
dailyForecastInfoCell
,
.
precipitation
,
.
wind
]
private
let
forecastViewModel
:
ForecastViewModel
p
rivate
var
currentT
imePeriod
=
TimePeriod
.
daily
p
ublic
var
t
imePeriod
=
TimePeriod
.
daily
//Public
var
numberOfSections
:
Int
{
...
...
@@ -47,17 +47,13 @@ class ForecastCellFactory: CellFactoryProtocol {
}
public
func
numberOfRows
(
inSection
section
:
Int
)
->
Int
{
return
currentT
imePeriod
==
.
daily
?
DailyForecastCellType
.
allCases
.
count
:
HourlyForecastCellType
.
allCases
.
count
return
t
imePeriod
==
.
daily
?
DailyForecastCellType
.
allCases
.
count
:
HourlyForecastCellType
.
allCases
.
count
}
public
init
(
viewModel
:
ForecastViewModel
)
{
self
.
forecastViewModel
=
viewModel
}
public
func
setTimePeriod
(
timePeriod
:
TimePeriod
)
{
self
.
currentTimePeriod
=
timePeriod
}
public
func
registerCells
(
on
tableView
:
UITableView
)
{
registerCell
(
type
:
ForecastDailyCell
.
self
,
tableView
:
tableView
)
registerCell
(
type
:
ForecastDayCell
.
self
,
tableView
:
tableView
)
...
...
@@ -70,7 +66,7 @@ class ForecastCellFactory: CellFactoryProtocol {
}
public
func
cellFromTableView
(
tableView
:
UITableView
,
indexPath
:
IndexPath
)
->
UITableViewCell
{
switch
currentT
imePeriod
{
switch
t
imePeriod
{
case
.
daily
:
return
dailyCellFor
(
tableView
:
tableView
,
indexPath
:
indexPath
)
case
.
hourly
:
...
...
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
View file @
80a15f6b
...
...
@@ -49,11 +49,26 @@ class ForecastViewController: UIViewController {
refreshDayButtons
()
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_FORECAST
)
analyticsLogCurrentTimePeriod
()
}
override
func
viewDidLayoutSubviews
()
{
super
.
viewDidLayoutSubviews
()
self
.
tableView
.
layoutTableHeaderView
()
}
private
func
analyticsLogCurrentTimePeriod
()
{
switch
forecastCellFactory
.
timePeriod
{
case
.
daily
:
analytics
(
log
:
.
ANALYTICS_VIEW_FORECAST_EXTENDED
)
case
.
hourly
:
analytics
(
log
:
.
ANALYTICS_VIEW_FORECAST_HOURLY
)
}
}
private
func
refreshCityButton
()
{
cityButton
.
configure
(
with
:
viewModel
.
location
)
cityButton
.
isHidden
=
false
...
...
@@ -72,9 +87,10 @@ class ForecastViewController: UIViewController {
if
self
.
timePeriodControl
.
selectedSegmentIndex
!=
timePeriod
.
rawValue
{
self
.
timePeriodControl
.
selectedSegmentIndex
=
timePeriod
.
rawValue
}
forecastCellFactory
.
setTimePeriod
(
timePeriod
:
timePeriod
)
forecastCellFactory
.
timePeriod
=
timePeriod
self
.
forecastCellFactory
.
setNeedsUpdate
()
self
.
tableView
.
reloadData
()
analyticsLogCurrentTimePeriod
()
}
@objc
private
func
handleSegmentDidChange
()
{
...
...
1Weather/UI/View controllers/NWSAlert/NWSAlertViewController.swift
View file @
80a15f6b
...
...
@@ -30,6 +30,11 @@ class NWSAlertViewController: UIViewController {
prepareTableView
()
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_ALERT_DETAILS
)
}
deinit
{
if
let
observer
=
localizationObserver
{
NotificationCenter
.
default
.
removeObserver
(
observer
)
...
...
1Weather/UI/View controllers/Notifications/NotificationsViewController.swift
View file @
80a15f6b
...
...
@@ -33,6 +33,11 @@ class NotificationsViewController: UIViewController {
tableView
.
reloadData
()
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_ALERTS
)
}
deinit
{
if
let
observer
=
localizationObserver
{
...
...
1Weather/UI/View controllers/Radar/RadarViewController.swift
View file @
80a15f6b
...
...
@@ -81,6 +81,11 @@ class RadarViewController: UIViewController {
initialConfigure
()
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_RADAR
)
}
//Private
private
func
updateUI
()
{
view
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
...
...
@@ -212,6 +217,7 @@ class RadarViewController: UIViewController {
}
isFullScreen
=
true
fullScreenButton
.
setImage
(
image
:
UIImage
(
named
:
"cross_icon"
))
analytics
(
log
:
.
ANALYTICS_VIEW_RADAR_FULLSCREEN
)
}
self
.
view
.
setNeedsLayout
()
...
...
1Weather/UI/View controllers/Settings/SettingsViewController.swift
View file @
80a15f6b
...
...
@@ -35,6 +35,11 @@ class SettingsViewController: UIViewController {
updateUI
()
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_SETTINGS
)
}
override
func
traitCollectionDidChange
(
_
previousTraitCollection
:
UITraitCollection
?)
{
super
.
traitCollectionDidChange
(
previousTraitCollection
)
updateUI
()
...
...
1Weather/ViewModels/MenuViewModel.swift
View file @
80a15f6b
...
...
@@ -61,6 +61,7 @@ class MenuViewModel: NSObject, ViewModelProtocol {
public
func
viewAboutUs
()
{
self
.
delegate
?
.
presentWebView
(
url
:
ONE_WEATHER_ABOUT_US_URL
)
analytics
(
log
:
.
ANALYTICS_VIEW_ABOUT
)
}
public
func
viewAdChoices
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment