In my project (written in Swift 3) I want to retrieve index of an element from array using indexOf(_:) method (existed in Swift 2.2), but I cannot find any replacem
indexOf(_:)
Didn't work for me in Swift 3 XCode 8 until I gave my class an extension.
For example:
class MyClass { var key: String? } extension MyClass: Equatable { static func == (lhs: MyClass, rhs: MyClass) -> Bool { return MyClass.key == MyClass.key } }