自定义storyboard并显示
- 我们创建一个storyboard并且在里面搭建界面,完成后加载出来
1.加载storyboard
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"<storyboard的名字>" bundle:nil];
2.初始化肩头所指向的控制器
HTDiscoverTableViewController * discover = [storyboard instansiateInitialViewController];
- 我们要自定义一个类来管理这个自定义的storyboard,在控制器的属性里绑定我们自己创建的类
- 不要忘记点击箭头的属性(让箭头指向我们自定义的storyboard)
显示storyboard中的cell的时候拥有一种从右向左的动画效果
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
1.将cell平移到屏幕外
cell.transform = CGAffineTransformMakeTranslation(self.view.width , 0);
2.让cell复位(动画)
[UIView animateWithDuration:0.5 animations:^{
cell.transform = CGAffineTransformIdentity;
}];
}