Expiry

public enum Expiry : Equatable

The expiration type of some persisted value.

  • Expires when the session ends.

    Declaration

    Swift

    case session
  • Expires when the app restarts.

    Declaration

    Swift

    case untilRestart
  • Never expires.

    Declaration

    Swift

    case forever
  • Expires after the specified date.

    Declaration

    Swift

    case after(Date)
  • Creates an Expiry from a raw millisecond timestamp, using the same sentinel values as expiryTime().

    Declaration

    Swift

    public init(timestamp milliseconds: Int64)

    Parameters

    milliseconds

    A Unix millisecond timestamp, or -1 for .forever, -2 for .session, -3 for .untilRestart.

  • Returns the expiry encoded as a Unix millisecond timestamp, or a sentinel value for special cases.

    Sentinel values: -1 = .forever, -2 = .session, -3 = .untilRestart. All other values are a Unix millisecond timestamp corresponding to the expiry date.

    Declaration

    Swift

    public func expiryTime() -> Int64