1

I’m trying to add a new Swift file in my custom defined folder structure but it adds up text file instead of swift file. I’m using Xcode 9.2 and Swift 4 language.

Screenshot 1

Screenshot 2

Where am I going wrong?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177

1 Answers1

4

Looks at your folder Color, Its Blue.

That means it's an actual Folder, not Group Folder Created in Xcode.

Only Group Folder Created in Xcode 9 will option to choose a template in New File

enter image description here

Eg: Right Clicking the Yellow Folder (Group) enter image description here

Right Click the Blue Folder enter image description here you can clearly see options provided by both are different

Right Clicking the TodoListViper (folder in Yellow Color) and Click New File , you will see the Choosing Template Option

Gokul G
  • 698
  • 4
  • 11
  • Nope...I haven't drag-drop approach. Simply went into folder structure created a folder structure and then added into project by Add files/folder. – Jayprakash Dubey Mar 30 '18 at 13:03
  • oh Okay, always try to create a folder as a group, Xcode will create a corresponding folder for you in the filesystem, bcos having folder and group will confuse the heck out of people lots of times. – Gokul G Mar 30 '18 at 13:06