Skip to content

Instantly share code, notes, and snippets.

@chriswill0w
Created November 23, 2017 11:21
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 chriswill0w/b14142fb439772e0129863fd38089f5c to your computer and use it in GitHub Desktop.
Save chriswill0w/b14142fb439772e0129863fd38089f5c to your computer and use it in GitHub Desktop.
protocol CusotmEquatable {
func isEqual(to rhs: CusotmEquatable) -> Bool
}
extension CusotmEquatable where Self: Equatable {
func isEqual(to rhs: CusotmEquatable) -> Bool {
guard let rhs = rhs as? Self else {
return false
}
return self == rhs
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment