Show Assistant Editor missing in Xcode 11? - xcode

In Xcode 10, the toolbar had an inter-locking ring icon which showed the assistant editor, it's missing in Xcode 11.

In Xcode 10, the toolbar had an inter-locking ring icon which showed the assistant editor, it's missing in Xcode 11.
The interface has changed a little, but the functionality is still there. The top right corner of the editor pane has two buttons:
Clicking the left button, which looks like lines of text, displays the popup menu, where you can choose various editor configuration options. Clicking the right button just narrows the existing editor and adds another one next to it.
Some of the same options are also available in the Editor menu in the main menu bar.
Update: This is from the Xcode 11 beta release notes, and perhaps more fully explains why the UI was changed:
Editors can be added to any window without needing the Assistant Editor. Editors are added using the “Add Editor” button in the jump bar or the File > New > Editor command. Each editor can now be in one of three modes: “Editor Only”, “Editor and Assistant” or “Editor and Canvas”. The latter two modes automatically show relevant content when available. When using multiple editors, the View > Editor > Focus command can be used to temporarily expand the active editor to fill the entire window, hiding other editors. For source control support, the Code Review button in the Toolbar replaces the Comparison Editor. The “Show Authors” command is now available from the Source Editor’s Editor menu. The SCM Log is now in the Inspector Area. (43806898)
With multiple editors possible in a window, you need editor-specific controls for showing the ancillary views like the assistant editor, author view, etc.
From SMGreenfield's comment:
Sometimes I want to look at a different part of the same darn document. There has always been a way to do this, but it involved jumping through hoops.
Just add another editor: click the Add Editor button in the upper right corner of the editor, or choose File > New > Editor. The new editor will default to showing the same file you were working on in the existing editor.
If new editors show up on the right of the existing editor and you'd prefer them to stack vertically, you can choose View > Change Editor Orientation. If you want them to stack horizontally most of the time (the default) but just want one to show up below, choose File > New > Editor Below.

Shortcuts :
control + option + command + return : Show Assistant Editor
command + return : Show Editor only (hide Assistant Editor)
Using Editor on the Toolbar

It has moved, to show it click on icon with horizontal lines and select Assistant.

In Xcode 11 we now have multiple editor panes. You can summon a second pane, a third pane, as many as you like.
When you have a second pane, it does not have to be an automatic assistant. In other words, the editor pane itself either is an assistant or it is not. So if it is not, it is manual. And if it is, it is automatic.
To toggle between being an assistant and being an ordinary pane, choose Assistant from the Editor menu:
If Assistant is checked, this is an assistant and is automatic. What it displays depends automatically on some other pane.
If Assistant is unchecked, this is an ordinary editor pane and is manual. You can display anything you like in this editor.

In case you can't use Add Editor button just use shortcut:
Cmd + Ctrl + Shift + Enter

Turn Assistant on by navigating to the following in Xcode 11:-
Xcode > Editor > Assistant

For Xcode 11.2.1
command + option + return
or
Main Menu -> Editor -> Line View

it is worth noting, that you can also open the assistant editor by alt-clicking the file

Related

Xcode11 Editors (via "Add Editor to Right") are disabled

It has been working all this while since I upgraded to Xcode11.2. A couple of days back noticed it and now it's not allowing me to add an editor to the layout. Similar to Editor changes introduced in Xcode 11.
Tried:
Restarting Xcode
Rebooting MacBook
No Xcode update pending in AppStore
Any other suggestions to try before reinstalling the Xcode?
Current State for Xcode:
Disabled Editor add option
Disabled Editor option via Menu->Editor
Update A:
After using "Adjust Editor Option"
This Assistant is not the same as regular editor.
An editor would allow the user to independently open any file (and not always show to counterpart files). Plenty of visual space as using external monitor 24".
Update 2:
It seems to be an issue with the current project only (perhaps some messed up .xcodeproj setting?). Opened another project, and I'm able to see the "Add editor on right" just fine.
Unfocus the Editor
Turned out to be that Editor was in focused mode. As soon as an editor is in focused mode, Xcode hides the other editors and disables "adding editors to right" option on the menu and right bar.
Use the following key combination to toggle the focus-unfocus the editor.
Control + Shift + Command + Enter
Or use the
Assistant Editor
Assistant is now under the editor option menu (left itme).
Also you can use control+option+command+return shortcut
Add Editor
The other one that is disabled is Add Editor on Right. Some times its getting disabled because there is not enough space to show another editor. You can change the position of it to below by holding option and click. This will convert it to Add Editor Below

