0
votes

My view controller display the view depends on an array. the object of the array may be removed according to user interaction. So i have to reload the view controller once the user delete data in the array. is there any way to reload the regular view controller?

1
possible duplicationÖzgür Ersil
there is no solutionray ray

1 Answers

0
votes

You should design the view according to the array in one method and call it every time the array changes.

private func setupView() {
   ...
   self.setNeedsLayout()
}

private func deleteObject() {
   myArray.removeAtIndex(2)
   self.setupView()
}