博客> Xcode自定义模板
Xcode自定义模板
2018-11-12 16:16 评论:0 阅读:554 DCHRectina
ios Xcode模板

收藏并分享给你们,原文:[ http://www.cocoachina.com/ios/20170419/19087.html ]

自定义一个view或者viewcontroller,系统都会自动生成固定的模板,但是这个模板可以在Xcode中进行修改,改成自己想要的模板

如:新建一个viewcontroller,初始代码格式如下:

import "FILEBASENAME.h"

@interface FILEBASENAMEASIDENTIFIER ()

@end

@implementation FILEBASENAMEASIDENTIFIER

  • (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. }

  • (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. }

/*

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

可以改成自己的模板样式,如下:

import "FILEBASENAME.h"

@interface FILEBASENAMEASIDENTIFIER ()

@end

@implementation FILEBASENAMEASIDENTIFIER

pragma mark - LifeCycle

  • (void)viewDidLoad { [super viewDidLoad]; }

pragma mark - UITableViewDelegate

pragma mark - Public

pragma mark - Private

pragma mark - Getter

pragma mark - Setter

@end

收藏
1
sina weixin mail 回到顶部