NMAVersion
public class NMAVersion : NSObject
Represents a generic version with major and minor fields.
Warning
Maximum supported version is: 65535.65535.18446744073709551615.18446744073709551615Warning
Equality is done without build number, if build number checking is needed, please useisEqualWithBuild(_:)
and isLowerThanWithBuild(_:)
.
-
The major field of the version, such as 1 in version 1.5.3.4.
Declaration
Swift
@objc public var major: UInt16 { get }
-
The minor field of the version, such as 5 in version 1.5.3.4.
Declaration
Swift
@objc public var minor: UInt16 { get }
-
The patch field of the version, such as 3 in version 1.5.3.4.
Declaration
Swift
@objc public var patch: UInt64 { get }
-
The build number field of the version, such as 4 in version 1.5.3.4.
Declaration
Swift
@objc public var buildNumber: UInt64 { get }
-
Creates a new version with the provided values.
Declaration
Swift
@objc public init(major: UInt16, minor: UInt16, patch: UInt64 = 0, buildNumber: UInt64 = 0)
Parameters
major
The major field of the version.
minor
The minor field of the version.
patch
The patch field of the version.
buildNumber
The build number field of the version.
-
Creates a new Version object from a string representation, e.g. ‘1.5.3.4’.
Declaration
Swift
@objc public init(value: String)
Parameters
value
A string representation of the version.
Return Value
A new version object that represents the given string value.