自定义模板文件夹xctemplate

模版文件夹体系/底层公开文件夹体系(xctemplate)
系统UIViewController自带模版文件夹体系

文件模板路径存放位置:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/FileTemplates
进入Source文件夹
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/FileTemplates/Source复制CocoaTouchClass.xctemplate模版粘贴
至 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/FileTemplates/Custom文件夹内
在这里插入图片描述
因为本例子只要说明ViewController模板是如何生成,需要修改下面的内容:
在这里插入图片描述
4文件夹的名字前缀改成自己的命名
进入HYViewControllerObjective-C文件夹先修改.h文件:
在这里插入图片描述
修改.m文件,将.m中的内容替换成自定义的模块代码:
在这里插入图片描述打开TemplateInfo.plist修改其中配置:
在这里插入图片描述在这里插入图片描述保存退出。

发布了121 篇原创文章 · 获赞 4 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/yanhaijunyan/article/details/102922079