Skip to content

Instantly share code, notes, and snippets.

@gunantosteven
Created June 11, 2020 04:00
Show Gist options
  • Save gunantosteven/25912070a57806755b6330cee7b32018 to your computer and use it in GitHub Desktop.
Save gunantosteven/25912070a57806755b6330cee7b32018 to your computer and use it in GitHub Desktop.
// Line 73
func viewDidDisappearFromContainer() {
if let visibleIP = visibleIP {
if let listSocialCell = tableView.cellForRow(at: visibleIP) as? ListSocialTableViewCell,
listSocialCell.photo.isVideo {
listSocialCell.stopPlayback()
}
// after cell
if let listSocialCell = tableView.cellForRow(at: IndexPath(row: visibleIP.row + 1, section: visibleIP.section)) as? ListSocialTableViewCell,
listSocialCell.photo.isVideo {
listSocialCell.stopPlayback()
}
// before cell
if let listSocialCell = tableView.cellForRow(at: IndexPath(row: visibleIP.row - 1, section: visibleIP.section)) as? ListSocialTableViewCell,
listSocialCell.photo.isVideo {
listSocialCell.stopPlayback()
}
} else {
if photos.count > 0 {
if let listSocialCell = tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? ListSocialTableViewCell,
listSocialCell.photo.isVideo {
listSocialCell.stopPlayback()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment