I am developing one iOS app with Swift 2.3 .My View controller (ABC) contains UITableView and all data will be binded on controller level . I have prepared custom Tableview Cell which contains collection view with horizontal scrolling of dynamic images . After preparing all data i will reload collection view from ViewController to bind images . All images are downloaded from server using SDWebCahche image library. All works fine if scrolls slowly . My issue raised while i try to scroll fast . Below i see only one crash in console .
libc++abi.dylib: terminating with uncaught exception of type NSException
Also see attached image thread status after crash.


Thanks in Advance .
I have solved this issue by adding below code in my Custom UITableViewCell.
I have added UITableviewcell method "prepareForReuse". In this method i have cleared all my CollectionView related data and reload collectionview.
e.g
override func prepareForReuse {
arrImges.removeAll()
collectionView.reloadData()
}
as i have noticed this method is invoked when my UITableViewCell start deque. So all my collectiobView data will be cleared and new data will be reloaded again while preparing data new data in My Controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With