James
James

Reputation: 1177

Update the data of a TableViewController after add item

I have tableView (A) responsible for listing items CoreData and viewController (B) to add new item. To create a ViewController (B) custom, they chose to use the following Present Modally to use presentation Over Current Context to enable transparent background and be able to apply the blur.

The problem is that the table view does not update the data.

Following a post from Stack Overflow resulting in code:

override func viewDidAppear(animated: Bool) {
    self.loadData()
}

But at the back of viewController (B), nothing happens in Xcode does not pass the lines of viewDidAppear.

Can anyone help me?

Upvotes: 2

Views: 1397

Answers (1)

Tommyizua
Tommyizua

Reputation: 416

Try this:

 override func viewDidAppear(animated: Bool)
{
    self.yourTableViewName.reloadData()
}

Upvotes: 2

Related Questions