iOS - 跳转到 Xcode 9 定义的快捷方式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44497436/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:02:49  来源:igfitidea点击:

iOS - Shortcut for jumping to definition in Xcode 9?

iosxcodeshortcutxcode9-beta

提问by Bikram Thapa

In previous Xcode version , I could jump to definition with simple Cmd + clickon that method/variable . But in Xcode 9, I feel uncomfortable to jump to definition .

在以前的 Xcode 版本中,我可以通过简单的Cmd + 单击该方法/变量跳转到定义 。但是在 Xcode 9 中,我觉得跳转到 definition 感到不舒服。

Does anyone has a better solution for jumping to definition in Xcode 9 ?

有没有人有更好的解决方案来跳转到 Xcode 9 中的定义?

I am tired of selecting options from dropdown list.

我厌倦了从下拉列表中选择选项。

回答by user8315745

Ashish and Ghulam's answers were great but it still kinda bugged me that things had changed and I couldn't jump to definition as before. Then I found this...

Ashish 和 Ghulam 的回答很好,但事情已经改变了,我不能像以前那样跳到定义上,这让我有点不安。然后我发现了这个...

Xcode9Beta2-Preferences->Navigation->Command-click on Code:->Jump To Definition:

Xcode9Beta2-Preferences->Navigation->Command-点击代码:->跳转到定义

Xcode9Beta2-Preferences->Navigation->Command-click on Code:->Jump To Definition

Xcode9Beta2-Preferences->Navigation->Command-点击代码:->跳转到定义

回答by Ghulam Rasool

Solution 1:

解决方案1:

  • Go to Xcode menu
  • Click on Preferences
  • Select Navigation Tab from Top
  • Select Command-click on Code
  • Change to "Jumps to Definition"
  • 转到 Xcode 菜单
  • 单击首选项
  • 从顶部选择导航选项卡
  • 选择命令并单击代码
  • 更改为“跳转到定义”

As you can see in this screenshot

正如您在此屏幕截图中看到的

Solution 2:Use

解决方案2:使用

Ctrl + ? + Left click

Ctrl + ? + 左键单击

回答by dip

There is short cut displayed on drop down menu, just use-

下拉菜单上显示了快捷方式,只需使用-

1. Control, Command and left mouse button

1. 控制、命令和鼠标左键

OR

或者

2. Command plus Right Mouse Click

2. 命令加鼠标右键

instead of command left mouse button.

而不是命令鼠标左键

回答by Paresh Patel

In Xcode 9 Beta, you can go definition by Cmd + Right Click

在 Xcode 9 Beta 中,您可以通过Cmd + 右键单击来定义

回答by Alex

Standard hot key for jump to definition is ctrl+cmd+j. Set cursor to the class/method you are interested in and press this buttons to switch to declaration. Also you can try to press ctrl+opt+cmd+j. In this case definition will be opened in assistant editor

跳转到定义的标准热键是 ctrl+cmd+j。将光标设置到您感兴趣的类/方法,然后按此按钮切换到声明。您也可以尝试按 ctrl+opt+cmd+j。在这种情况下,定义将在助理编辑器中打开

回答by Shaked Sayag

In Xcode 9 both of these work:

在 Xcode 9 中,这两项工作:

? + Right Click

? + 右键单击

OR

或者

?? + Click

?? + 点击

回答by CodeNoob

If dont like to use mouse click(I certainly don't like) you could use

如果不喜欢使用鼠标点击(我当然不喜欢)你可以使用

Command + Ctrl + J

命令 + Ctrl + J

回答by Mihai Costiug

I don't know how Cmd + Option + Left Click worked for you guys, but the shortcut (at least for me) was Cmd + Ctrl + Left Click. I've tried on both Apple keyboard and MacBook keyboard and this is the one that did it.

我不知道 Cmd + Option + Left Click 如何为你们工作,但快捷方式(至少对我而言)是Cmd + Ctrl + Left Click。我在 Apple 键盘和 MacBook 键盘上都试过,这就是做到了。

回答by vadian

When I ?-clickon a symbol in Xcode 9 I see

当我?-click在 Xcode 9 中的符号上时,我看到

enter image description here

在此处输入图片说明

That means you have to ??-clickon the symbol to skip the popup.

这意味着您必须??-click在符号上跳过弹出窗口。



Nevertheless there is even a keyboard shortcut:

尽管如此,甚至还有一个键盘快捷键:

enter image description here

在此处输入图片说明

回答by Ashish Verma

In Xcode 9 Beta, it has been changed to Cmd + Ctrl + Left Click.

在 Xcode 9 Beta 中,它已更改为Cmd + Ctrl + Left Click