Commit 2ae12b98 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Adding a call back to the view controller when being popped

Adding a call back to the view controller when being popped.

Change-Id: Ib2b3800b3204ae52fd437681b4362a25682d15ec
Reviewed-on: https://chromium-review.googlesource.com/c/1425608
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625250}
parent bc3d0e66
...@@ -24,6 +24,10 @@ class ChromeBrowserState; ...@@ -24,6 +24,10 @@ class ChromeBrowserState;
// Notifies the controller that the settings screen is being dismissed. // Notifies the controller that the settings screen is being dismissed.
- (void)settingsWillBeDismissed; - (void)settingsWillBeDismissed;
// Notifies the controller that is popped out from the settings navigation
// controller.
- (void)viewControllerWasPopped;
@end @end
@protocol SettingsNavigationControllerDelegate<NSObject> @protocol SettingsNavigationControllerDelegate<NSObject>
......
...@@ -295,6 +295,16 @@ initWithRootViewController:(UIViewController*)rootViewController ...@@ -295,6 +295,16 @@ initWithRootViewController:(UIViewController*)rootViewController
} }
} }
- (UIViewController*)popViewControllerAnimated:(BOOL)animated {
UIViewController* poppedViewController =
[super popViewControllerAnimated:animated];
if ([poppedViewController
respondsToSelector:@selector(viewControllerWasPopped)]) {
[poppedViewController performSelector:@selector(viewControllerWasPopped)];
}
return poppedViewController;
}
#pragma mark - Private #pragma mark - Private
// Creates an autoreleased "X" button that closes the settings when tapped. // Creates an autoreleased "X" button that closes the settings when tapped.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment