I'm trying to use Sparkle's UpdaterDelegate to perform some action when a specific change occurs in the update state of my app. But I don't know how to attach it to my update controller.
First I declared a SPUStandardUpdaterController
SPUStandardUpdaterController(
startingUpdater: true,
updaterDelegate: UpdaterDelegate(),
userDriverDelegate: nil
)
Then I declared an UpdaterDelegate
class UpdaterDelegate: NSObject, SPUUpdaterDelegate {
// some delegate functions here
}
Then I tried to debug the code, but I didn't see any output of the delegate method on the console.
I'm very confused because it seems that either of my methods are correct, but the delegate method just doesn't have the correct link.
I would suspect that your delegate is not called because it is not stored properly.
Check in the debugger output how long your delegate "lives", with the old trick:
For reference, here is the App structure of one of my apps stripped down to a bare minimum to run Sparkle:
You can see that I store
updaterControllerandupdaterDelegatefor the whole lifecycle of the app.