Conditions

Making a Condition

  • Makes a condition that evaluates to true if the left-hand variable equals the right-hand condition operand.

    Declaration

    Swift

    public func == (lhs: Variable, rhs: ConditionOperandConvertible) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    An equality condition.

  • Makes a condition that evaluates to true if the left-hand variable does not equal the right-hand condition operand.

    Declaration

    Swift

    public func != (lhs: Variable, rhs: ConditionOperandConvertible) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    An inequality condition.

  • Makes a condition that evaluates to true if the left-hand variable is greater than the right-hand condition operand.

    Declaration

    Swift

    public func < (lhs: Variable, rhs: ConditionNumberOperandConvertible) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    A “greater than” condition.

  • Makes a condition that evaluates to true if the left-hand variable is greater than or equal to the right-hand condition operand.

    Declaration

    Swift

    public func <= (lhs: Variable, rhs: ConditionNumberOperandConvertible) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    A “greater than or equal to” condition.

  • Makes a condition that evaluates to true if the left-hand variable is less than the right-hand condition operand.

    Declaration

    Swift

    public func > (lhs: Variable, rhs: ConditionNumberOperandConvertible) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    A “less than” condition.

  • Makes a condition that evaluates to true if the left-hand variable is less than or equal to the right-hand condition operand.

    Declaration

    Swift

    public func >= (lhs: Variable, rhs: ConditionNumberOperandConvertible) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    A “less than or equal to” condition.

  • Makes a condition that evaluates to true if the left-hand variable falls between the range in the right-hand condition operand.

    Declaration

    Swift

    public func ~= (lhs: Variable, rhs: ClosedRange<Number>) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    An “is between” condition.

  • Makes a condition that evaluates to true if the left-hand variable falls between the range in the right-hand condition operand.

    Declaration

    Swift

    public func ~= (lhs: Variable, rhs: (lowerBound: ConditionNumberOperandConvertible, upperBound: ConditionNumberOperandConvertible)) -> Condition

    Parameters

    lhs

    A variable.

    rhs

    A value that can be converted to a condition operand

    Return Value

    An “is between” condition.