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
b70e29c6
Commit
b70e29c6
authored
Oct 11, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-184: navigate to forecast/minutely.
parent
c65cc864
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
1Weather/UI/SharedCells/PrecipCell/PrecipitationCell.swift
+3
-2
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
+2
-2
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
+4
-0
1Weather/UI/View controllers/Today/Cells/TodayCellFactory.swift
+2
-2
No files found.
1Weather/UI/SharedCells/PrecipCell/PrecipitationCell.swift
View file @
b70e29c6
...
...
@@ -10,7 +10,7 @@ import OneWeatherCore
import
OneWeatherAnalytics
protocol
PrecipitationCellDelegate
:
AnyObject
{
func
precipitationCtaClicked
()
func
precipitationCtaClicked
(
choosingTimePeriod
:
TimePeriod
)
}
class
PrecipitationCell
:
UITableViewCell
{
...
...
@@ -160,7 +160,8 @@ class PrecipitationCell: UITableViewCell {
//Private
@objc
private
func
handleArrowButton
()
{
self
.
delegate
?
.
precipitationCtaClicked
()
let
timePeriod
:
TimePeriod
=
periodSegmentedControl
.
selectedSegmentIndex
==
0
?
.
daily
:
.
minutely
self
.
delegate
?
.
precipitationCtaClicked
(
choosingTimePeriod
:
timePeriod
)
}
@objc
private
func
handlePrecipButton
(
button
:
PrecipButton
)
{
...
...
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
View file @
b70e29c6
...
...
@@ -215,11 +215,11 @@ class ForecastCellFactory: CellFactory {
}
public
func
setNeedsUpdate
()
{
self
.
cellsToUpdate
=
[
.
forecastDaily
,
.
forecastHourly
,
.
forecastDailyInfo
,
.
precipitation
,
.
wind
]
self
.
cellsToUpdate
=
[
.
forecastDaily
,
.
forecastHourly
,
.
forecastDailyInfo
,
.
precipitation
,
.
wind
,
.
minutely
,
.
precipitationAdviced
]
}
public
func
selectedWeatherDidChange
()
{
self
.
cellsToUpdate
=
[
.
forecastDailyInfo
,
.
precipitation
,
.
wind
]
self
.
cellsToUpdate
=
[
.
forecastDailyInfo
,
.
precipitation
,
.
wind
,
.
minutely
,
.
precipitationAdviced
]
}
public
func
willDisplay
(
cell
:
UITableViewCell
)
{
...
...
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
View file @
b70e29c6
...
...
@@ -102,6 +102,10 @@ class ForecastViewController: UIViewController {
self
.
timePeriodControl
.
set
(
items
:
[
"forecast.timePeriod.daily"
.
localized
(),
"forecast.timePeriod.hourly"
.
localized
()])
}
let
indexToSelect
=
forecastCellFactory
.
timePeriod
.
rawValue
if
indexToSelect
>=
0
&&
indexToSelect
<
timePeriodControl
.
numberOfSegments
{
timePeriodControl
.
selectedSegmentIndex
=
indexToSelect
}
}
public
func
switchTo
(
timePeriod
:
TimePeriod
)
{
...
...
1Weather/UI/View controllers/Today/Cells/TodayCellFactory.swift
View file @
b70e29c6
...
...
@@ -287,9 +287,9 @@ extension TodayCellFactory: AdViewDelegate {
}
extension
TodayCellFactory
:
PrecipitationCellDelegate
{
func
precipitationCtaClicked
()
{
func
precipitationCtaClicked
(
choosingTimePeriod
timePeriod
:
TimePeriod
)
{
onMain
{
self
.
todayViewModel
.
openForecast
(
timePeriod
:
.
minutely
)
self
.
todayViewModel
.
openForecast
(
timePeriod
:
timePeriod
)
}
}
}
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