Xcode does not allow me to specify file name when adding in SPM

Viewed 211

I have a stand alone SPM (local) in my project. When ever I add any new files to this package Xcode does not show the prompt to specify the name. Usually when adding files in a project it requests the location which allows to specify a name. But when adding in a SPM it straight away creates a file with File.swift always.

I don't mind renaming but its just that the header is also having a generic File.swift

//
//  File.swift
//  
//
//  Created by McDuck, Scrooge on 02/06/89.
//

Any work arounds ?

I have tried on Xcode 13.4 as well

1 Answers

Actually it works as promised (according to Apple guidelines).

  1. In this scenario (as shown on demo) a menu command without ellipsis (...), so no dialog expected.

  2. Once file created Xcode enters edit-name mode, so we can specify a file name which we need.

  3. The file hat is different question and can be edited in templates if needed, or not. Usually depends on project and might even not include file name at all, but for default template - yes we need to change it to align.

demo

Tested with Xcode 13.4

Related