App builds in xcodeproj (todo widget)

This commit is contained in:
Joe Mattiello
2023-03-02 00:40:11 -05:00
parent 4c9c5b1a56
commit f49fa24743
49 changed files with 498 additions and 295 deletions

View File

@@ -9,6 +9,7 @@
import Foundation
import SideStoreCore
import Intents
import os.log
@available(iOS 14, *)
public final class IntentHandler: NSObject, RefreshAllIntentHandling {
@@ -107,7 +108,7 @@ private extension IntentHandler {
} catch RefreshError.noInstalledApps {
self.finish(intent, response: RefreshAllIntentResponse(code: .success, userActivity: nil))
} catch let error as NSError {
print("Failed to refresh apps in background.", error)
os_log("Failed to refresh apps in background. %@", type: .error , error.localizedDescription)
self.finish(intent, response: RefreshAllIntentResponse.failure(localizedDescription: error.localizedFailureReason ?? error.localizedDescription))
}

View File

@@ -9,14 +9,17 @@
import Intents
import Shared
import SideStoreCore
import os.log
@available(iOS 14, *)
public class ViewAppIntentHandler: NSObject, ViewAppIntentHandling {
public func provideAppOptionsCollection(for _: ViewAppIntent, with completion: @escaping (INObjectCollection<App>?, Error?) -> Void) {
public func provideAppOptionsCollection(for intent: ViewAppIntent, with completion: @escaping (INObjectCollection<App>?, Error?) -> Void) {
DatabaseManager.shared.start { error in
if let error = error {
print("Error starting extension:", error)
}
os_log("Error starting extension: %@", type: .error , error.localizedDescription)
} else {
os_log("Started extension: %@", type: .info , intent.debugDescription)
}
DatabaseManager.shared.persistentContainer.performBackgroundTask { context in
let apps = InstalledApp.all(in: context).map { installedApp in