1首先前往
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates
2在File Templates下新建一个文件夹(例如Custom)
![](https://img.haomeiwen.com/i2312938/106e9f7e125f3c56.png)
3将Source/Cocoa Touch Class.xctemplate文件夹复制到新建的Custom中修改一下名字
![](https://img.haomeiwen.com/i2312938/2f8e362e4e361fde.png)
![](https://img.haomeiwen.com/i2312938/362c744ab8ff5b69.png)
4修改中的某个文件以OC的UIViewController为例
![](https://img.haomeiwen.com/i2312938/2a3f3296d18b6bed.png)
![](https://img.haomeiwen.com/i2312938/c3c618260cab4ed7.png)
在.m中添加上你自定义的模板
![](https://img.haomeiwen.com/i2312938/61626c05af664cde.png)
4然后在项目中,新建一个文件,选择Custom模块下
![](https://img.haomeiwen.com/i2312938/5e1cd442e31ea574.png)
网友评论