Allow to switch between Swift generated interface and original source via shortcut

Originator:simon.liotier
Number:rdar://22558104 Date Originated:03-Sep-2015 05:55 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 7.0 beta 6 (7A192o)
Classification:UI/Usability Reproducible:Always
 
Summary:
Xcode 7 provides a great feature to get header-like files for Swift source code. This feature is available via the Navigate menu (Navigate → Jump to Generated Interface). However there are 2 restrictions:
- Once the Generate Interface is displayed, there is no way to switch back to the original source file. There is a "Jump to Original Source" in the Navigate menu but it is grayed out.
- No shortcut is bound to the "Jump to Generated Interface" action. It is even impossible to bound one manually, as the action does not appear in the Key Bindings menu of Xcode settings.

Steps to Reproduce:
1. Open a .swift file in Xcode
2. Jump to Generated Interface using a Navigate menu
3. Once in the Generated Interface, try to go back to original source using Navigate -> Jump to Original Source
—
4. Open Xcode Settings -> Key Bindings
5. Try to add a shortcut for Jump to Generated Interface

Expected Results:
3. Jump to Original Source is available
5. A shortcut can be added

Actual Results:
3. Jump to Original Source is grayed out
5. "Jump to Generated Interface" does not appear in the list so it is not possible to bound a shortcut

Notes:
Xcode could use the well-known ⌃⌘↑ shortcut for both "Jump to Generated Interface" and "Jump to Original Source" to allow to switch quickly between source and generated interface. Right now, this shortcut is used to switch between a .h header and it's corresponding .m, which is the same use case, but in Objective-C.

Comments

It turns out there is a work-around for this (well, only for jumping to the generated interface, not for navigating back).

System Preferences -> Keyboard -> Shortcuts -> App Shortcuts

Hit "+", select Xcode as the application, "Jump to Generated Interface" as the menu title, and then select your keyboard shortcut.

By jasonpepas at Aug. 3, 2016, 6:56 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!