XCode project for app, moved app project to folder

This commit is contained in:
Joe Mattiello
2023-03-01 22:07:19 -05:00
parent 365cadbb31
commit 4c9c5b1a56
371 changed files with 625 additions and 39 deletions

View File

@@ -0,0 +1,31 @@
//
// ViewAppIntentHandler.swift
// ViewAppIntentHandler
//
// Created by Riley Testut on 7/10/20.
// Copyright © 2020 Riley Testut. All rights reserved.
//
import Intents
import Shared
import SideStoreCore
@available(iOS 14, *)
public class ViewAppIntentHandler: NSObject, ViewAppIntentHandling {
public func provideAppOptionsCollection(for _: ViewAppIntent, with completion: @escaping (INObjectCollection<App>?, Error?) -> Void) {
DatabaseManager.shared.start { error in
if let error = error {
print("Error starting extension:", error)
}
DatabaseManager.shared.persistentContainer.performBackgroundTask { context in
let apps = InstalledApp.all(in: context).map { installedApp in
App(identifier: installedApp.bundleIdentifier, display: installedApp.name)
}
let collection = INObjectCollection(items: apps)
completion(collection, nil)
}
}
}
}