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 {
...
@@ -39,7 +39,7 @@ class ForecastCellFactory: CellFactoryProtocol {
//Private
//Private
private
var
cellsToUpdate
:
CellsToUpdate
=
[
.
dailyTimePeriod
,
.
hourlyTimePeriod
,
.
dailyForecastInfoCell
,
.
precipitation
,
.
wind
]
private
var
cellsToUpdate
:
CellsToUpdate
=
[
.
dailyTimePeriod
,
.
hourlyTimePeriod
,
.
dailyForecastInfoCell
,
.
precipitation
,
.
wind
]
private
let
forecastViewModel
:
ForecastViewModel
private
let
forecastViewModel
:
ForecastViewModel
p
rivate
var
currentT
imePeriod
=
TimePeriod
.
daily
p
ublic
var
t
imePeriod
=
TimePeriod
.
daily
//Public
//Public
var
numberOfSections
:
Int
{
var
numberOfSections
:
Int
{
...
@@ -47,17 +47,13 @@ class ForecastCellFactory: CellFactoryProtocol {
...
@@ -47,17 +47,13 @@ class ForecastCellFactory: CellFactoryProtocol {
}
}
public
func
numberOfRows
(
inSection
section
:
Int
)
->
Int
{
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
)
{
public
init
(
viewModel
:
ForecastViewModel
)
{
self
.
forecastViewModel
=
viewModel
self
.
forecastViewModel
=
viewModel
}
}
public
func
setTimePeriod
(
timePeriod
:
TimePeriod
)
{
self
.
currentTimePeriod
=
timePeriod
}
public
func
registerCells
(
on
tableView
:
UITableView
)
{
public
func
registerCells
(
on
tableView
:
UITableView
)
{
registerCell
(
type
:
ForecastDailyCell
.
self
,
tableView
:
tableView
)
registerCell
(
type
:
ForecastDailyCell
.
self
,
tableView
:
tableView
)
registerCell
(
type
:
ForecastDayCell
.
self
,
tableView
:
tableView
)
registerCell
(
type
:
ForecastDayCell
.
self
,
tableView
:
tableView
)
...
@@ -70,7 +66,7 @@ class ForecastCellFactory: CellFactoryProtocol {
...
@@ -70,7 +66,7 @@ class ForecastCellFactory: CellFactoryProtocol {
}
}
public
func
cellFromTableView
(
tableView
:
UITableView
,
indexPath
:
IndexPath
)
->
UITableViewCell
{
public
func
cellFromTableView
(
tableView
:
UITableView
,
indexPath
:
IndexPath
)
->
UITableViewCell
{
switch
currentT
imePeriod
{
switch
t
imePeriod
{
case
.
daily
:
case
.
daily
:
return
dailyCellFor
(
tableView
:
tableView
,
indexPath
:
indexPath
)
return
dailyCellFor
(
tableView
:
tableView
,
indexPath
:
indexPath
)
case
.
hourly
:
case
.
hourly
:
...
...
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
View file @
80a15f6b
...
@@ -49,11 +49,26 @@ class ForecastViewController: UIViewController {
...
@@ -49,11 +49,26 @@ class ForecastViewController: UIViewController {
refreshDayButtons
()
refreshDayButtons
()
}
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_FORECAST
)
analyticsLogCurrentTimePeriod
()
}
override
func
viewDidLayoutSubviews
()
{
override
func
viewDidLayoutSubviews
()
{
super
.
viewDidLayoutSubviews
()
super
.
viewDidLayoutSubviews
()
self
.
tableView
.
layoutTableHeaderView
()
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
()
{
private
func
refreshCityButton
()
{
cityButton
.
configure
(
with
:
viewModel
.
location
)
cityButton
.
configure
(
with
:
viewModel
.
location
)
cityButton
.
isHidden
=
false
cityButton
.
isHidden
=
false
...
@@ -72,9 +87,10 @@ class ForecastViewController: UIViewController {
...
@@ -72,9 +87,10 @@ class ForecastViewController: UIViewController {
if
self
.
timePeriodControl
.
selectedSegmentIndex
!=
timePeriod
.
rawValue
{
if
self
.
timePeriodControl
.
selectedSegmentIndex
!=
timePeriod
.
rawValue
{
self
.
timePeriodControl
.
selectedSegmentIndex
=
timePeriod
.
rawValue
self
.
timePeriodControl
.
selectedSegmentIndex
=
timePeriod
.
rawValue
}
}
forecastCellFactory
.
setTimePeriod
(
timePeriod
:
timePeriod
)
forecastCellFactory
.
timePeriod
=
timePeriod
self
.
forecastCellFactory
.
setNeedsUpdate
()
self
.
forecastCellFactory
.
setNeedsUpdate
()
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
analyticsLogCurrentTimePeriod
()
}
}
@objc
private
func
handleSegmentDidChange
()
{
@objc
private
func
handleSegmentDidChange
()
{
...
...
1Weather/UI/View controllers/NWSAlert/NWSAlertViewController.swift
View file @
80a15f6b
...
@@ -30,6 +30,11 @@ class NWSAlertViewController: UIViewController {
...
@@ -30,6 +30,11 @@ class NWSAlertViewController: UIViewController {
prepareTableView
()
prepareTableView
()
}
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_ALERT_DETAILS
)
}
deinit
{
deinit
{
if
let
observer
=
localizationObserver
{
if
let
observer
=
localizationObserver
{
NotificationCenter
.
default
.
removeObserver
(
observer
)
NotificationCenter
.
default
.
removeObserver
(
observer
)
...
...
1Weather/UI/View controllers/Notifications/NotificationsViewController.swift
View file @
80a15f6b
...
@@ -33,6 +33,11 @@ class NotificationsViewController: UIViewController {
...
@@ -33,6 +33,11 @@ class NotificationsViewController: UIViewController {
tableView
.
reloadData
()
tableView
.
reloadData
()
}
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_ALERTS
)
}
deinit
{
deinit
{
if
let
observer
=
localizationObserver
{
if
let
observer
=
localizationObserver
{
...
...
1Weather/UI/View controllers/Radar/RadarViewController.swift
View file @
80a15f6b
...
@@ -81,6 +81,11 @@ class RadarViewController: UIViewController {
...
@@ -81,6 +81,11 @@ class RadarViewController: UIViewController {
initialConfigure
()
initialConfigure
()
}
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_RADAR
)
}
//Private
//Private
private
func
updateUI
()
{
private
func
updateUI
()
{
view
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
view
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
...
@@ -212,6 +217,7 @@ class RadarViewController: UIViewController {
...
@@ -212,6 +217,7 @@ class RadarViewController: UIViewController {
}
}
isFullScreen
=
true
isFullScreen
=
true
fullScreenButton
.
setImage
(
image
:
UIImage
(
named
:
"cross_icon"
))
fullScreenButton
.
setImage
(
image
:
UIImage
(
named
:
"cross_icon"
))
analytics
(
log
:
.
ANALYTICS_VIEW_RADAR_FULLSCREEN
)
}
}
self
.
view
.
setNeedsLayout
()
self
.
view
.
setNeedsLayout
()
...
...
1Weather/UI/View controllers/Settings/SettingsViewController.swift
View file @
80a15f6b
...
@@ -35,6 +35,11 @@ class SettingsViewController: UIViewController {
...
@@ -35,6 +35,11 @@ class SettingsViewController: UIViewController {
updateUI
()
updateUI
()
}
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
analytics
(
log
:
.
ANALYTICS_VIEW_SETTINGS
)
}
override
func
traitCollectionDidChange
(
_
previousTraitCollection
:
UITraitCollection
?)
{
override
func
traitCollectionDidChange
(
_
previousTraitCollection
:
UITraitCollection
?)
{
super
.
traitCollectionDidChange
(
previousTraitCollection
)
super
.
traitCollectionDidChange
(
previousTraitCollection
)
updateUI
()
updateUI
()
...
...
1Weather/ViewModels/MenuViewModel.swift
View file @
80a15f6b
...
@@ -61,6 +61,7 @@ class MenuViewModel: NSObject, ViewModelProtocol {
...
@@ -61,6 +61,7 @@ class MenuViewModel: NSObject, ViewModelProtocol {
public
func
viewAboutUs
()
{
public
func
viewAboutUs
()
{
self
.
delegate
?
.
presentWebView
(
url
:
ONE_WEATHER_ABOUT_US_URL
)
self
.
delegate
?
.
presentWebView
(
url
:
ONE_WEATHER_ABOUT_US_URL
)
analytics
(
log
:
.
ANALYTICS_VIEW_ABOUT
)
}
}
public
func
viewAdChoices
()
{
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