I've a view inside my custom CollectionViewCell, and embedding a graph on that view. In order to refresh it, I've to check if there is already a graph placed on that view, remove it and then apply new. Here's the solution
cell.cellView.addSubview(graph)
graph.tag = 10
now, in code block where you want to remove it (in your case gestureRecognizerFunction)
if let removable = cell.cellView.viewWithTag(10){
removable.removeFromSuperview()
}
to embed it again
cell.cellView.addSubview(graph)
graph.tag = 10