I have the "didSelectRowAt" method in my swift app so that when I tap a cell the AVPlayer plays a video associated with the cell. I'm currently trying set the table up so that the user can go into edit mode, select multiple cells, and share the videos via my UIActivityViewController. My issue is that when the table's in edit mode and I select the selection circle, it plays the video. Now, according the SD (https://developer.apple.com/documentation/uikit/uitableviewdelegate/1614877-tableview) this shouldn't happen.
Here's my select function
func select(){
if (self.tableView.isEditing == false){
self.tableView.setEditing(true, animated: true)
}
else{
self.tableView.setEditing(false, animated: true)
}
}
and my cell selection method
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let index = tableView.indexPathForSelectedRow
let videoStrings = self.videoSTRINGS
let indNum = index!.row
let videoNum = videoStrings[indNum]
let video = URL(string: videoNum)
self.avPlar = AVPlayer(url: video!)
self.avPlarCon.player = avPlar
self.present(self.avPlarCon, animated: true){
self.avPlarCon.player!.play()
}
}
Any help is much apprecciated.