1
if let equatableObj = newFirstItem as? Equatable {
    // do something
}

error message: Error:(140, 64) protocol 'Equatable' can only be used as a generic constraint because it has Self or associated type requirements

How do i solve it?

Komal12
  • 3,227
  • 4
  • 14
  • 25
yang
  • 21
  • 1
  • 1
    [similar question here](https://stackoverflow.com/a/24962353/5685969) This is just a swift constraint. – 悟空之空 Aug 18 '17 at 03:47
  • Be sure to use search: https://stackoverflow.com/search?q=Swift+equatable A lot of similar questions answered. – Hexfire Aug 18 '17 at 04:11

1 Answers1

0

I just found a very detailed post about this topic at Swift by Sundell

Benjamin
  • 3,047
  • 2
  • 24
  • 46