Xcode Open File from Previous Project for Reference

When working on a project, I would like to open a file from a previous project in a side-by-side window for reference, so I can view and adapt parts of the previous file into a file in the current project. I don't want the previous file to be part of the current project. Is this possible? If so, how?

Answered by Claude31 in 824660022

If I understand what you want…

I would avoid mixing files between p^rojects. That may have really bad side effects.

What I do:

  • open the other project
  • close all panels except the file itself
  • resize its window to reduce width and put it next to the main project.
  • that does mimic pretty well having the 2 files in adjacents panels.

I found one way, but it's cumbersome.

I split the editor window, delete the file that's displayed on the right (it's the same as the one on the left), then drag the reference file's icon from the Finder to the right side editor.

Is there a better way? I would hope that there is an Open option under the File menu, but that wants to open the previous project as a second project

Accepted Answer

If I understand what you want…

I would avoid mixing files between p^rojects. That may have really bad side effects.

What I do:

  • open the other project
  • close all panels except the file itself
  • resize its window to reduce width and put it next to the main project.
  • that does mimic pretty well having the 2 files in adjacents panels.

Thanks.

One thing additional. I usually run in full screen mode. If you open a second project, I find you have to exit full screen mode to have access windows from both projects at the same time. Then you can tile on window to the left and one to the right.

Easily fixed...

Open your first project. Then grab the top bar of the Xcode window, anywhere in the plain grey area, and start dragging the window around, then press F3 and you should see the Mission Control desktops at the top of the screen. Drag your Xcode window to the right of the existing "Desktop" item. This creates a new space for Xcode and shows your project full screen.

Now, back on the original Desktop space, open your second project. Grab the window again. Press F3 again. This time, drag it on top of the "Xcode" space. You'll see it becomes a split screen full screen space.

All done.

Thanks,

The first step (drag window around) doesn't work for me in Full Screen mode. I'm still using Sonoma (14.7). Has that changed is Sequoia? I have to exit Full Screen mode, then the rest works.

Mark

Yes, clearly you can't be in full screen mode already when you want to drag the window around.

Xcode Open File from Previous Project for Reference
 
 
Q