I'm getting the following error :
fatal error: unexpectedly found nil while unwrapping an Optional value
let cell = followedCollectionView.cellForItemAtIndexPath(deleteIndexPathh!) as! FeaturedCitiesCollectionViewCell
The cell may have not been nil when you created it but if you call
cellForItemAtIndexPath you aren't always guaranteed to get a cell back, for instance if the cell isn't in view there is nothing there for the function to return. What you need to do instead is make changes to the data model. Remove the element you want to delete from the array (or wherever the data for the cells is coming from) and then refresh the table view or reload the cells you need to. In general you want to try and avoid trying to fetch a cell like that. Always go for the data model instead.