-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (experimental) add sparkle, closes #5
- Loading branch information
1 parent
2cefeb8
commit b477a0f
Showing
6 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// UpdaterVM.swift | ||
// gitimoji | ||
// | ||
// Created by Timo Zacherl on 16.12.21. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
import Sparkle | ||
|
||
final class UpdaterViewModel: ObservableObject { | ||
private let updaterController: SPUStandardUpdaterController | ||
|
||
@Published var canCheckForUpdates = false | ||
|
||
init() { | ||
updaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil) | ||
|
||
updaterController.updater.publisher(for: \.canCheckForUpdates) | ||
.assign(to: &$canCheckForUpdates) | ||
} | ||
|
||
func checkForUpdates() { | ||
updaterController.checkForUpdates(nil) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters