objective-c 修改文件模板
文件模板存放位置:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/iOS/Source
//___FILEHEADER___
#import "___FILEBASENAME___.h"
@interface ___FILEBASENAMEASIDENTIFIER___ ()
@end
@implementation ___FILEBASENAMEASIDENTIFIER___
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
一些宏的定义:
宏名 | 意义
------------ | -------------
___FILENAME___
| 文件名包括后缀
___PROJECTNAME___
| 工程名
___FULLUSERNAME___
| 用户的名字
___DATE___
| 当前日期,年/月/日
___COPYRIGHT___
| 版权
___FILEBASENAME___
|不带后缀的文件名
___FILEBASENAMEASIDENTIFIER___
| 不带后缀的文件。
修改后
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// ___COPYRIGHT___
// Description:
#import "___FILEBASENAME___.h"
@interface ___FILEBASENAMEASIDENTIFIER___ ()
@end
@implementation ___FILEBASENAMEASIDENTIFIER___
#pragma mark ---- 生命周期函数
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)dealloc {
}
#pragma mark ---- 代理函数
#pragma mark ---- 自定义函数
@end
网友评论