How can I find the operator definition in Swift?

心已入冬 提交于 2019-12-31 07:27:11

问题


I write code below:

let array1: [Int] = [0,1]
let array2 = array1 + [2]

It just works.I want to find where + operator define. I search ArrayExtension in my workspace without result.I search Apple doc Collection Sequence Array , there is no result.

Is there a way to navigate to operator definition ,like CMD + CTRL + J for func


回答1:


You can select the operator in the Xcode source editor, and choose "Navigate -> Jump to definition" from the menu, or press CMD+CTRL+J.

(This was broken in Xcode 10, but works again in Xcode 11, which is currently in beta.)



来源:https://stackoverflow.com/questions/53651936/how-can-i-find-the-operator-definition-in-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!