首页 > 解决方案 > 在单元格 Swift 中查找 UIText 字段的索引号

问题描述

我现在正在创建一个日历应用程序,我使用了一堆 UITextFields 来组成表格视图单元格的内容。我想获取它所在的 tableView 单元格编号,以便将其保存到,var events: [Dashboard] = []因为现在每次添加新单元格时,它都会将其全部清除。我确实尝试过使用 EditingDidEnd

func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?) {
    let getIndexPathOfSelectionDelageteInstance: getIndexPathOfSelectionDelagete! = nil
    getIndexPathOfSelectionDelageteInstance.IndexpathValue(theTitle: (indexPath?.row)!)
}

但它不起作用。它甚至被调用。我假设在表格视图中操作某些东西不算作编辑它。

有人能帮我吗?谢谢。

标签: iosswiftxcode

解决方案


推荐阅读