Skip to content

Instantly share code, notes, and snippets.

@dwaite
Created November 2, 2015 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwaite/845b11b967cda9b1f1a5 to your computer and use it in GitHub Desktop.
Save dwaite/845b11b967cda9b1f1a5 to your computer and use it in GitHub Desktop.
import Foundation
public class Foo : NSObject {}
public class Bar : NSObject {}
public func ==(lhs:Bar, rhs:Bar) -> Bool {return true}
Foo() == Foo() // NSObject variant - false
Bar() == Bar() // our variant - true
Bar() as NSObject == Bar() as NSObject // our variant is ignored - false!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment