Is there a way of reloading a View Controller upon completion of a function?

I am using the following syntax in a View Controller (using a Storyboard) to remove the second element of an array in a database.

Code Block
@IBAction func deleteItemOne(_ sender: UIButton) {
if userId == user?.uid {
let group_array = document["product"] as? [String] ?? [""]
if (group_array.count) > 1 {
document.reference.updateData([
"product": FieldValue.arrayRemove([group_array[1]])
])
self.viewDidLoad()
self.viewWillAppear(true)
}
}
}

Once the element of the array has been removed, I am using the following syntax to then reload the View Controller.

Code Block
self.viewDidLoad()
self.viewWillAppear(true)

However after removal of the element, the View Controller doesn't reload as intended, and in-fact it doesn't end up doing anything.

This leads to my question, is there a simple Swift function / method that I can call to reload the View Controller upon completion?
Neither viewDidLoad() nor viewWillAppear(_:) are functions to be called from your code.

Generally, there are no functions to reload a view controller.
What do you expect to happen when you reload the view controller?

You may need to implement your own reload() as what you expect to happen and call it.
Are there any functions which can be used to refresh it instead? Essentially all of the labels on my View Controller are assigned a database value, and when one of them are updated I need the View Controller to automatically update to reflect this new order of values.

Are there any functions which can be used to refresh it instead?

What do you expect to happen with refresh? You may need to implement refresh() by yourself.

Essentially all of the labels on my View Controller are assigned a database value, and when one of them are updated I need the View Controller to automatically update to reflect this new order of values. 

You have some code somewhere to assign a database value to the labels, move them to refresh() and call it.
Replace calls to viewDidLoad by call to view.setNeedsDisplay.

If data are displayed in tableView, call table.reload()
Accepted Answer
Thanks all for your inputs, in the end I managed to get it working by creating a segue and programatically calling this using the following code:

Code Block
performSegue(withIdentifier: "showDetail", sender: nil)

Is there a way of reloading a View Controller upon completion of a function?
 
 
Q