The method signature is:

public func enumerateBytes(_ block: (UnsafeBufferPointer<UInt8>, Data.Index, 
inout Bool) -> Swift.Void)

From trying out the version from NSData in Objective-C years ago, and this 
method’s own explanation, I know the third closure parameter controls whether 
to keep iterating. Instead of a pointer and a range, we have a buffer and index 
for the first two closure parameters. I guess the span information has just 
moved from the second to the first parameter. The first parameter has changed 
from a pointer to the start of the memory segment to a buffer enclosing the 
segment’s start and span. The second parameter used to represent which span of 
bytes within the total NSData object are modeled in the segment, now I guess 
it’s now the index within the Data object where the modeled segment starts. Is 
my guess correct?

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to