Reputation: 961
So, I have a tableview that looks something like this.
This is how it looks like with fields empty. After I click on the rows, I can select options and then it looks something like the second image. However, after I click save on this screen, I want all of these fields clear. I have tried code like this and placed it in my viewWillAppear tab. Since this view is accessed by a tab bar controller, viewDidLoad doesn't called, but it still doesn't work. Could someone please tell me how I would clear the fields after I click save.
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! = ""
}
Upvotes: 0
Views: 101