ios - How to avoid relayout of content in a tableview? -
here read in cells , table view performance guide :
avoid relayout of content. when reusing cells custom subviews, refrain laying out subviews each time table view requests cell. lay out subviews once, when cell created.
what mean ?
am applying :
override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("customcell", forindexpath: indexpath) as! customcell cell.customcelldescription.text = data[indexpath.row] return cell }
what you're doing fine. putting data in label (or whatever is), not moving around. cellforrowatindexpath — apply cell data corresponds index path.
Comments
Post a Comment