4
votes

I am playing youtube video using UIWebView. When disappear cell , I am going to stop playing video.

-(void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;

This delegate is working well for another cell but not while playing video using webview.. How can I detect to disappear cell on screen? If anyone know about that , Please let me know that. thank you

1

1 Answers

1
votes

was having the same issue, but reading the documentation it clearly states "Tells the delegate that the specified cell was removed from the collection view" , which in this case doesn't happen (maybe due to some strong reference)

to solve the issue I shifted the pausing/stop code to

- (void)collectionView:(UICollectionView *)collectionView
   willDisplayCell:(UICollectionViewCell *)cell
forItemAtIndexPath:(NSIndexPath *)indexPath

and retrieve the previous cell in it by some changes to indexPath