Swift Equatable Protocol

Move this function

func == (lhs: Cookie, rhs: Cookie) -> Bool {
    return lhs.column == rhs.column && lhs.row == rhs.row
}

Outside of the cookie class. It makes sense this way since it’s overriding the == operator at the global scope when it is used on two Cookies.

Leave a Comment