搜索
您的当前位置:首页正文

03-UI进阶(4)

来源:二三娱乐

0613-私人通讯录主流框架

1. block的快捷键inline(04-block讲解)

2. 图解沙盒各个文件的作用(06-plist存储)

iTunes会备份的是Documents、Library/Preference,Library/Caches存储的文件相对前两个要大

3. 在sb或者xib中快速复制一个控件command+d

4. 解析文件(比如解档data文件、从sb或者xib加载控件等)都会调用- (id)initWithCoder:(NSCoder *)aDecoder这个初始化方法(08-自定义对象归档)

5. 把cell左滑的delete改为中文(10-小码哥通讯录(删除功能))

步骤:

  • 点击蓝色的PROJECT→Info→Localizations→添加中文
  • 标题栏Product→Scheme→Edit Scheme→Run→Options→ApplicationLanguage

6. 左滑时添加多个按钮(10-小码哥通讯录(删除功能))

这是IOS8以后新出的API

- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    UITableViewRowAction *action = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"增加" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
        // 点击增加的时候调用
        NSLog(@"增加");
        
    }];
    action.backgroundColor = [UIColor greenColor];
    UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
        // 点击增加的时候调用
        NSLog(@"删除");
        
    }];

    
    return @[action,action1];
}
Top