Q:

Get indexPath.row in cell

I try to get the indexPath.row in cell when I click on my button:
@IBAction func cellPlayButtonPressed(_ sender: Any) {
    let cell = (sender as AnyObject).superview??.superview as? UITableViewCell
    let indexPath = runnerTableView.indexPath(for: cell!)
    print(indexPath)
}

I have this error when I push my button:

fatal error: unexpectedly found nil while unwrapping an Optional value

I have try everything found on Stack Overflow and nothing is working.
Let me know where is the bug! Thanks :) 

A:

just copy the given extension 
extension UITableView {    
func indexPath(forItem: AnyObject) -> IndexPath? {
    let itemPosition: CGPoint = forItem.convert(CGPoint.zero, to: self)
    return self.indexPathForRow(at: itemPosition)
}}

USE: 
@IBAction func cellPlayButtonPressed(_ sender: Any) {
    if let indexPath = runnerTableView.indexPath(forItem: sender) {
        print(indexPath)
    }
}