Xcode usability - Multiple screens

Is there a way to split Xcode interface when using multiple monitors?
I have 2 monitors but still haven't found an easy way to use it on more than 1 monitor (Storyboard on the left, code on the right) - Like you can do when using Intellij with Android - simple drag n drop of windows
Thanks for any tip,
Just right click on a file and Open in New Window
Go to File > New > Window
As detailed by Apple here
I actually found out just now after using XCode for several years.
You can configure how XCode responds to navigation/linked editors etc from the navigation tab in XCode Preferences.
I set "Optional Navigation" to "Uses Destination Chooser", which apparently was the missing link for using two monitors, since you can e.g. link the editor window with a storyboard view. I also set "Double click Navigation" to "Uses separate window". With these settings, the summary at the bottom looks like this:
- Click: Open in new window
- Option-click : Displays destination chooser
- Option-Shift-click: Opens in next editor
- Double-click: Open in new window

Xcode: Is it possible to 'Open Quickly' the right pane of the Assistant Editor?

Is it possible to 'Open Quickly' in the right pane of the Assistant Editor? This would increase productivity by like 20x
Yes it's possible, but depending on your Xcode version you may need to adjust the default behavior in Xcode's preferences.
Use ⌘ command+⇧ shift+O to open the "Open Quicky" input box, and then:
Use ⌥ option+Enter to open the file in the right editor.
Use ⌥ option+Shift+Enter to select where you want to open the file using the arrow keys.
On Xcode 12, the default action of ⌥ option+Enter is to open the file in a new "Tab" (which are new in this release, and different from a "Window Tab"). This is still configurable in the preferences.
On Xcode 11, you can split the editor as much as you want. This means ⌥ option+Enter by default will open the file in the editor next to where your cursor currently is.
This behavior is configurable in Xcode's Preferences, under Navigation:
To have ⌥ option+Enter open the selected file in the editor on the right of the Xcode window, select "Optional Navigation: Uses Second Editor".
Make sure that Uses Focused Editor is selected in Preferences > Navigation:
This way, you can open it by focusing the Assistant Editor, pressing ⌘ command+⇧ shift+O to open the Open Quicky input box, and just press Enter to open the selected file, instead of ⌥ alt+Enter.
An even easier way is to hold down the Option key and then click on the file. That will bring open the chosen file in the Assistant Editor. This works great when you TDD your Swift :) You can have your tests on the left and option click on the implementation to open on the right.
Cool thing!
Just to extend the answer you can switch between more then two Tabs or open it new editor tab cool isn't it?
• Open multiple assistant editor .
• ⌘ command+⇧ shift+O.
• Hold ⌥ option and press Enter on the selected item.(Used to open any file in Assistant Editor)
• You can also use ⌥ option+⇧ shift+Enter to toggle more and
open new tab if you're not on stacked editor.
• The multiple selection window will appear
Note: Make sure you have all editor stacked selected
In addition to Guillaume's answer, be mindful that the editor is not in the single editor mode (I don't know what it should be called officially though) that you can disable by selecting this button, otherwise all navigations become "Uses Focused Editor":
EDIT: misread your question above answer is good, just make sure you click into that pane before trying those commands
Sounds like your looking for some hotkeys, check here for a full list
http://spin.atomicobject.com/2014/03/23/xcode-keyboard-shortcuts/
http://iphonedev.tv/blog/2014/9/15/14-xcode-time-saving-shortcuts-memorize-and-improve-your-productivity
http://nshipster.com/xcode-key-bindings-and-gestures/
but to open assistant editor use ⌘ command + ⌥ option + ↵ return

