selectionStyle无法与UITableViewCell一起使用

tim*_*one 0 uitableview ios swift

我希望我的一些单元格不响应用户交互并尝试通过以下方式设置:

  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    ....
    if let header = tmpTableItem as? EKHeader {
      tableViewCell.textLabel!.text = menuHeader.name
       tableViewCell.selectionStyle = UITableViewCellSelectionStyleNone
    } ....
Run Code Online (Sandbox Code Playgroud)

但我得到错误:

使用未解析的标识符UITableViewCellSelectionStyleNone

但这似乎是禁止用户交互的正确方法UITableViewCell.我究竟做错了什么?

EI *_*2.0 5

改变这一行

 tableViewCell.selectionStyle = UITableViewCellSelectionStyleNone
Run Code Online (Sandbox Code Playgroud)

 tableViewCell.selectionStyle = .None  // In swift 3.0 and above use `.none` 
Run Code Online (Sandbox Code Playgroud)