加载storyboard

#define LBKeyWindow [UIApplication sharedApplication].keyWindow

UIView *view= [[[NSBundle mainBundle]loadNibNamed:@"LBPopMenu" owner:nil options:nil ]lastObject];

  [LBKeyWindow addSubview:view];

//加载storyboard

    UIStoryboard *storyboard=[UIStoryboard storyboardWithName:@"LBDiscoverTableViewController" bundle:nil];

    //初始化箭头指向的控制器

    LBDiscoverTableViewController *discover =[storyboard instantiateInitialViewController];


设置cell以动画形式从屏幕右边加载进来

-(void)viewWillAppear:(BOOL)animated{

    [super viewWillAppear:animated];


    //刷新tableView(消耗内存)

    [self.tableView reloadData];

}

//当cell将要显示的时候调用

-(void)tableView:(UITableView *)tableView willDisplayCell:( UITableViewCell *)cell forRowAtIndexPath:( NSIndexPath *)indexPath{

    //当cell将要显示的时候做动画,从右向左的动画


    //1.将cell平移到屏幕外

    cell.transform =CGAffineTransformMakeTranslation(self.view.bounds.size.width, 0);


    //让cell复位

    [UIView animateWithDuration:0.5 animations:^{

        cell.transform =CGAffineTransformIdentity;

    }];

你可能感兴趣的:(加载storyboard)