美文网首页
objective-c 修改文件模板

objective-c 修改文件模板

作者: 倒着游的鱼 | 来源:发表于2021-01-14 11:30 被阅读0次

    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
    
    

    相关文章

      网友评论

          本文标题:objective-c 修改文件模板

          本文链接:https://www.haomeiwen.com/subject/hztvaktx.html