Files
iKeyMon/Sources/ViewModels/SparkleUpdater.swift
2025-11-25 16:21:07 +01:00

27 lines
792 B
Swift

import Sparkle
import Foundation
@MainActor
final class SparkleUpdater: NSObject, ObservableObject {
let controller: SPUStandardUpdaterController
override init() {
self.controller = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
super.init()
}
var automaticallyChecksForUpdates: Bool {
get { controller.updater.automaticallyChecksForUpdates }
set { controller.updater.automaticallyChecksForUpdates = newValue }
}
var automaticallyDownloadsUpdates: Bool {
get { controller.updater.automaticallyDownloadsUpdates }
set { controller.updater.automaticallyDownloadsUpdates = newValue }
}
func checkForUpdates() {
controller.checkForUpdates(nil)
}
}