Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode keyboard shortcuts for go to class from xib and from xib to class?

Is there a keyboard shortcut for jumping from the current xib file to it's class (ViewController)? And back from it's class to it's xib file again?

I use ctrl-command-up/down all the time to to jump between header and source, be great to have one for the view xib also.

like image 916
BenB Avatar asked Jul 25 '11 04:07

BenB


2 Answers

There are a couple of quick ways to get to the XIB associated with a class.

CTRL-5--enter

This will open the jump bar to the current file. Assuming your XIB is named the same as your class -- which is usually good practice to do -- the matching XIB will be the next item in the list if you are in your implementation file, or two down if you are in your header file.

Jump bar

Alternately, you can open the XIB or StoryBoard associated with the file with one mouse-click if you have an IBOutlet.

See the outlet indicator next to the IBOutlet?

IBOutlet indicator

Click on it!

IBOutlet XIB

For additional Xcode shorcuts, a great resource is this PDF maintained in github: http://cloud.github.com/downloads/Machx/Xcode-Keyboard-Shortcuts/Xcode_Shortcuts.pdf

enter image description here

like image 75
memmons Avatar answered Sep 28 '22 22:09

memmons


I don't know if there's a keyboard shortcut for jumping from xib to corresponding class header file. But you can do that easily with a few mouse clicks:

  1. Select a UI object in storyboard
  2. Select "Identity inspector" in Utility Panel (3rd tab from left)
  3. Click right-pointed arrow in the class name text field on top, which will take you to the header file
  4. You can always go back and forth with two-finger swipe in Editor panel
like image 21
Philip007 Avatar answered Sep 28 '22 22:09

Philip007