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
7e7fd246
Commit
7e7fd246
authored
Oct 07, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-292: fix incorrect temperature on the minutely legend.
parent
4555a346
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
1Weather/UI/SharedViews/MinutelyForecastView/MinutelyForecastView.swift
+5
-5
No files found.
1Weather/UI/SharedViews/MinutelyForecastView/MinutelyForecastView.swift
View file @
7e7fd246
...
...
@@ -350,13 +350,13 @@ class MinutelyForecastView: UIView {
private
func
updateTemperatureChart
()
{
guard
let
maxTemp
=
(
minutelyForecast
.
compactMap
{
$0
.
temp
}
.
max
{
$0
.
value
<
$1
.
value
}
),
let
minTemp
=
(
minutelyForecast
.
compactMap
{
$0
.
temp
}
.
min
{
$0
.
value
<
$1
.
value
}
)
let
maxTemp
=
(
minutelyForecast
.
compactMap
{
$0
.
temp
}
.
max
{
$0
<
$1
}
),
let
minTemp
=
(
minutelyForecast
.
compactMap
{
$0
.
temp
}
.
min
{
$0
<
$1
}
)
else
{
return
}
var
uniqTemps
=
minutelyForecast
.
compactMap
{
$0
.
temp
}
.
unique
()
.
sorted
{
$0
.
value
>
$1
.
value
}
var
uniqTemps
=
minutelyForecast
.
compactMap
{
$0
.
temp
}
.
sorted
{
$0
>
$1
}
.
map
{
$0
.
settingsConverted
.
shortString
}
.
unique
()
if
uniqTemps
.
count
>
4
{
let
uniqMax
=
uniqTemps
.
removeFirst
()
let
uniqMin
=
uniqTemps
.
removeLast
()
...
...
@@ -370,9 +370,9 @@ class MinutelyForecastView: UIView {
uniqTemps
=
[
uniqMax
,
firstHalfTemp
,
secondHalfTemp
,
uniqMin
]
}
for
temp
in
uniqTemps
{
for
temp
String
in
uniqTemps
{
let
label
=
UILabel
()
label
.
text
=
temp
.
settingsConverted
.
short
String
label
.
text
=
tempString
label
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
10
)
label
.
setContentHuggingPriority
(
.
fittingSizeLevel
,
for
:
.
vertical
)
label
.
sizeToFit
()
...
...
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