Instance Method


Sets a region of the data buffer to 0.


mutating func resetBytes(in range: Range<Data.Index>)



The range in the data to set to 0.


If range exceeds the bounds of the data, then the data is resized to fit.

See Also

Creating Empty Data


Creates an empty data buffer.

init(capacity: Int)

Creates an empty data buffer of a specified size.

init(count: Int)

Creates a new data buffer with the specified count of zeroed bytes.

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