One Logo Pool Ball
Photos · IOS API REFERENCE

PHPersistentChangeFetchResult.Iterator

class · iOS 16.0+ · SDK 27.1

final class Iterator

A type that provides the sequence's iteration interface and encapsulates its iteration state.

Members (2)

init · iOS 16.0+

init

TypeScript
static init(fetchResult: PHPersistentChangeFetchResult): PHPersistentChangeFetchResult_Iterator
Swift declaration
init(fetchResult: PHPersistentChangeFetchResult)
method · iOS 16.0+

next

TypeScript
next(): (PHPersistentChange) | null
Swift declaration
final func next() -> PHPersistentChangeFetchResult.Iterator.Element?

Advances to the next element and returns it, or `nil` if no next element exists. Repeatedly calling this method returns, in order, all the elements of the underlying sequence. As soon as the sequence has run out of elements, all subsequent calls return `nil`. You must not call this method if any other copy of this iterator has been advanced with a call to its `next()` method. The following example shows how an iterator can be used explicitly to emulate a `for`-`in` loop. First, retrieve a sequence's iterator, and then call the iterator's `next()` method until it returns `nil`. let numbers = [2, 3, 5, 7] var numbersIterator = numbers.makeIterator() while let num = numbersIterator.next() { print(num) } // Prints "2" // Prints "3" // Prints "5" // Prints "7" - Returns: The next element in the underlying sequence, if a next element exists; otherwise, `nil`.

Skipped declarations

No declarations were skipped in this snapshot.

All Photos types →