Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
Documentation
SDLVersion

SDLVersion Class Reference

Section Contents

Overview

Specifies a major / minor / patch version number for semantic versioning purposes and comparisons

major

Major version (e.g. X.0.0)

Objective-C

@property (nonatomic) NSUInteger major;

Swift

var major: UInt { get set }

minor

Minor version (e.g. 0.X.0)

Objective-C

@property (nonatomic) NSUInteger minor;

Swift

var minor: UInt { get set }

patch

Patch version (e.g. 0.0.X)

Objective-C

@property (nonatomic) NSUInteger patch;

Swift

var patch: UInt { get set }

stringVersion

A String format of the current SDLVersion

Objective-C

@property (nonatomic, copy, readonly) NSString *_Nonnull stringVersion;

Swift

var stringVersion: String { get }

-initWithMajor:minor:patch:

Convenience init

Objective-C

- (nonnull instancetype)initWithMajor:(NSUInteger)major
                                minor:(NSUInteger)minor
                                patch:(NSUInteger)patch;

Swift

init(major: UInt, minor: UInt, patch: UInt)

Parameters

major

Major version

minor

Minor version

patch

Patch version

Return Value

An SDLVersion object

+versionWithMajor:minor:patch:

Convenience init

Objective-C

+ (nonnull instancetype)versionWithMajor:(NSUInteger)major
                                   minor:(NSUInteger)minor
                                   patch:(NSUInteger)patch;

Parameters

major

Major version

minor

Minor version

patch

Patch version

Return Value

An SDLVersion object

-initWithString:

Convenience init

Objective-C

- (nullable instancetype)initWithString:(nonnull NSString *)versionString;

Swift

init?(string versionString: String)

Parameters

versionString

String representation of the version

Return Value

An SDLVersion object

+versionWithString:

Convenience init

Objective-C

+ (nullable instancetype)versionWithString:(nonnull NSString *)versionString;

Parameters

versionString

String representation of the version

Return Value

An SDLVersion object

-initWithSDLMsgVersion:

Convenience init to set version using SDLMsgVersion

Objective-C

- (nonnull instancetype)initWithSDLMsgVersion:
    (nonnull SDLMsgVersion *)sdlMsgVersion;

Swift

init(sdlMsgVersion: SDLMsgVersion)

Parameters

sdlMsgVersion

Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application.

Return Value

An SDLVersion object

+versionWithSDLMsgVersion:

Convenience init to set version using SDLMsgVersion

Objective-C

+ (nonnull instancetype)versionWithSDLMsgVersion:
    (nonnull SDLMsgVersion *)sdlMsgVersion;

Parameters

sdlMsgVersion

Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application.

Return Value

SDLVersion object

-compare:

Compare two SDLVersions

Objective-C

- (NSComparisonResult)compare:(nonnull SDLVersion *)otherVersion;

Swift

func compare(_ otherVersion: SDLVersion) -> ComparisonResult

-isLessThanVersion:

Compare is less than

Objective-C

- (BOOL)isLessThanVersion:(nonnull SDLVersion *)otherVersion;

Swift

func isLessThanVersion(_ otherVersion: SDLVersion) -> Bool

Parameters

otherVersion

SDLVersion Object

Return Value

BOOL

-isEqualToVersion:

Compare is equal to

Objective-C

- (BOOL)isEqualToVersion:(nonnull SDLVersion *)otherVersion;

Swift

func isEqual(to otherVersion: SDLVersion) -> Bool

Parameters

otherVersion

SDLVersion Object

Return Value

BOOL

-isGreaterThanVersion:

Compare is greater than

Objective-C

- (BOOL)isGreaterThanVersion:(nonnull SDLVersion *)otherVersion;

Swift

func isGreaterThanVersion(_ otherVersion: SDLVersion) -> Bool

Parameters

otherVersion

SDLVersion Object

Return Value

BOOL

-isGreaterThanOrEqualToVersion:

Compare is greater than or equal to

Objective-C

- (BOOL)isGreaterThanOrEqualToVersion:(nonnull SDLVersion *)otherVersion;

Swift

func isGreaterThanOrEqual(to otherVersion: SDLVersion) -> Bool

Parameters

otherVersion

SDLVersion Object

Return Value

BOOL

-isLessThanOrEqualToVersion:

Compare is less than or equal to

Objective-C

- (BOOL)isLessThanOrEqualToVersion:(nonnull SDLVersion *)otherVersion;

Swift

func isLessThanOrEqual(to otherVersion: SDLVersion) -> Bool

Parameters

otherVersion

SDLVersion Object

Return Value

BOOL

View on GitHub.com
Previous Section Next Section