【发布时间】:2016-10-05 13:03:04
【问题描述】:
我是 swift 新手,我尝试做与 iOS 默认添加警报功能“重复”类似的功能:
选择周六和周日时会显示“周末”:
否则,如果只选择星期一到星期五,它将显示“工作日”
否则,如果仅选择特定日期示例“星期一星期二”,它将在标签上显示为“星期一星期二”
如果选择每天,则标签将每天显示在标签上
现在我只对具有多项选择的表格单元格进行了操作,但不知道如何从上一个表格中的选定选项中获取值并显示在标签上
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
// tableView.deselectRowAtIndexPath(indexPath, animated: true)
if let cell = tableView.cellForRowAtIndexPath(indexPath) {
if cell.selected {
cell.accessoryType = .Checkmark
}
}
}
override func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) {
if let cell = tableView.cellForRowAtIndexPath(indexPath) {
cell.accessoryType = .None
}
}
我尽力非常非常清楚地提出我的问题。请在我的帖子中给出一些建议。
【问题讨论】:
标签: ios swift uitableview multipleselection