Xcode 4 shortcut for swapping focus between editor and assistant editor

In Xcode, I am big fan of the assitant editor that shows me the corresponding .h or .m for the file that I am editing.
Is there a shortcut that allows me to swap focus between this two windows? I frequently switch between the two and using the mouse every time is annoying.
New answer:
Move Focus To Editor — commandj followed by ←/↑/↓/→ and return
This goes nicely together with commandshiftj which is Reveal in Project Navigator.
Old answer:
Use optioncommand` keyboard shortcut.
It can be remapped in Preferences - Keyboard Bindings - Move Focus To Next Area.
Edit: Removed XVim recommendation.
#Oneiros: Not quite what the OP was asking for..
I don't know of a 'short' shortcut but there's Cmd-J showing a popup where you can choose what to focus.
I made this to help answer another question... Does it help?
Xcode 8+
This is the easiest option:
^` - Move Focus to Next Editor
When using multiple assistant editors, ⇧^` moves focus to previous editor.
Xcode 4+
⌥⌘` - Move Focus to Next Area
⇧⌥⌘` - Move Focus to Previous Area
Using this option you can switch between Project Navigator (left pane), Primary Editor, Assistant Editors, Utility Area (right pane), Debug Area, etc.
⌘J - Move Focus to Editor...
Using this option you can choose where to move the focus using graphical navigation chooser.
For Xcode 4.4:
Use Cmd+Option+` (left to number 1) to Move Focus to Next Area, and use Cmd+Option+Shift+` to Move Focus to Previous Area
For Xcode 4.3:
If you only have the Editor and Assistant open, use Cmd+Option+. to switch between them (Navigator>Move Focus to next area)
Also, if you want to open a different file in the right pane, like the .xib or any other, press
Command ⌘shift ⇧o
The open quickly window will appear, search the file, use capital letters to filter through camel case notation, then press
Alt ⌥enter ↵
The file will be opened in the assistant window
Switching between .h and .m:
Control ^Command ⌘Up Arrow ↑
You can do this:
Assume you have Standart(S) and Assistance(A) editor opened and you want swap them.
1) Double tap with holded Alt to line in navigation bar of S editor with file name (look screenshot). This file will open in A editor.
2) In A editor tap Go Back and do 1. File from A editor will be opened in S editor.
3) In A editor tap Go Forward.
DONE!

Xcode 4: Keyboard shortcut for switching Assistant Editor to Tracking (Automatic) mode?

I like using the Assistant Editor in Xcode 4. I frequently Option-Click files to open them in the Assistant Editor, or use Open Quickly (Command-Shift-O), and hold the option key when selecting a file to open it in the Assistant Editor.
Both of these actions switch the Assistant Editor to Manual mode. Is there a keyboard shortcut to switch the Assistant Editor back to Tracking mode (also called Automatic)? In tracking mode it automatically shows the counterpart, e.g. the corresponding header/implementation file for the file in your main editor. know I can select Automatic mode it with the mouse on the Assistant Editor Jump bar, but I really want a keyboard shortcut to do this.
I made this to help answer another question... Does it help?
In the View -> Assistant Editor menu, there's an item called "Reset Editor". The default keyboard shortcut is Cmd-Opt-Shift-Z. It resets the Assistant View to show Counterparts.
I don't know if it's new in Xcode 4.1, but it should be a little easier than AppleScripting.
Alternatively, you could create a behavior to reset the editor how you'd like and bind it to a keyboard shortcut.
You can do it, but not with just a single "standard" keyboard shortcut. Assuming that you have just Option-Clicked on a file and opened it in the Assistant Editor, you would do the following steps to switch to "Counterparts" mode in the Assistant Editor:
If your focus is not on the Assistant Editor, press Command-Option-.
until you are on it.
Once focus is on the Assistant Editor, press Control-4 to drop down
the Assistant Editor menu.
"Manual" will be selected so Press DownArrow once to select
"Counterparts" and press Enter to switch to the counterpart of the
file in the main editor.
If this is too many keystrokes, you can put the keys for steps 2 & 3 in an AppleScript script and bind it to a key.

Resources