Xcode provides with a lot of custom templates. In this article we will explore how we can change them. In general we don’t want to alter teh current one.We can always copy the current and add create a new(altered) custom one.
Let’s first find where these templates are stored. Open Finder and go to the “/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates”.
Now lets Open MultiPlatform > Source> Swift File.xctemplate and copy the folder.
in order to create our new template we have first to create a folder(let’s name it custom).
Now we can paste the files inside the Custom folder.
As last step let’s open the file and remove the following line
1 |
___FILEHEADER___ |
Let’s now try to create a new file.
We can see the new option, lets select it and give a name for our new file
If we now open the file, we don’t see the header comment