Contents

contains(_:)

Returns a Boolean value that indicates whether a given object is present in the set.

Declaration

func contains(_ anObject: Any) -> Bool

Parameters

  • anObject:

    An object to look for in the set.

Return Value

true if anObject is present in the set, otherwise false.

Discussion

Each element of the set is checked for equality with anObject until a match is found or the end of the set is reached. Objects are considered equal if isEqual(_:) returns true.

See Also

Accessing Set Members