func outerTableViewTapHandler(_ tap: UITapGestureRecognizer)

    {

        let location = tap.location(in: tap.view)

        if let indexPath = self.outerTableView.indexPathForRow(at: location)

        {

            // 點到Row

            self.tableView(outerTableView, didSelectRowAt: indexPath)

        }

        else

        {

            // 點到空白處

        }

    }

 

參考資料:

http://stackoverflow.com/questions/24141254/how-to-detect-tap-on-clear-part-of-uitableview

arrow
arrow
    全站熱搜

    小賢 發表在 痞客邦 留言(0) 人氣()