Xcode常用代码块整理
来源:互联网 发布:淘宝卖家能给差评吗 编辑:程序博客网 时间:2024/06/14 08:57
一、屏幕尺寸
//快捷键 Screen Size
/** 屏幕尺寸参数 */#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
二、初始化函数
//快捷键 initBase
#pragma mark - **************** 初始化操作- (void)initBaseData {}- (void)initBaseView {}
三、属性
strong、copy,assign
//快捷键:strongg 、 copyy 、assignn
//@property(nonatomic,strong)<#type#> *//@property(nonatomic,copy)<#type#> *//@property(nonatomic,assign)<#type#>
四、tableview创建
//快捷键 tableViewDelegate
#pragma mark lazy loading...-(UITableView *)tableView { if (!_tableView) { _tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain]; _tableView.delegate = self; _tableView.dataSource = self; } return _tableView;}#pragma tableView--delegate#pragma tableView-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return <#expression#>}-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return <#expression#>}-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identify = @"cellIdentify"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify]; if (!cell) { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identify]; } cell.textLabel.text = self.arrayTitle[indexPath.row]; return cell;}-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {}
五、webview创建
//快捷键 webView delegate
#pragma mark--webView-(UIWebView *)webView { if (!_webView) { _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 50, SCREEN_WIDTH, SCREEN_HEIGHT)]; _webView.scalesPageToFit = YES; _webView.delegate = self; _webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; } return _webView;}#pragma mark--webview的delegate/** start */-(void)webViewDidStartLoad:(UIWebView *)webView {}/** start loading */-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { return YES;}/** finish */-(void)webViewDidFinishLoad:(UIWebView *)webView {}/** error */-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {}
六、button创建
//快捷键 button create
#pragma mark--button create UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(100, 100, 100, 50); btn.backgroundColor = [UIColor orangeColor]; [btn addTarget:self action:@selector(clicked:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:btn];
七、注释
/** <#注释#> */ 快捷键 explain property// --<#说明#> 快捷键 explain single#pragma mark - **************** <#输入注释#> 快捷键 explain mark
八、待处理事项
//快捷键 waring
#warning TODO <#message#>
目前先整理这些,后续遇到再补加。
1 0
- Xcode常用代码块整理
- Xcode 常用代码块
- Xcode常用代码块
- Xcode 常用代码块
- Xcode中创建常用代码块
- Xcode的常用快捷代码块
- Xcode代码块功能
- Xcode自定义代码块
- Xcode代码块注释
- 查看、修改Xcode自带快捷代码块快捷键,及Xcode自带swift常用快捷代码块对照表
- IOS 代码块整理
- MySQL代码块整理
- XCODE常用插件整理
- Xcode代码块迁移方法
- 使用 Xcode 自定义代码块
- Xcode:添加自定义代码块
- Xcode 快速开发 代码块
- Xcode代码块自定义使用
- 《Thinking in java》基础篇之位运算
- [Leetcode] Happy Number
- eeprom
- 将一个int的各个位解析到int数组
- CF371 D Searching Rectangles
- Xcode常用代码块整理
- Qt中“调试器未设置”的解决方法
- 正则表达式
- 泛型T的类型获取
- 位运算符
- [Leetcode] Number of 1 Bits
- c#中集合ArrayList用法
- 将int数组各个元素整合到一个int
- 【light-oj】-’1307 - Counting Triangles(二分)