Comparing objects in an Array extension causing error in Swift

后端 未结 6 550
遥遥无期
遥遥无期 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条回答
  •  旧时难觅i
    2021-01-22 16:20

    Actually there is no need to implement indexOfObject:; there is a global function find(array, element) already.

提交回复
热议问题