---
title: "index(of:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phfetchresult/index(of:)"
---

# index(of:)

Returns the lowest index whose corresponding object in the fetch result is equal to the specified object.

## Declaration

```swift
func index(of anObject: ObjectType) -> Int
```

## Parameters

- `anObject`: An object.

## Return Value

Return Value The lowest index whose corresponding object in the fetch result is equal to anObject, or NSNotFound if no such object is in the fetch result.

## Discussion

Discussion Starting at index 0, this method sends an == message to each object in the fetch result until it finds a match or reaches the end of the fetch result. This method passes the anObject parameter to each == message.

## See Also

### Finding Objects in a Fetch Result

- [index(of:in:)](photos/phfetchresult/index(of:in:).md)
