ios - Reused cell is lagging in refreshing image -


the main problem here loading images custom cell, , when scrolling, reused cell shows old image while loading new image.

frankly, there aren't going lot of cells first thought around using tableview.dequeuereusablecellwithidentifier every place try , figure out either people question why this, or provide vague advice without sort of example.

what best way show cell without lag in reprocessing image?

enter image description here

class favoritespropertyviewcell: uitableviewcell {     @iboutlet weak var activityindicator: uiactivityindicatorview!     @iboutlet weak var cellpropertyimage: uiimageview!     @iboutlet weak var cellroomsvalue: uilabel!     @iboutlet weak var cellspacevalue: uilabel!     @iboutlet weak var cellpricerangevalue: uilabel!     @iboutlet weak var cellcitystatezipvalue: uilabel!     @iboutlet weak var celladdressvalue: uilabel!  } 

 func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell{                        var newpropertycell: favoritespropertyviewcell = tableview.dequeuereusablecellwithidentifier("favoritespropertycell", forindexpath: indexpath) favoritespropertyviewcell  //... image, format values ...                   // put in labels.                 newpropertycell.cellroomsvalue.text = roomsvalue                 newpropertycell.cellspacevalue.text = spacevalue                 newpropertycell.cellpricerangevalue.text = pricevalue                 newpropertycell.celladdressvalue.text = addressvalue                 newpropertycell.cellcitystatezipvalue.text = citystatezipvalue                  return newpropertycell      } 

it cannot solve problem when using standard uiimageview because of scrolling speed vs network loading speed.

what experience shows needed use image cache. there of cocoapods implement image cache , might check asyncimageview or nprimageview


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -