Replaces a region of bytes in the data with new data.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.0+
Framework
- Foundation
Declaration
Parameters
subrange
The range in the data to replace. If
subrange
then this operation is an append..lower Bound == data .count && subrange .count == 0 data
The replacement data.
Discussion
This will resize the data if required, to fit the entire contents of data
.
Precondition: The bounds of subrange
must be valid indices of the collection.