Instance Method

contains(_:)

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

Declaration

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 isEqual(_:) message to each of the fetch result’s objects (and passing anObject as the parameter to each isEqual(_:) message).

See Also

Querying a 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.

func object(at: Int) -> ObjectType

Returns the object located at the specified index.

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.