Reputation: 549
I'm using storyboards in iOS 6, and using a modal segue with partial curl. Everything is working fine, and from buttons in the modal view I can communicate back to the delegate and dismiss the modal view through code.
You can also dismiss the view by touching the page curl. But in this case, I can't figure how to hook up to the delegate. How does the delegate know that it has returned from the modal view when the user touches the page curl to dismiss?
Upvotes: 2
Views: 1733
Reputation: 549
Found the solution myself:
When you dismiss the modal View Controller, two functions are called (viewWillDisappear & viewDidDisappear) in that controller. You can use these to call the presenting view's delegate functions to let the presenting view know and take any action.
For example, in modalViewController.m:
- (void)viewWillDisappear:(BOOL)animated {
[self.delegate settingsViewControllerWillDisappear:self];
}
- (void)viewDidDisappear:(BOOL)animated {
[self.delegate settingsViewControllerDidDisappear:self];
}
Upvotes: 6