Xcode代码块自定义使用
来源:互联网 发布:珊瑚虫软件免费下载 编辑:程序博客网 时间:2024/06/04 18:15
1.代码块使用的变量的地方使用<#type#>
@property (nonatomic,copy) NSString * <#varname#>;
2.拽到代码块栏里设置名称和快捷键
本人收集了一些常用的代码块 ,后续补充中
//1.cell创建static NSString * identifier = @"<#cellname#>";+(instancetype)cellWithTableView:(UITableView *)tableView{ <#cellname#> * cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if (cell == nil) { NSArray *arrayXibObjects = [[NSBundle mainBundle] loadNibNamed:identifier owner:nil options:nil]; cell = arrayXibObjects[0]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; tableView.separatorStyle = UITableViewCellSeparatorStyleNone; cell.backgroundColor = [UIColor clearColor]; cell.userInteractionEnabled = YES; cell.accessoryType = UITableViewCellAccessoryNone; return cell;}//2.单例创建 static <#classname#> * _instance = nil; +(instancetype) shareInstance { static dispatch_once_t onceToken ; dispatch_once(&onceToken, ^{ _instance = [[self alloc] init] ; }) ; return _instance ; } 3.tableviewDelegate#pragma mark UITableViewDelegate- (NSInteger)numberOfRowsInSection:(NSInteger)section{ return <#number#>;}- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return <#number#>;}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ <#classname#> *cell = [AddrListCell cellWithTableView:tableView]; cell.model = model; return cell;}#pragma mark 懒加载-(UITableView *)customTableView{ if (!_customTableView) { CGRect frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); _customTableView = [[UITableView alloc]initWithFrame:frame]; _customTableView.backgroundColor = [UIColor whiteColor]; _customTableView.delegate = self; _customTableView.dataSource = self; _customTableView.separatorStyle = UITableViewCellSeparatorStyleNone; _customTableView.showsVerticalScrollIndicator = NO; } return _customTableView;}
0 0
- 使用 Xcode 自定义代码块
- Xcode代码块自定义使用
- [Xcode使用] 自定义代码块引用
- Xcode自定义代码块
- Xcode 【Xcode中关于自定义代码块的使用】
- Xcode 【Xcode中关于自定义代码块的使用】
- Xcode:添加自定义代码块
- Xcode之自定义代码块
- XCode自定义代码提示块
- Xcode 代码块的使用
- Xcode 【Xcode中关于自定义代码块的使用和删除】
- Xcode中保存自定义代码块
- 在Xcode中自定义代码块
- xcode如何导出自定义的代码块
- 自定义代码块在Xcode中的路径(方便下次换电脑时使用~)
- xcode 使用代码块Code Snippets
- xcode 使用代码块Code Snippets
- Xcode开发中代码块的使用
- 设计模式C++实现(2)——策略模式
- Nodejs beginner
- ASmack4.0.7详细讲解
- FMDB的使用方法
- ios开发-数据库网络之启动MAC系统自带的apachectl服务器(1)
- Xcode代码块自定义使用
- <!DOCTYPE html>很重要
- XCP官方网站
- Khronos 为发布高性能低能耗计算机视觉加速OpenVX 1.1 规范
- TwinklingRefreshLayout 支持下拉刷新和上拉加载的 RefreshLayout,自带越界回弹效果,支持 RecyclerView,AbsListView,ScrollView,We
- Java 5种字符串拼接方式性能比较
- C++中unsigned的小疑问
- python变量作用域
- 关于WebView加载有些网页不显示图片