Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Cocoa Touch Class' template #6

Open
J-Swift opened this issue Feb 5, 2016 · 5 comments
Open

'Cocoa Touch Class' template #6

J-Swift opened this issue Feb 5, 2016 · 5 comments

Comments

@J-Swift
Copy link

J-Swift commented Feb 5, 2016

Hi! I've used custom templates I generated for a while now (at least a year or two), but just got a new computer and didn't carry over what I generated. When I went through to regenerate templates, I noticed that the script isn't able to make available a handful of templates that we generate.

I'm specifically concerned with the 'Cocoa Touch Class' option when generating a new file, but the others might be useful too. I attempted to track down the root cause, but didn't see anything that might be affecting this. The templates are generated just fine, it just seems that Xcode 7.2.1 doesn't seem to want to show the template, probably due to plist issues? The 'Cocoa Touch Class' plist is so minimal, that I can't think of what could be going wrong.

Directory listings:

$ ls /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File\ Templates/Source/
C File.xctemplate
C++ File.xctemplate
Cocoa Class.xctemplate
Header File.xctemplate
Objective-C File.xctemplate
Objective-C new superclass.xctemplate
Playground Page.xctemplate
Playground with Platform Choice.xctemplate
Playground.xctemplate
Sources Folder Swift File.xctemplate
Swift File.xctemplate
UI Test Case Class.xctemplate
Unit Test Case Class.xctemplate

$ ls ~/Library/Developer/Xcode/Templates/File\ Templates/Custom/
C File.xctemplate
C++ File.xctemplate
Cocoa Class.xctemplate
Header File.xctemplate
Objective-C File.xctemplate
Objective-C new superclass.xctemplate
Playground Page.xctemplate
Playground with Platform Choice.xctemplate
Playground.xctemplate
Sources Folder Swift File.xctemplate
Swift File.xctemplate
UI Test Case Class.xctemplate
Unit Test Case Class.xctemplate

XCode Screenshots:

screen shot 2016-02-05 at 3 57 20 pm

screen shot 2016-02-05 at 3 57 29 pm

@royclarkson
Copy link
Owner

Interesting. I'm not sure what's going on either. Obviously, sometimes things change between Xcode releases. I'll take a look and see if I can figure out why.

@royclarkson
Copy link
Owner

I copied the unmodified templates and they still aren't showing up as available templates, so something else is needed here. Requires a bit more digging...

@antskaar
Copy link

Cocoa Touch template can be found from:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Source.
There are also some other iOS related templates.

xctemplates.rb copying part needs to be updated. Rest of the process(updating headers part of the script and copy-templates.rb) works fine.

Another thing: copying part does not cover all the templates. I would recommend including templates from /Other and /Resource folders as-well. And make sure that header replacing works with all file types.

@royclarkson
Copy link
Owner

@antskaar thanks for the recommendations!

@akshaykolte
Copy link

akshaykolte commented May 8, 2017

By default there is no Cocoa touch class templates in File Templates. You can find the templates on a github project https://github.com/jdg/Xcode-File-Templates or at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Source . You'll need to add these manually and then run the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants