【发布时间】:2017-10-19 20:49:51
【问题描述】:
所以,我有一个看起来像这样的表格视图。
这是字段为空时的样子。单击行后,我可以选择选项,然后它看起来像第二张图像。但是,在我点击此屏幕上的保存后,我希望清除所有这些字段。我已经尝试过这样的代码并将其放在我的 viewWillAppear 选项卡中。由于这个视图是由标签栏控制器访问的,所以 viewDidLoad 没有被调用,但它仍然不起作用。有人可以告诉我单击保存后如何清除这些字段。
self.categoryDisplayed = ""
self.collectionsDisplayed = ""
self.currencyNameDisplayed = ""
let indexpath = NSIndexPath(row: 0, section: 0)
let cell = tableView.dequeueReusableCell(withIdentifier: "listCell", for: indexpath as IndexPath) as! ListDataTableViewCell
if (!self.isMovingToParentViewController){
self.categoryDisplayed = ""
self.collectionsDisplayed = ""
cell.optionSelectedLabel.text! = ""
}
【问题讨论】:
-
重新加载表格视图
标签: uitableview swift3