0
我有以下代碼會照顧在tableViewCell中正確的滑動,它的工作正常時,用戶右滑動正確的單元格有討論ROOT,如果用戶右滑動單元格沒有這個URL,那麼UITableViewRowAction返回一個空數組。好的,選擇一個沒有URL的單元格後,我無法選擇任何其他tableViewCell,我甚至不能正確滑動。我知道我錯過了一些東西。UITableViewRowAction行爲不可預測
請幫我解決。
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let discussion = UITableViewRowAction(style: .Normal, title: "Discussion") { action, index in
self.loadTheDiscussionPageInWebViewController(indexPath.section, index: indexPath.row)
}
if let _ = self.allDatas[indexPath.section][indexPath.row].discussionUrl {
print(" BUTTON \(discussion)")
return [discussion]
} else {
print("NO BUTTON")
return []
}
}