Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I quickly access the interface version of my swift file in Xcode?

Tags:

xcode

swift

Since Swift files don't have a header, it can quickly get cluttered and hard to see just the public and internal methods that represent the interface of that file/class.

Xcode actually generates an interface file that can be found by clicking the Assistant Editor, then selecting the Counterparts type and you'll see the MySwiftFile.swift (Interface) file that you can check out.

Does anyone know an easier way to access this interface file? Maybe with a shortcut? I can't seem to find it using Cmd+Shift+O or other means.

like image 335
teradyl Avatar asked Jan 12 '16 22:01

teradyl


3 Answers

Click the assistant editor (use the shortcut Cmd+Option+Enter to show the editor) and thereafter use Ctrl+Cmd+ or to navigate to your .swift interface file in the assistant window. It's not an immediate short-cut, but possibly better than navigation by clicks/mouse/touchpad.

like image 155
dfrib Avatar answered Nov 16 '22 03:11

dfrib


Open generated interface: Cmd+Ctrl+

Go back: Cmd+Ctrl+

like image 43
Murlakatam Avatar answered Nov 16 '22 03:11

Murlakatam


In no way, except for menu selection "Navigate / Jump to Generated Interface"

Xcode cannot assign key binding to "Jump to Generated Interface"

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

like image 36
madmir Avatar answered Nov 16 '22 04:11

madmir