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
2d06a627
Commit
2d06a627
authored
May 28, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished scrolling performance optimization
parent
d735d7db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+1
-1
1Weather/UI/Helpers/ForecastTimePeriod/GraphLine.swift
+8
-5
1Weather/UI/SharedCells/PrecipCell/PrecipButton.swift
+5
-0
No files found.
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2d06a627
...
...
@@ -12,7 +12,7 @@
<
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
>
5
1
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
5
3
<
/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/Helpers/ForecastTimePeriod/GraphLine.swift
View file @
2d06a627
...
...
@@ -54,8 +54,8 @@ struct GraphLine {
tintLineShape
.
path
=
nil
}
private
mutating
func
linePath
(
from
points
:[
CGPoint
])
->
UIBezier
Path
{
let
path
=
UIBezier
Path
()
private
mutating
func
linePath
(
from
points
:[
CGPoint
])
->
CG
Path
{
let
path
=
CGMutable
Path
()
let
graphRect
=
self
.
onGetGraphRect
()
let
startPoint
=
CGPoint
(
x
:
graphRect
.
origin
.
x
,
y
:
points
.
first
?
.
y
??
0
)
let
endPoint
=
CGPoint
(
x
:
graphRect
.
width
,
y
:
points
.
last
?
.
y
??
0
)
...
...
@@ -80,8 +80,8 @@ struct GraphLine {
p3
:
pointsToAdd
[
index
]))
path
.
addCurve
(
to
:
pointsToAdd
[
index
],
control
Point
1
:
controlPoints
[
index
-
1
]
.
controlPoint1
,
control
Point
2
:
controlPoints
[
index
-
1
]
.
controlPoint2
)
control1
:
controlPoints
[
index
-
1
]
.
controlPoint1
,
control2
:
controlPoints
[
index
-
1
]
.
controlPoint2
)
}
return
path
...
...
@@ -134,6 +134,7 @@ struct GraphLine {
if
tintPath
.
isEmpty
{
return
}
tintLineShape
.
path
=
tintPath
.
cgPath
tintLineShape
.
shadowPath
=
tintPath
.
cgPath
.
copy
(
strokingWithWidth
:
settings
.
lineWidth
,
lineCap
:
.
butt
,
lineJoin
:
.
bevel
,
miterLimit
:
1
)
}
func
tintDotAt
(
point
:
CGPoint
)
{
...
...
@@ -175,6 +176,8 @@ struct GraphLine {
}
//Refresh line path
lineShape
.
path
=
self
.
linePath
(
from
:
points
)
.
cgPath
let
linePath
=
self
.
linePath
(
from
:
points
)
lineShape
.
path
=
linePath
lineShape
.
shadowPath
=
linePath
.
copy
(
strokingWithWidth
:
settings
.
lineWidth
,
lineCap
:
.
butt
,
lineJoin
:
.
bevel
,
miterLimit
:
1
)
}
}
1Weather/UI/SharedCells/PrecipCell/PrecipButton.swift
View file @
2d06a627
...
...
@@ -56,6 +56,11 @@ class PrecipButton: UIControl {
}
}
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
self
.
layer
.
shadowPath
=
UIBezierPath
(
roundedRect
:
self
.
bounds
,
cornerRadius
:
12
)
.
cgPath
}
override
func
traitCollectionDidChange
(
_
previousTraitCollection
:
UITraitCollection
?)
{
super
.
traitCollectionDidChange
(
previousTraitCollection
)
updateUI
()
...
...
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