<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHFetchResult/contains(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHFetchResult(im)containsObject:"
  },
  "title" : "contains(_:)"
}
-->

# contains(_:)

Returns whether the specified object is present in the fetch result.

```
func contains(_ anObject: ObjectType) -> Bool
```

## Parameters

`anObject`

An object.

## Return Value

`true` if `anObject` is present in the fetch result, otherwise `false`.

## Discussion

This method determines whether `anObject` is present in the fetch result by sending an `==` message to each of the fetch result’s objects (and passing `anObject` as the parameter to each `==` message).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)