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
87102046
Commit
87102046
authored
Apr 29, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed UI glitch on day selection did change at ForecastViewController
parent
1159282f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
14 deletions
+17
-14
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+6
-1
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
+5
-0
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
+5
-13
1Weather/ViewModels/ForecastViewModel.swift
+1
-0
No files found.
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
87102046
...
...
@@ -7,7 +7,12 @@
<
k
e
y
>
1Weather.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
26
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
0
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
38
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
...
...
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
View file @
87102046
...
...
@@ -82,6 +82,10 @@ class ForecastCellFactory: CellFactoryProtocol {
self
.
cellsToUpdate
=
[
.
dailyTimePeriod
,
.
hourlyTimePeriod
,
.
dailyForecastInfoCell
,
.
precipitation
,
.
wind
]
}
public
func
selectedWeatherDidChange
()
{
self
.
cellsToUpdate
=
[
.
dailyForecastInfoCell
,
.
precipitation
,
.
wind
]
}
public
func
willDisplay
(
cell
:
UITableViewCell
)
{
switch
cell
{
case
let
sunCell
as
SunPhaseCell
:
...
...
@@ -113,6 +117,7 @@ class ForecastCellFactory: CellFactoryProtocol {
cellsToUpdate
.
remove
(
.
dailyTimePeriod
)
}
}
return
cell
case
.
forecastInfo
:
let
cell
=
dequeueReusableCell
(
type
:
ForecastInfoCell
.
self
,
tableView
:
tableView
,
indexPath
:
indexPath
)
...
...
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
View file @
87102046
...
...
@@ -74,6 +74,7 @@ class ForecastViewController: UIViewController {
self
.
timePeriodControl
.
selectedSegmentIndex
=
timePeriod
.
rawValue
}
forecastCellFactory
.
setTimePeriod
(
timePeriod
:
timePeriod
)
self
.
forecastCellFactory
.
setNeedsUpdate
()
self
.
tableView
.
reloadData
()
}
...
...
@@ -231,19 +232,10 @@ extension ForecastViewController: ForecastViewModelDelegate {
}
func
selectedWeatherDidChange
()
{
switch
timePeriod
{
case
.
daily
:
var
indexPathToReload
=
[
IndexPath
]()
for
index
in
0
..<
forecastCellFactory
.
numberOfRows
(
inSection
:
0
)
{
if
index
==
0
{
continue
}
indexPathToReload
.
append
([
0
,
index
])
}
tableView
.
reloadRows
(
at
:
indexPathToReload
,
with
:
.
none
)
daysControlView
.
selectDayAt
(
index
:
viewModel
.
selectedDailyWeatherIndex
)
case
.
hourly
:
tableView
.
reloadData
()
DispatchQueue
.
main
.
async
{
self
.
forecastCellFactory
.
selectedWeatherDidChange
()
self
.
daysControlView
.
selectDayAt
(
index
:
self
.
viewModel
.
selectedDailyWeatherIndex
)
self
.
tableView
.
reloadData
()
}
}
}
...
...
1Weather/ViewModels/ForecastViewModel.swift
View file @
87102046
...
...
@@ -63,6 +63,7 @@ class ForecastViewModel: ViewModelProtocol {
self
.
selectedHourlyWeather
=
$1
}
}
self
.
delegate
?
.
selectedWeatherDidChange
()
}
}
...
...
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