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
a5fe1230
Commit
a5fe1230
authored
Jul 09, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-101: CoreDataStorage notifies the widget.
parent
cab0b358
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
CoreDataStorage/CoreDataStorage/CoreDataStorage.swift
+6
-0
No files found.
CoreDataStorage/CoreDataStorage/CoreDataStorage.swift
View file @
a5fe1230
...
@@ -9,6 +9,7 @@ import Foundation
...
@@ -9,6 +9,7 @@ import Foundation
import
CoreData
import
CoreData
import
OneWeatherCore
import
OneWeatherCore
import
OneWeatherAnalytics
import
OneWeatherAnalytics
import
WidgetKit
public
class
CoreDataStorage
:
Storage
{
public
class
CoreDataStorage
:
Storage
{
private
let
modelName
=
"1WModel"
private
let
modelName
=
"1WModel"
...
@@ -92,6 +93,11 @@ public class CoreDataStorage: Storage {
...
@@ -92,6 +93,11 @@ public class CoreDataStorage: Storage {
context
.
insert
(
coreAppData
)
context
.
insert
(
coreAppData
)
try
self
.
save
(
context
:
context
)
try
self
.
save
(
context
:
context
)
self
.
lastSavedAppData
=
appData
self
.
lastSavedAppData
=
appData
// This shouldn't be here in theory, but it's the simplest way to work around the DelayedSaveStorage.
// TODO: find a better place for it.
if
#available(iOS 14, *)
{
WidgetCenter
.
shared
.
reloadAllTimelines
()
}
}
}
self
.
log
.
info
(
"Save: success"
)
self
.
log
.
info
(
"Save: success"
)
}
}
...
...
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