---
title: "doesContain(_:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/doescontain(_:)"
---

# doesContain(_:)

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

## Declaration

```swift
func doesContain(_ object: Any) -> Bool
```

## Parameters

- `object`: The object to search for in the receiver.

## Return Value

Return Value YES if the receiver contains object, otherwise NO.

## Discussion

Discussion Currently, doesContain(_:) messages are never sent to any object from within Cocoa itself. The default implementation for this method provided by NSObject returns YES if the receiver is actually an NSArray object and an indexOfObjectIdentical(to:) message sent to the same object would return something other than NSNotFound.
