0
所以,我有一個像這樣的tableview。單擊保存後如何清除字段Swift 3
這是怎麼看起來像空字段。點擊行後,我可以選擇選項,然後看起來像第二個圖像。然而,在我點擊保存在這個屏幕後,我想要清楚所有這些字段。我嘗試過這樣的代碼,並將其放在我的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! = ""
}
刷新的實現代碼如下 – Sneha