如何捕获Swift WatchKit中的表格行按动作?

Eve*_*oob 4 uitableview ibaction ios swift watchkit

我目前有一个包含一些动态行的表.当我运行probject时,行显示在屏幕上甚至有一个新闻动画,但是xcode不会让我将表行作为IBAction连接到它的控制器.我不能在这个例子中使用segue,它需要像按钮按下但最好是整个桌子上的rown我宁愿不插入按钮.任何帮助表示感谢,谢谢!

hgw*_*tle 7

您想要覆盖该table:didSelectRowAtIndex功能.这是一种方法WKInterfaceController.

override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) {

    //Handle row selection
}
Run Code Online (Sandbox Code Playgroud)