I would like to start using my own templates for iOS applications. I don't want any significant changes, but simpler things like
pragma mark
sectionsThe idea is that we will share these templates when we create apps, but at the same time we want to keep the default template files that Xcode 4 already provides. So, in the following screenshot, how can I add a "CompanyName Application" section that contains exactly the same templates (Navigation-based, View-based etc), but with my own changes?
I found that I can add a folder under /Developer/Library/Xcode/Templates/
or /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/
but I'm a bit confused with what do I need to do exactly. I would really appreciate it if you could help me with that, as I have already messed up my folders twice with no luck. Thanks!
This blog post by borealkiss has detailed instructions. For starters:
If you add your own templates, the place you should use is under the following path:
~/Library/Developer/Xcode/Templates/
The problem is that it is quite hard to create a custom template. For example, to copy and paste the built-in template to your place will not show up the template on Xcode 4 until you manually change its identifier in TemplateInfo.plist.
I just found this article from Bob McCune "Creating Custom Xcode 4 File Templates" that is exactly what I needed, so I put it here for reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With