Contents

member(_:)

Determines whether a given object is present in the set, and returns that object if it is.

Declaration

func member(_ object: Any) -> Any?

Parameters

  • object:

    An object to look for in the set.

Return Value

Returns an object equal to object if it’s present in the set, otherwise nil.

Discussion

Each element of the set is checked for equality with object 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