Functions

The following functions are available globally.

  • Compares two images.

    Parameter

    Parameter left: The first image to compare.

    Parameter

    Parameter right: The second image to compare.

    Returns

    true if the two images are the same; otherwise false.

    Declaration

    Swift

    public func == (left:Image, right:Image) -> Bool

    Parameters

    left

    The first image to compare.

    right

    The second image to compare.

    Return Value

    true if the two images are the same; otherwise false.

  • Compares two Weak objects with the == operator.

    Parameter

    Parameter lhs: The first Weak object to compare.

    Parameter

    Parameter rhs: The second Weak object to compare.

    Returns

    true if the objects are equal; otherwise false.

    See more

    Declaration

    Swift

    public func ==<T:AnyObject>(lhs: Weak<T>, rhs: Weak<T>) -> Bool

    Parameters

    lhs

    The first Weak object to compare.

    rhs

    The second Weak object to compare.

    Return Value

    true if the objects are equal; otherwise false.

  • Checks if two Rect objects are equal.

    Parameter

    Parameter lhs: The first Rect to compare.

    Parameter

    Parameter rhs: The second Rect to compare.

    Returns

    true if the two Rect objects have the same location and size; otherwise false.

    Declaration

    Swift

    public func ==(lhs: Rect, rhs: Rect) -> Bool

    Parameters

    lhs

    The first Rect to compare.

    rhs

    The second Rect to compare.

    Return Value

    true if the two Rect objects have the same location and size; otherwise false.

  • Compares two Brush instances.

    Parameter

    Parameter left The first Brush to compare.

    Parameter

    Parameter right The second Brush to compare.

    Returns

    true if the Brush-es are equal; otherwise false.

    Declaration

    Swift

    public func ==(left:Brush, right:Brush) -> Bool

    Parameters

    left The first

    Brush to compare.

    right The second

    Brush to compare.

    Return Value

    true if the Brush-es are equal; otherwise false.

  • Compares two Style-s.

    Parameter

    Parameter left: The first Style to compare.

    Parameter

    Parameter right: The second Style to compare.

    Returns

    true if the Style-s are equal. otherwise false.

    Declaration

    Swift

    public func ==(left:Style, right:Style) -> Bool

    Parameters

    left

    The first Style to compare.

    right

    The second Style to compare.

    Return Value

    true if the Style-s are equal. otherwise false.

  • Compares two Metatype objects.

    Parameter

    Parameter left: The first Metatype object to compare.

    Parameter

    Parameter second: The second Metatype object to compare.

    Returns

    true if the Metatype objects are equal; otherwise false.

    See more

    Declaration

    Swift

    public func ==<T:AnyObject> (left:Metatype<T>, right:Metatype<T>) -> Bool

    Parameters

    left

    The first Metatype object to compare.

    second

    The second Metatype object to compare.

    Return Value

    true if the Metatype objects are equal; otherwise false.

  • Compares two Vector-s.

    Parameter

    Parameter v1: The first Vector to compare.

    Parameter

    Parameter v2: The second Vector to compare.

    Returns

    true if the Vector-s are equal; otherwise false.

    Declaration

    Swift

    public func ==(v1:Vector, v2:Vector) -> Bool

    Parameters

    v1

    The first Vector to compare.

    v2

    The second Vector to compare.

    Return Value

    true if the Vector-s are equal; otherwise false.

  • Multiplies the specified Vector by the specified scalar.

    Parameter

    Parameter vector: The Vector to multiply.

    Parameter

    Parameter scalar: The scalar by which the Vector is multiplied.

    Returns

    The result of the multiplication of the Vector with the scalar.

    Declaration

    Swift

    public func * (vector:Vector, scalar:Double) -> Vector

    Parameters

    vector

    The Vector to multiply.

    scalar

    The scalar by which the Vector is multiplied.

    Return Value

    The result of the multiplication of the Vector with the scalar.

  • Multiplies the specified scalar by the specified Vector.

    Parameter

    Parameter scalar: The scalar to multiply.

    Parameter

    Parameter vector: The Vector by which the scalar is multiplied.

    Returns

    The result of the multiplication of the scalar with the Vector.

    Declaration

    Swift

    public func * (scalar:Double, vector:Vector) -> Vector

    Parameters

    scalar

    The scalar to multiply.

    vector

    The Vector by which the scalar is multiplied.

    Return Value

    The result of the multiplication of the scalar with the Vector.

  • Multiplies the specified Vector by the specified scalar.

    Parameter

    Parameter vector: The Vector to multiply.

    Parameter

    Parameter scalar: The scalar by which the Vector is multiplied.

    Declaration

    Swift

    public func *= (vector:inout Vector, scalar:Double)

    Parameters

    vector

    The Vector to multiply.

    scalar

    The scalar by which the Vector is multiplied.

  • Divides the specified Vector by the specified scalar.

    Parameter

    Parameter vector: The Vector to divide.

    Parameter

    Parameter scalar: The scalar by which the Vector is divided.

    Returns

    The result of the division of the Vector with the scalar.

    Declaration

    Swift

    public func / (vector:Vector, scalar:Double) -> Vector

    Parameters

    vector

    The Vector to divide.

    scalar

    The scalar by which the Vector is divided.

    Return Value

    The result of the division of the Vector with the scalar.

  • Divides the specified Vector by the specified scalar.

    Parameter

    Parameter vector: The Vector to divide.

    Parameter

    Parameter scalar: The scalar by which the Vector is divided.

    Declaration

    Swift

    public func /= (vector:inout Vector, scalar:Double)

    Parameters

    vector

    The Vector to divide.

    scalar

    The scalar by which the Vector is divided.

  • Adds the specified Vector to the specified point.

    Parameter

    Parameter vector: The Vector to add.

    Parameter

    Parameter point: The Point to which the vector is added.

    Returns

    The result point.

    Declaration

    Swift

    public func + (vector:Vector, point:Point) -> Point

    Parameters

    vector

    The Vector to add.

    point

    The Point to which the vector is added.

    Return Value

    The result point.

  • Adds the specified point to the specified Vector.

    Parameter

    Parameter point: The point which is added to the Vector.

    Parameter

    Parameter vector: The Vector to which the point is added.

    Returns

    The result point.

    Declaration

    Swift

    public func + (point:Point, vector:Vector) -> Point

    Parameters

    point

    The point which is added to the Vector.

    vector

    The Vector to which the point is added.

    Return Value

    The result point.

  • Comapres two Color instances.

    Parameter

    Parameter col1: The first Color to compare.

    Parameter

    Parameter col2: The second Color to compare.

    Returns

    true if the Color-s are equal; otherwise false.

    Declaration

    Swift

    public func == (col1 : Color,  col2 : Color) -> Bool

    Parameters

    col1

    The first Color to compare.

    col2

    The second Color to compare.

    Return Value

    true if the Color-s are equal; otherwise false.

  • Checks if two Point-s are equal.

    Parameter

    Parameter first: The first Point to compare.

    Parameter

    Parameter second: The second Point to compare.

    Returns

    true if the coordinates of the Point-s are equal; otherwise false.

    Declaration

    Swift

    public func == (first:Point, second:Point) -> Bool

    Parameters

    first

    The first Point to compare.

    second

    The second Point to compare.

    Return Value

    true if the coordinates of the Point-s are equal; otherwise false.

  • Attaches and detaches event handlers.

    Parameter

    Parameter event: An event that uses event arguments of type T.

    Parameter

    Parameter handler: The handler for this event, which can be sent by any object and uses event arguments of type T.

    Returns

    An integer, which represents a unique id number for this event.

    See more

    Declaration

    Swift

    public func +=<T>(event: Event<T>, handler: @escaping (AnyObject, T) -> Void) -> Int

    Parameters

    event

    An event that uses event arguments of type T.

    handler

    The handler for this event, which can be sent by any object and uses event arguments of type T.

    Return Value

    An integer, which represents a unique id number for this event.