Returns a Boolean value that indicates whether the receiver is equal to another given object.
SDK
- macOS 10.0+
Framework
- Foundation
Declaration
func isEqual(to object: Any?) -> Bool
Parameters
object
The object with which to compare the receiver.
Return Value
true
if the receiver is equal to object
, otherwise false
. In effect returns false
if receiver is nil
.
Discussion
During the evaluation of an NSWhose
object that contains a test whose operator is NSEqual
, an is
message may be sent to each potentially specified object, if neither the potentially specified object nor the object being tested against implements a scripting
method.
The default implementation for this method provided by NSObject
returns true
if an is
message sent to the same object would return true
.