Instance Method


Returns an iterator over the contents of the data.


func makeIterator() -> Data.Iterator


The iterator will increment byte-by-byte.


From Protocol

See Also

Iterating Over Bytes

func forEach((UInt8) -> Void)

Calls the given closure on each element in the sequence in the same order as a for-in loop.

func enumerated() -> EnumeratedSequence<Data>

Returns a sequence of pairs (n, x), where n represents a consecutive integer starting at zero and x represents an element of the sequence.

struct Data.Iterator

An iterator that operates over the contents of data.

func enumerateBytes((UnsafeBufferPointer<UInt8>, Data.Index, inout Bool) -> Void)

Enumerates the contents of the data's buffer.


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