I have a two scene StoryBoard in my app – it uses an automatic segue (created in IB). When a button is clicked in the 1st UIViewController the 2nd UIViewController is presented modally.
The 1st UIViewController needs to know when second the 2nd UIViewController dismisses itself. What is the correct way to achieve this? Right now, I’m using -viewDidAppear: in the 1st vc but that doesn’t seem right.
Any pointers would be much appreciated.
Best,
CS
What you’re doing, plus checking that
isMovingToParentViewControlleris NO, should work for this specific case. It won’t help if you ever have other view controllers that are triggered from the first one and you want to distinguish among them.The most direct method would be to have the modal controller post a notification when it is going away.