Difference between identical and equal to in Swift

In swift, identical to (represented by three equal to signs ===) doesn’t mean equal to (represented by two equal to signs ==). When two variables or constants referring to class instance are said to be identical, they both refer to the same class instance. Equal to means that two instances are equal or equivalent according to the type’s definition.

 

Leave a Reply