1

我们最初UITableView使用的是MKSlidingTableViewCell现在我面临滚动问题。为了克服这个我选择ASyncDisplayKit(AS tableview)

但是这两个( MKSlidingTableViewCell, ASCellNodeBlock) 不在同一个单元格中工作。

任何人都可以请建议我。

使用 ASTableView 时:

func tableView(tableView: ASTableView, nodeForRowAtIndexPath indexPath: NSIndexPath) -> ASCellNode {

     let post = postData[indexPath.row];

     let cell = UserProfileCell(currentPostData: post, index: indexPath.row, commentsOpenedIndex: openedCommentIndex);

     if post.post_type == "post"{

     cell.userInteractionEnabled = true;
     cell.cellDelegate = self;
     cell.FullPicDelegate = self;
     let height = cell.configureCell(post, index: indexPath.row, commentsOpenedIndex: openedCommentIndex);
     // let height = cell.configureCell(post, index: indexPath.row, commentsOpenedIndex: indexPath.row);
     heights[indexPath] = height;

     return { cell; }()

     }

    return { cell; }()

     }

使用 MKSlidingTableView 时

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

     let post = postData[indexPath.row];
     if post.post_type == "post"{
     let cell = UserProfileCell();
     cell.userInteractionEnabled = true;
     cell.cellDelegate = self;
     cell.FullPicDelegate = self;
     let height = cell.configureCell(post, index: indexPath.row, commentsOpenedIndex: openedCommentIndex);
     // let height = cell.configureCell(post, index: indexPath.row, commentsOpenedIndex: indexPath.row);
     heights[indexPath] = height;

     // return cell;

     let container = MKSlidingTableViewCell();
     let backgroundCell = OptionsViewHomeEvents();
     backgroundCell.indexPath = indexPath
     backgroundCell.type = OptionsViewType.HomePosts;
     backgroundCell.reference = self;

     container.drawerView = backgroundCell;
     container.foregroundView = cell;

     container.delegate = self;

     container.drawerRevealAmount = OptionsDrawerWidth.HomePosts;
     if(APIHelper.logged_user_id  != post.user_id){
     container.drawerRevealAmount = 0;
     }

     return container;
     }

     }
4

0 回答 0