1首先前往
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates
2在File Templates下新建一个文件夹(例如Custom)

image.png
3将Source/Cocoa Touch Class.xctemplate文件夹复制到新建的Custom中修改一下名字

image.png

image.png
4修改中的某个文件以OC的UIViewController为例

image.png

image.png
在.m中添加上你自定义的模板

image.png
4然后在项目中,新建一个文件,选择Custom模块下

image.png