work around widgets ... not sure if they work

This commit is contained in:
Trey t
2022-01-15 18:05:48 -06:00
parent 0298b3bf5e
commit 7c2de764b4
23 changed files with 375 additions and 199 deletions

View File

@@ -12,21 +12,15 @@ import WidgetKit
// AppDelegate.swift
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// PersistenceController.shared.clearDB()
NotificationCenter.default.addObserver(self,
selector: #selector(fetchChanges),
name: .NSPersistentStoreRemoteChange,
object: PersistenceController.shared.container.persistentStoreCoordinator)
application.registerForRemoteNotifications()
UNUserNotificationCenter.current().delegate = self
return true
}
@objc func fetchChanges(note: Notification) {
WidgetCenter.shared.reloadAllTimelines()
}
}
extension AppDelegate: UNUserNotificationCenterDelegate {