Comparing objects in an Array extension causing error in Swift

后端 未结 6 535
遥遥无期
遥遥无期 2021-01-22 15:51

I\'m trying to build an extension that adds some of the convenience functionality of NSArray/NSMutableArray to the Swift Array class, and I\'m trying to add this function:

6条回答
  •  [愿得一人]
    2021-01-22 16:34

    My guess is that you have to do something like this:

    func indexOfObject(object: T) -> Int? {
    

    and so on.

提交回复
热议问题