Instance Method


Returns the object located at the specified index.


func object(at index: Int) -> ObjectType



An index within the bounds of the fetch result.

Return Value

The object located at index in the fetch result.


Raises an exception (rangeException) if index is beyond the end of the fetch result (that is, greater than or equal to the value of the count property).

See Also

Querying a Fetch Result

func contains(ObjectType) -> Bool

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

var count: Int

The number of objects in the fetch result.

func countOfAssets(with: PHAssetMediaType) -> Int

Returns the number of assets in the fetch result of a specified type.

var firstObject: ObjectType?

The first object in the fetch result.

var lastObject: ObjectType?

The last object in the fetch result.

subscript(Int) -> ObjectType

Returns the object located at the specified index.

func objects(at: IndexSet) -> [ObjectType]

Returns an array containing the objects in the fetch result at the indexes in the specified index set.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software