Version

public struct Version : Equatable, Hashable, Codable
extension Version: Comparable
extension Version: CustomStringConvertible

Represents a generic version with major and minor fields.

  • The major field of the version, such as 1 in version 1.5.3.

    Declaration

    Swift

    public let major: UInt8
  • The minor field of the version, such as 5 in version 1.5.3.

    Declaration

    Swift

    public let minor: UInt8
  • The patch field of the version, such as 3 in version 1.5.3.

    Declaration

    Swift

    public let patch: UInt8?
  • Creates a new version with the provided values.

    Declaration

    Swift

    public init(major: UInt8, minor: UInt8, patch: UInt8? = 0)

    Parameters

    major

    The major field of the version.

    minor

    The minor field of the version.

    patch

    The patch field of the version.

  • Declaration

    Swift

    public static func < (lhs: Version, rhs: Version) -> Bool
  • Declaration

    Swift

    public static func == (lhs: Version, rhs: Version) -> Bool
  • Creates a new Version object from a string representation, e.g. ‘1.5.3’.

    Declaration

    Swift

    public init(value: String)

    Parameters

    value

    A string representation of the version.

    Return Value

    A new version object that represents the given string value.

  • Declaration

    Swift

    public var description: String { get }
  • Version 1.0

    Declaration

    Swift

    static let version1_0: Version
  • Version 1.1

    Declaration

    Swift

    static let version1_1: Version
  • Version 2.0

    Declaration

    Swift

    static let version2_0: Version