Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disappear fixes #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions STPopup/STPopupController.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ - (void)setupObservers
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];

// Observe keyboard
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillChangeFrameNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];

Expand Down Expand Up @@ -293,21 +292,21 @@ - (void)popViewControllerAnimated:(BOOL)animated
}

UIViewController *topViewController = [self topViewController];
topViewController.popupController = nil;
[self destroyObserversOfViewController:topViewController];
[_viewControllers removeObject:topViewController];

if (self.presented) {
[self transitFromViewController:topViewController toViewController:[self topViewController] animated:animated];
}
topViewController.popupController = nil;
}

- (void)transitFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController animated:(BOOL)animated
{
[fromViewController willMoveToParentViewController:nil];
[fromViewController beginAppearanceTransition:NO animated:animated];
[toViewController beginAppearanceTransition:YES animated:animated];

[fromViewController willMoveToParentViewController:nil];

[_containerViewController addChildViewController:toViewController];

if (animated) {
Expand Down