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
bbf41fed
Commit
bbf41fed
authored
Mar 19, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed getter for TimePeriodCell frame
parent
2d426c1d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
15 deletions
+11
-15
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+1
-1
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
+1
-3
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
+6
-8
Pods/Pods.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+3
-3
No files found.
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
bbf41fed
...
...
@@ -7,7 +7,7 @@
<
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
>
5
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
4
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
...
...
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/UserInterfaceState.xcuserstate
View file @
bbf41fed
No preview for this file type
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
View file @
bbf41fed
...
...
@@ -23,7 +23,6 @@ class ForecastCellFactory {
private
let
forecastViewModel
:
ForecastViewModel
//Public
public
var
forecastPeriodCellFrame
:
CGRect
=
.
zero
public
var
numberOfRows
:
Int
{
return
ForecastCellType
.
allCases
.
count
}
...
...
@@ -48,8 +47,7 @@ class ForecastCellFactory {
case
.
forecastPeriod
:
let
cell
=
dequeueReusableCell
(
type
:
ForecastTimePeriodCell
.
self
,
tableView
:
tableView
,
indexPath
:
indexPath
)
cell
.
delegate
=
self
forecastPeriodCellFrame
=
cell
.
frame
if
let
daily
=
forecastViewModel
.
location
?
.
daily
,
let
hourly
=
forecastViewModel
.
location
?
.
hourly
{
cell
.
configure
(
daily
:
daily
,
hourly
:
hourly
)
...
...
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
View file @
bbf41fed
...
...
@@ -14,6 +14,7 @@ class ForecastViewController: UIViewController {
private
let
daysControlView
=
DaysControlView
()
private
let
tableView
=
UITableView
()
private
let
viewModel
:
ForecastViewModel
private
var
timePeriodCellFrame
=
CGRect
.
zero
private
var
localizationObserver
:
Any
?
init
(
viewModel
:
ForecastViewModel
)
{
...
...
@@ -113,21 +114,18 @@ private extension ForecastViewController {
//MARK:- UITableView Delegate
extension
ForecastViewController
:
UITableViewDelegate
{
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
let
cellFrame
=
forecastCellFactory
.
forecastPeriodCellFrame
guard
let
navVC
=
self
.
navigationController
,
viewModel
.
location
?
.
daily
.
isEmpty
==
false
else
{
return
}
let
startPointY
=
cellFrame
.
origin
.
y
+
cellFrame
.
height
-
self
.
daysControlView
.
frame
.
height
guard
startPointY
>
0
else
{
//Force reload row to get actual row height
tableView
.
reloadRows
(
at
:
[[
0
,
0
]],
with
:
.
none
)
return
if
timePeriodCellFrame
==
.
zero
{
timePeriodCellFrame
=
tableView
.
cellForRow
(
at
:
[
0
,
0
])?
.
frame
??
.
zero
}
let
startPointY
=
timePeriodCellFrame
.
origin
.
y
+
timePeriodCellFrame
.
height
-
self
.
daysControlView
.
frame
.
height
if
scrollView
.
contentOffset
.
y
>=
startPointY
{
if
!
navVC
.
isNavigationBarHidden
{
...
...
Pods/Pods.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
bbf41fed
...
...
@@ -21,7 +21,7 @@
<
k
e
y
>
Cirque.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
4
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
3
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
Localize-Swift.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
...
...
@@ -40,14 +40,14 @@
<
k
e
y
>
isShown
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
2
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
1
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
SnapKit.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
isShown
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
3
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
2
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
XMLCoder.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
...
...
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