Top "Equatable" questions

The Swift equatable protocol can be used to have objects use the equality operators for comparison.

Binary operator '==' cannot be applied to two operands

I have a class with the protocol Equatable. The class looks like this: class Item: Equatable { let item: [[Modifications: String]] …

swift enums equatable
Swift Equatable on a protocol

I don't think this can be done but I'll ask anyway. I have a protocol: protocol X {} And a class: …

ios swift protocols equatable
How do I create a Set of custom objects (Swift)?

For my iOS app I have a model something like class Person { var Id: Int var Name: String init(id: …

ios swift set equatable
How can I compare CLLocationCoordinate2D

I need a way of comparing two CLLocationCoordinate2D's however when I tried using == it wouldn't work. Please can someone …

core-location cllocation equatable
How to make a Swift enum with associated values equatable

I have an enum of associated values which I would like to make equatable for testing purposes, but do not …

swift enums equatable associated-value
Swift Struct doesn't conform to protocol Equatable?

How do I make a structure conform to protocol "Equatable"? I'm using Xcode 7.3.1 struct MyStruct { var id: Int var value: …

swift struct protocols equatable
Swift Protocol Implements Equatable

I have the the below Protocol: protocol Cacheable { //....// func identifier() -> String } Can I make Cacheable implements Equatable ? when …

swift swift2 protocols equatable
Overridden == function for Equatable type not called for custom class that subclasses NSCoding and NSObject

The FooBar class below has to override the == function of the Equatable type. However, calling contains on an array of …

swift nsobject nscoding equatable
Redundant conformance of 'Generic' to protocol 'Equatable' in Swift 2.2

I am Having an error in Equatable while compilation. I wanted to add find or contains method in the list …

swift protocols equatable