Returns an iterator over the contents of the data.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.0+
Framework
- Foundation
Returns an iterator over the contents of the data.
SDKs
Framework
func for Each((UInt8) -> Void)
Calls the given closure on each element in the sequence in the same order as a for
-in
loop.
func enumerated() -> Enumerated Sequence<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 enumerate Bytes((Unsafe Buffer Pointer<UInt8>, Data .Index, inout Bool) -> Void)
Enumerates the contents of the data's buffer.