VersionMatcher

@objc(UAVersionMatcher)
public class VersionMatcher : NSObject

Version matcher.

  • The original versionConstraint used to create this matcher

    Declaration

    Swift

    public let versionConstraint: String
  • Create a matcher for the supplied version constraint

    Declaration

    Swift

    @objc(matcherWithVersionConstraint:)
    public class func matcher(versionConstraint: String) -> VersionMatcher?

    Parameters

    versionConstraint

    constraint that matches one of our supported patterns

    Return Value

    matcher or nil if versionConstraint does not match any of the expected patterns

Evaluate version against constraint

  • Evaluates the object with the matcher.

    Declaration

    Swift

    @objc(evaluateObject:)
    public func evaluate(_ value: Any?) -> Bool

    Parameters

    value

    The object to evaluate.

    Return Value

    true if the matcher matches the object, otherwise false.

  • Check if versionConstraint matches the “exact version” pattern

    Declaration

    Swift

    @objc
    public class func isExactVersion(_ versionConstraint: String) -> Bool

    Parameters

    versionConstraint

    constraint string

    Return Value

    true if versionConstraint matches the “exact version” pattern

SubVersion Matcher

  • Check if versionConstraint matches the “sub version” pattern

    Declaration

    Swift

    @objc
    public class func isSubVersion(_ versionConstraint: String) -> Bool

    Parameters

    versionConstraint

    constraint string

    Return Value

    true if versionConstraint matches the “sub version” pattern

  • Check if versionConstraint matches the “version range” pattern

    Declaration

    Swift

    @objc
    public class func isVersionRange(_ versionConstraint: String) -> Bool

    Parameters

    versionConstraint

    constraint string

    Return Value

    true if versionConstraint matches the “version range” pattern