Version 0.0.0-0

Public members

GitHubUpdaterDelegate Reference

File
GitHubUpdates/GitHubUpdaterDelegate.h
Copyright
© (c) 2017, Jean-David Gadina - www.xs-labs.com
Date
Sunday, June 18, 2017
Includes
  • <Cocoa/Cocoa.h>

Protocol GitHubUpdaterDelegate

Attributes

Extends Protocol
NSObject

- classForUpdaterInstallWindowController: Top

Returns the class to use for the install window controller.

- ( Class )classForUpdaterInstallWindowController: ( GitHubUpdater * )updater;

Discussion

This allows you to specify a custom class for the install window controller, if you need customization. Note that the returned class must inherit from `GitHubInstallWindowController`.

Parameters
  • updater
    The updater object
Return value

The class to use

Notes: This method is optional.

- classForUpdaterProgressWindowController: Top

Returns the class to use for the progress window controller.

- ( Class )classForUpdaterProgressWindowController: ( GitHubUpdater * )updater;

Discussion

This allows you to specify a custom class for the progress window controller, if you need customization. Note that the returned class must inherit from `GitHubProgressWindowController`.

Parameters
  • updater
    The updater object
Return value

The class to use

Notes: This method is optional.

- updater:didShowInstallWindowController: Top

Called when the updater has shown an install window.

- ( void )updater: ( GitHubUpdater * )updater didShowInstallWindowController: ( GitHubInstallWindowController * )controller;

Parameters
  • updater
    The updater object
  • controller
    The window controller
Notes: This method is optional.

- updater:didShowProgressWindowController: Top

Called when the updater has shown a progress window.

- ( void )updater: ( GitHubUpdater * )updater didShowProgressWindowController: ( GitHubProgressWindowController * )controller;

Parameters
  • updater
    The updater object
  • controller
    The window controller
Notes: This method is optional.

- updater:didShowProgressWindowController: Top

Called when the updater has shown an install window.

- ( void )updater: ( GitHubUpdater * )updater didShowInstallWindowController: ( GitHubInstallWindowController * )controller;

Parameters
  • updater
    The updater object
  • controller
    The window controller
Notes: This method is optional.

- updater:releasesWithData:error: Top

Gets releases from a data object

- ( nullable NSArray< GitHubRelease * > * )updater: ( GitHubUpdater * )updater releasesWithData: ( NSData * )data error: ( NSError * __autoreleasing * )error;

Discussion

You may implement this method if you need to customize the parsing of updates data, with a different behaviour than using JSON data from GitHub releases.

Parameters
  • updater
    The updater object
  • data
    The data object fetched from the update URL
  • error
    An optional pointer to an error object
Return value

An array of release objects, if any

Notes: This method is optional.

- updater:urlForUpdatesWithUser:repository:proposedURL: Top

Returns the URL for the update check.

- ( NSURL * )updater: ( GitHubUpdater * )updater urlForUpdatesWithUser: ( NSString * )user repository: ( NSString * )repository proposedURL: ( NSURL * )proposedURL;

Discussion

You may implement this if you need to customize the update URL, for instance if you use another servcie than GitHub.

Parameters
  • updater
    The updater object
  • user
    The user name
  • repository
    The repository name
  • proposedURL
    The proposed, default URL
Notes: This method is optional.

- updater:version:isNewerThanVersion: Top

Determines if a version is newer than another version

- ( BOOL )updater: ( GitHubUpdater * )updater version: ( GitHubVersion * )v1 isNewerThanVersion: ( GitHubVersion * )v2;

Discussion

You may implement this method if you need to customize the way versions are compared.

Parameters
  • updater
    The updater object
  • v1
    The first version
  • v2
    The second version
Return value

YES if the first version is newer, otherwise NO

Notes: This method is optional.

- updater:versionForRelease: Top

Gets a version object for a release.

- ( GitHubVersion * )updater: ( GitHubUpdater * )updater versionForRelease: ( GitHubRelease * )release;

Discussion

You may implement this method if you need to customize the way version numbers are created from releases. If not implemented, the tag name will be used as version number.

Parameters
  • updater
    The updater object
  • release
    The release object
Return value

A version object for the release

Notes: This method is optional.

- updater:willCloseInstallWindowController: Top

Called when the updater is about to close an install window.

- ( void )updater: ( GitHubUpdater * )updater willCloseInstallWindowController: ( GitHubInstallWindowController * )controller;

Parameters
  • updater
    The updater object
  • controller
    The window controller
Notes: This method is optional.

- updater:willCloseProgressWindowController: Top

Called when the updater is about to close a progress window.

- ( void )updater: ( GitHubUpdater * )updater willCloseProgressWindowController: ( GitHubProgressWindowController * )controller;

Parameters
  • updater
    The updater object
  • controller
    The window controller
Notes: This method is optional.

- updater:willDisplayAlert:withError: Top

Called when the updater is about to display an error alert.

- ( void )updater: ( GitHubUpdater * )updater willDisplayAlert: ( NSAlert * )alert withError: ( NSError * )error;

Parameters
  • updater
    The updater object
  • alert
    The alert object
  • error
    The error object
Notes: This method is optional.

- updater:willDisplayUpToDateAlert: Top

Called when the updater is about to display an up-to-date alert.

- ( void )updater: ( GitHubUpdater * )updater willDisplayUpToDateAlert: ( NSAlert * )alert;

Parameters
  • updater
    The updater object
  • alert
    The alert object
Notes: This method is optional.

- updater:willShowInstallWindowController: Top

Called when the updater is about to show an install window.

- ( void )updater: ( GitHubUpdater * )updater willShowInstallWindowController: ( GitHubInstallWindowController * )controller;

Parameters
  • updater
    The updater object
  • controller
    The window controller
Notes: This method is optional.

- updater:willShowProgressWindowController: Top

Called when the updater is about to show a progress window.

- ( void )updater: ( GitHubUpdater * )updater willShowProgressWindowController: ( GitHubProgressWindowController * )controller;

Parameters
  • updater
    The updater object
  • controller
    The window controller
Notes: This method is optional.

- updaterShouldCheckForDrafts: Top

Implement if you need to check for draft updates.

- ( BOOL )updaterShouldCheckForDrafts: ( GitHubUpdater * )updater;

Parameters
  • updater
    The updater object
Return value

YES if the updater should check for draft updates, otherwise NO

Notes: This method is optional.

- updaterShouldCheckForPrereleases: Top

Implement if you need to check for prerelease updates.

- ( BOOL )updaterShouldCheckForPrereleases: ( GitHubUpdater * )updater;

Parameters
  • updater
    The updater object
Return value

YES if the updater should check for prerelease updates, otherwise NO

Notes: This method is optional.

- updaterShouldCheckForUpdatesInBackground: Top

Whether the updater is allowed to check for updates in background.

- ( BOOL )updaterShouldCheckForUpdatesInBackground: ( GitHubUpdater * )updater;

Discussion

By implementing this method, you can control if the updater can check for updates in background. This method has no effect on user-initiated update checks, using `- [ GitHubUpdater checkForUpdates: ]`. It will only be able to control `- [ GitHubUpdater checkForUpdatesInBackground ]`.

Parameters
  • updater
    The updater object
Return value

YES if the updater should check for updates in background, otherwise NO

Notes: This method is optional.