Bikram Thapa
Bikram Thapa

Reputation: 1339

iOS - Shortcut for jumping to definition in Xcode 9?

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

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

I am tired of selecting options from dropdown list.

Upvotes: 69

Views: 14079

Answers (12)

user9542776
user9542776

Reputation: 1

Deleting everything under the Derived data and re-opening Xcode fixed everything for me.

Upvotes: 0

CodeNoob
CodeNoob

Reputation: 171

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

Command + Ctrl + J

Upvotes: 6

dip
dip

Reputation: 3598

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

1. Control, Command and left mouse button

OR

2. Command plus Right Mouse Click

instead of command left mouse button.

Upvotes: 24

Ghulam Rasool
Ghulam Rasool

Reputation: 4064

Solution 1:

  • Go to Xcode menu
  • Click on Preferences
  • Select Navigation Tab from Top
  • Select Command-click on Code
  • Change to "Jumps to Definition"

As you can see in this screenshot

Solution 2: Use

Ctrl + ⌘ + Left click

Upvotes: 31

Krunal
Krunal

Reputation: 79636

Solution to your question: Ctrl + ⌘ + Left click

Xcode >> Preference >> Key Bindings >> Here is list of all short cuts of Xcode.


enter image description here

Upvotes: 2

Shaked Sayag
Shaked Sayag

Reputation: 5792

In Xcode 9 both of these work:

⌘ + Right Click

OR

⌘⌃ + Click

Upvotes: 5

Paresh Patel
Paresh Patel

Reputation: 380

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

Upvotes: 20

user8315745
user8315745

Reputation: 1876

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...

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

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

Upvotes: 173

Ashish Verma
Ashish Verma

Reputation: 1818

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

Upvotes: 2

Mihai Costiug
Mihai Costiug

Reputation: 51

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.

Upvotes: 4

vadian
vadian

Reputation: 285039

When I ⌘-click on a symbol in Xcode 9 I see

enter image description here

That means you have to ⌃⌘-click on the symbol to skip the popup.


Nevertheless there is even a keyboard shortcut:

enter image description here

Upvotes: 4

Alex
Alex

Reputation: 1235

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

Upvotes: 7

Related Questions