Instance Method

is​Equal(to:​)

Compares the receiving data object to other​Data.

Declaration

func isEqual(to other: Data) -> Bool

Parameters

other​Data

The data object with which to compare the receiver.

Return Value

true if the contents of other​Data are equal to the contents of the receiver, otherwise false.

Discussion

Two data objects are equal if they hold the same number of bytes, and if the bytes at the same position in the objects are the same.