rudymatos
rudymatos

Reputation: 321

Prevent Xcode from opening new files

Is there any way to prevent Xcode from opening brand new files? Let me explain. Everytime I create a new file (Xib, .swift, .storyboard, etc...) Xcode opens that new file automatically in the standard editor. This functionality kinda annoys me because something I just want to create the file and maybe open it on the assistance editor instead or just to work on the file later. I tried changing some of the Xcode's behavior but I don't see any ways where I can trigger an action when certain events occur (like creating a new file).

Upvotes: 1

Views: 204

Answers (1)

Smartcat
Smartcat

Reputation: 2882

Well here's one way:

Create a folder full of empty files of various types (with various extensions) that you typically create. Then whenenver you want a new file, rather than telling Xcode to create a new file, use the "Add Files to ..." command and choose one of those files. Just remember to also check the checkbox "Copy items if needed".

Doing this won't open the added file.

As an added benefit, you could also make some versions of these files pre-seeded with code or comments or whatever else that you often keep re-typing into many of your new files.

Upvotes: 5

Related Questions