AppVersion

open class AppVersion

AppVersion provides a set of properties and methods to configure app update tracking behaviour. Can be used as singleton through shared property, or through a set of static variables and methods

  • Update-suggestion UI Alert Type, used to set the desired update workflow

    See more

    Declaration

    Swift

    public enum AlertType
  • AppVersion Singleton

    Declaration

    Swift

    public static let shared: AppVersion
  • Delegate chaining AppVersionDelegate methods

    Declaration

    Swift

    public weak var delegate: AppVersionDelegate?
  • Defines the frequency of App Store update requests in days, default: 0 - means with each app launch

    Declaration

    Swift

    public var updateFrequency: UInt
  • Checks you want to make before presenting update-suggesting UI. If returns true - UI will be presented, if false UI will be supressed

    Declaration

    Swift

    public var checkBeforeUpdatePresented: (() -> Bool)
  • Inforfmation about the latest version available in App Store

    Declaration

    Swift

    public var appStoreVersionInfo: AppStoreVersion? { get }
  • Allows user to silence update-suggestion UI forever, i.e. alert will be never shown again. False by default

    Declaration

    Swift

    public var neverEnabled: Bool
  • Enables update-suggestion UI Alerts. False by default

    Declaration

    Swift

    public var alertsEnabled: Bool
  • Disables update-suggestion UI Alerts for Minor updates. False by default

    Declaration

    Swift

    public var minorAlertsDisabled: Bool
  • Disables update-suggestion UI Alerts for Patch updates. False by default

    Declaration

    Swift

    public var patchAlertsDisabled: Bool
  • UIAlertController alert presentation style. alert by default

    Declaration

    Swift

    public var alertPresentationStyle: UIAlertController.Style
  • Update-suggestion UI Alert Type, unskippable by default. Rewrites alertTypeMajor,alertTypeMinor and alertTypePatch when set.

    Declaration

    Swift

    public var alertType: AppVersion.AlertType { get set }
  • Update-suggestion UI Alert Type for Major update, unskippable by default.

    Declaration

    Swift

    public var alertTypeMajor: AppVersion.AlertType?
  • Update-suggestion UI Alert Type for Minor update, unskippable by default.

    Declaration

    Swift

    public var alertTypeMinor: AppVersion.AlertType?
  • Update-suggestion UI Alert Type for Patch update, unskippable by default.

    Declaration

    Swift

    public var alertTypePatch: AppVersion.AlertType?
  • Initializes AppVersion, call it from application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions:…) delegate in your AppDelegate Logs app launch and checks for an update in App Store

    Declaration

    Swift

    public func run()
  • Checks for update, non-blocking. Use it when you need to force the check ignoring updateFrequency setting

    Declaration

    Swift

    public func checkAppStoreForUpdateNow()
  • Resets all persistance information stored by AppVersion: version launch history and user preferences(skip, never)

    Declaration

    Swift

    public func resetAppVersionState()
  • Date on which last check for update was performed

    Declaration

    Swift

    public var lastCheckDate: Date? { get }
  • Update version which user decided to skip

    Declaration

    Swift

    public var skipVersion: Version? { get }
  • Version history installed & launched on this device, contains launch counts for each version. Not preserved between reinstalls

    Declaration

    Swift

    public var versionHistory: [Version : Int]? { get }
  • Returns number of launches for this version

    Declaration

    Swift

    public var launchesForThisVersion: Int { get }
  • Indicates if user asked to silence update-suggesting UI alerts

    Declaration

    Swift

    public var neverShowAlert: Bool { get }