i have uitableview , have pull refresh working empty arrays, gets data fill them ,and reloads table. custom animation, looks bad whole table disappears , reanimates in. want update data , add in row or remove 1 if needed without flickering entire table. here gif of happens: https://giphy.com/gifs/8d4ullrr2qtlm
code animate table cell:
func tableview(tableview: uitableview, willdisplaycell cell: uitableviewcell, forrowatindexpath indexpath: nsindexpath) { var cellcontentview: uiview = cell.contentview var rotationangledegrees: cgfloat = -30 var rotationangleradians: cgfloat = rotationangledegrees * (3.14159 / 180) var offsetpositioning: cgpoint = cgpointmake(500, -20.0) var transform: catransform3d = catransform3didentity transform = catransform3drotate(transform, rotationangleradians, -50.0, 0.0, 1.0) transform = catransform3dtranslate(transform, offsetpositioning.x, offsetpositioning.y, -50.0) cellcontentview.layer.transform = transform cellcontentview.layer.opacity = 0.8 uiview.animatewithduration(0.65, delay: 0.0, usingspringwithdamping: 0.85, initialspringvelocity: 0.8, options: [], animations: {() -> void in cellcontentview.layer.transform = catransform3didentity cellcontentview.layer.opacity = 1 }, completion: {(finished: bool) -> void in }) }
code refresh control:
func refresh(sender: anyobject) { namearray = [] textarray = [] userarray = [] latarray = [] longarray = [] timearray = [] loctextarray = [] category = [] eventid = [] pricearray = [] getdata() // gets server data tableview.reloaddata() refreshcontrol?.endrefreshing() }
Comments
Post a Comment