如何通过快速按下标签显示/隐藏标签?
如何通过快速按下按钮来显示/隐藏按钮?
如何通过快速按下单元格来显示/隐藏单元格?
谢谢。
最佳答案
对于按钮: 为按钮创建一个导出 Action 。在方法类型中: '你的按钮'.isHidden = true
对于标签 向标签添加点击手势识别器。在它的 Action 中,键入: '你的标签'.isHidden = true
对于细胞 我不认为这是要走的路。最好遵循 iOS 标准,向左滑动删除该行。像这样:
func tableView(_ tableView: UITableView, commit editingStyle:
UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
self.tableView.deleteRows(at: [indexPath], with: .automatic)
}
}
关于ios - 如何通过快速按下标签来显示/隐藏标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44459301/