Initializer

init(value:variance:)

Creates and initializes a new range object using a value and a maximum distance from that value.

Declaration

convenience init(value: CGFloat, variance: CGFloat)

Parameters

value

The midpoint for the range.

variance

The maximum amount that a value may differ from the midpoint.

Return Value

A newly initialized range object whose minimum value is value-variance and whose maximum value is value+variance.

See Also

Creating a Range Object

class func withNoLimits() -> Self

Creates and initializes a new range object that encompasses all possible values.

init(lowerLimit: CGFloat)

Creates and initializes a new range object that specifies only a minimum value.

init(upperLimit: CGFloat)

Creates and initializes a new range object that specifies only a maximum value.

init(constantValue: CGFloat)

Creates and initializes a new range object that specifies a constant value.

init(lowerLimit: CGFloat, upperLimit: CGFloat)

Initializes a new range object.