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
Expiryfrom a raw millisecond timestamp, using the same sentinel values asexpiryTime().Declaration
Swift
public init(timestamp milliseconds: Int64)Parameters
millisecondsA Unix millisecond timestamp, or
-1for.forever,-2for.session,-3for.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
View on GitHub