1

I am trying to update a view's data on one view controller enclosed inside a stack view after hitting the navigation button back to it from another view controller. I have seen other threads describing how to check if the back button had been pressed, however I'm not sure how I'm supposed to pass the data into the parent controller.

Here's a graphical representation: view 1 into view 2 back into view 1

djdannel
  • 11
  • 1
  • You can set the parent view controller as a delegate of the child view controller and invoke some delegate method in `viewWillDisappear` of the child view controller. A navigation controller's back button does not trigger any segues – Paulw11 Jun 11 '22 at 00:38
  • @Paulw11 I'm not familiar with delegation. What particular methods would I use to set the parent view as a delegate of the child view? – djdannel Jun 11 '22 at 01:37
  • https://medium.com/@nimjea/delegation-pattern-in-swift-4-2-f6aca61f4bf5 – Paulw11 Jun 11 '22 at 02:43

0 Answers0