Instance Method

doesContain(_:)

Returns a Boolean value that indicates whether the receiver contains a given object.

Declaration

func doesContain(_ object: Any) -> Bool

Parameters

object

The object to search for in the receiver.

Return Value

true if the receiver contains object, otherwise false.

Discussion

Currently, doesContain(_:) messages are never sent to any object from within Cocoa itself.

The default implementation for this method provided by NSObject returns true if the receiver is actually an NSArray object and an indexOfObjectIdentical(to:) message sent to the same object would return something other than NSNotFound.

See Also

Performing comparisons

func isCaseInsensitiveLike(String) -> Bool

Returns a Boolean value that indicates whether receiver is considered to be “like” a given string when the case of characters in the receiver is ignored.

func isEqual(to: Any?) -> Bool

Returns a Boolean value that indicates whether the receiver is equal to another given object.

func isGreaterThan(Any?) -> Bool

Returns a Boolean value that indicates whether the receiver is greater than another given object.

func isGreaterThanOrEqual(to: Any?) -> Bool

Returns a Boolean value that indicates whether the receiver is greater than or equal to another given object.

func isLessThan(Any?) -> Bool

Returns a Boolean value that indicates whether the receiver is less than another given object.

func isLessThanOrEqual(to: Any?) -> Bool

Returns a Boolean value that indicates whether the receiver is less than or equal to another given object.

func isLike(String) -> Bool

Returns a Boolean value that indicates whether the receiver is "like" another given object.

func isNotEqual(to: Any?) -> Bool

Returns a Boolean value that indicates whether the receiver is not equal to another given object.