Custom xCode Templates

I'm not a huge fan of the packaged templates that come with xCode for iPhone development. My main problem is that other than the OpenGL one they all expect you to use Interface Builder which I don't believe is necessary if your familiar with object-oriented programming. The first template I created was one that would allow me to start a project free of the Interface Builder and ready to use UIKit but templates can be used for many other purposes that are very helpful like starting projects with commonly used libraries so you don't have to repetitively bring in a link them.

I find the best way to create a new template is to copy an existing one and modify it to your liking. To create your own template first navigate to /Library/Application Support/Apple/Developer Tools/Project Templates/ select a template that is similar to the one your trying to make. Copy it into a new folder and rename it.

It will open like a regular xCode project but you will notice there are many places that have things like _______SOMETHING________ in them. These symbols are simply places that xCode will fill in with whatever parameter you specify. These are helpful because they allow you start customizing your application before you even begin programming.

Fill out your template to the point where you think your going to start needing custom methods and variables. You can build your template and test it in the simulator but make sure you delete the build folder in your project after.

To give your template a new name you will need to show the contents of your .xcodeproj folder and edit the TemplateInfo.plist file. You can also change the images in the TemplateIcons.icns file if you want to get fancy. Enjoy templating!