检测多个触摸WKInterfaceTable

时间:2015-05-21 18:12:25

标签: ios watchkit

有没有办法检测是否已经选择了一个表行,现在我正在使用类似的布尔值防止多次推送:

- (void)willActivate {
    // This method is called when watch view controller is about to be visible to user
    pushed=NO;
}

- (void)table:(WKInterfaceTable *)table didSelectRowAtIndex:(NSInteger)rowIndex {

    // if pushed, just return else continue and set pushed to true
    if (pushed) {
        return;
    }
    pushed=YES;

    [self pushControllerWithName:rowData[@"controllerIdentifier"] context:nil];
}

1 个答案:

答案 0 :(得分:0)

没有内置方法可以检测WKInterfaceTable中的多个触摸。您使用的技术与我在Watch应用程序中使用的技术相同。就我而言,我为每一行维护一个BOOL,指示它是否已启用。基于该BOOL,我更新了我的单元格以显示“禁用”状态,但当然,它在技术上并未被禁用。