UAVersionMatcher

Objective-C

@interface UAVersionMatcher : NSObject

Swift

class UAVersionMatcher : NSObject

Version matcher.

  • The original versionConstraint used to create this matcher

    Declaration

    Objective-C

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

    Swift

    var versionConstraint: String { get }
  • Create a matcher for the supplied version contraint

    Declaration

    Objective-C

    + (nullable instancetype)matcherWithVersionConstraint:
        (nonnull NSString *)versionConstraint;

    Swift

    convenience init?(versionConstraint: String)

    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

Version Matcher Evaluation

  • Evaluates the object with the matcher.

    Declaration

    Objective-C

    - (BOOL)evaluateObject:(nullable id)object;

    Swift

    func evaluateObject(_ object: Any?) -> Bool

    Parameters

    object

    The object to evaluate.

    Return Value

    YES if the matcher matches the object, otherwise NO.

  • Check if versionConstraint matches the “exact version” pattern

    Declaration

    Objective-C

    + (BOOL)isExactVersion:(nonnull NSString *)versionConstraint;

    Swift

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

    Parameters

    versionConstraint

    constraint string

    Return Value

    YES if versionConstraint matches the “exact version” pattern

  • Check if versionConstraint matches the “sub version” pattern

    Declaration

    Objective-C

    + (BOOL)isSubVersion:(nonnull NSString *)versionConstraint;

    Swift

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

    Parameters

    versionConstraint

    constraint string

    Return Value

    YES if versionConstraint matches the “sub version” pattern

  • Check if versionConstraint matches the “version range” pattern

    Declaration

    Objective-C

    + (BOOL)isVersionRange:(nonnull NSString *)versionConstraint;

    Swift

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

    Parameters

    versionConstraint

    constraint string

    Return Value

    YES if versionConstraint matches the “version range” pattern