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
e13f57af
Commit
e13f57af
authored
Apr 30, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save UV index to CoreData.
parent
fb670756
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
+10
-1
1Weather/Storage/CoreData/1WModel.xcdatamodeld/Model.xcdatamodel/contents
+2
-1
1Weather/Storage/CoreData/Objects/Human/CoreCurrentWeather.swift
+4
-0
1Weather/Storage/CoreData/Objects/Machine/_CoreCurrentWeather.swift
+4
-0
No files found.
1Weather/Storage/CoreData/1WModel.xcdatamodeld/Model.xcdatamodel/contents
View file @
e13f57af
...
...
@@ -31,6 +31,7 @@
<attribute
name=
"temp"
optional=
"YES"
attributeType=
"Binary"
/>
<attribute
name=
"timeZone"
attributeType=
"String"
/>
<attribute
name=
"type"
attributeType=
"String"
/>
<attribute
name=
"uv"
optional=
"YES"
attributeType=
"Decimal"
defaultValueString=
"0"
/>
<attribute
name=
"visibility"
optional=
"YES"
attributeType=
"Binary"
/>
<attribute
name=
"weekDay"
attributeType=
"String"
/>
<attribute
name=
"windDirection"
optional=
"YES"
attributeType=
"String"
/>
...
...
@@ -126,7 +127,7 @@
<elements>
<element
name=
"CoreAirQuality"
positionX=
"438.48828125"
positionY=
"-201.96875"
width=
"128"
height=
"88"
/>
<element
name=
"CoreAppData"
positionX=
"114.79296875"
positionY=
"-494.5078125"
width=
"128"
height=
"73"
/>
<element
name=
"CoreCurrentWeather"
positionX=
"-105.953125"
positionY=
"-203.82421875"
width=
"128"
height=
"4
33
"
/>
<element
name=
"CoreCurrentWeather"
positionX=
"-105.953125"
positionY=
"-203.82421875"
width=
"128"
height=
"4
48
"
/>
<element
name=
"CoreDailyWeather"
positionX=
"270.5546875"
positionY=
"-505.83203125"
width=
"128"
height=
"313"
/>
<element
name=
"CoreHealth"
positionX=
"277.1640625"
positionY=
"-156.77734375"
width=
"128"
height=
"103"
/>
<element
name=
"CoreHourlyWeather"
positionX=
"279.15234375"
positionY=
"-29.234375"
width=
"128"
height=
"253"
/>
...
...
1Weather/Storage/CoreData/Objects/Human/CoreCurrentWeather.swift
View file @
e13f57af
...
...
@@ -27,6 +27,7 @@ open class CoreCurrentWeather: _CoreCurrentWeather, CoreDataAppModelConvertable
result
.
visibility
=
try
CoreDataUtils
.
measurement
(
from
:
self
.
visibility
,
in
:
self
,
attributeName
:
"visibility"
)
result
.
pressure
=
try
CoreDataUtils
.
measurement
(
from
:
self
.
pressure
,
in
:
self
,
attributeName
:
"pressure"
)
result
.
uv
=
self
.
uv
?
.
intValue
result
.
sunrise
=
self
.
sunrise
result
.
sunset
=
self
.
sunset
result
.
sunState
=
try
CoreDataUtils
.
appValueOptional
(
name
:
"sunState"
,
value
:
self
.
sunState
,
in
:
self
)
...
...
@@ -71,6 +72,9 @@ open class CoreCurrentWeather: _CoreCurrentWeather, CoreDataAppModelConvertable
self
.
visibility
=
try
CoreDataUtils
.
measurementToData
(
appModel
.
visibility
,
in
:
self
,
attributeName
:
"visibility"
)
self
.
pressure
=
try
CoreDataUtils
.
measurementToData
(
appModel
.
pressure
,
in
:
self
,
attributeName
:
"pressure"
)
if
let
uv
=
appModel
.
uv
{
self
.
uv
=
NSDecimalNumber
(
value
:
uv
)
}
self
.
sunrise
=
appModel
.
sunrise
self
.
sunset
=
appModel
.
sunset
self
.
sunState
=
appModel
.
sunState
?
.
rawValue
...
...
1Weather/Storage/CoreData/Objects/Machine/_CoreCurrentWeather.swift
View file @
e13f57af
...
...
@@ -26,6 +26,7 @@ public enum CoreCurrentWeatherAttributes: String {
case
temp
=
"temp"
case
timeZone
=
"timeZone"
case
type
=
"type"
case
uv
=
"uv"
case
visibility
=
"visibility"
case
weekDay
=
"weekDay"
case
windDirection
=
"windDirection"
...
...
@@ -130,6 +131,9 @@ open class _CoreCurrentWeather: NSManagedObject {
var
type
:
String
!
@NSManaged
open
var
uv
:
NSDecimalNumber
?
@NSManaged
open
var
visibility
:
Data
?
@NSManaged
open
...
...
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