add Sparkle appcast
This commit is contained in:
26
Sources/ViewModels/SparkleUpdater.swift
Normal file
26
Sources/ViewModels/SparkleUpdater.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user