开发者

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

开发者 https://www.devze.com 2023-03-22 11:18 出处:网络
Is there a keyboard shortcut for jumping from the current xib file to i开发者_C百科t\'s class (ViewController)?And back from it\'s class to it\'s xib file again?

Is there a keyboard shortcut for jumping from the current xib file to i开发者_C百科t'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.


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.

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

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?

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

Click on it!

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

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

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


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


Most shortcuts can be seen here: http://cocoasamurai.blogspot.com/2011/03/xcode-4-keyboard-shortcuts-now.html

And although that would be an awesome one, don't think it exists.

0

精彩评论

暂无评论...
验证码 换一张
取 消