Skip to content

Make sure to remove old content controller before trigging didMoveToParent #17

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

Merged
merged 1 commit into from
Dec 22, 2021
Merged
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
4 changes: 2 additions & 2 deletions ContainerController/Core/ContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ open class ContainerViewController: UIViewController {
log("Remove content controller: \(sourceContentController) from the stored embed controller as it shouldn't be reused." as AnyObject)
self.embedContentControllers.remove(at: index)
}
// Complete the adding of the new content controller
self.triggerDidMoveToParentViewControllerIfNeeded(targetContentController, isReused: isReused)
// Remove the old content controller as the animation is completed
sourceContentController.removeFromParent()
// Complete the adding of the new content controller
self.triggerDidMoveToParentViewControllerIfNeeded(targetContentController, isReused: isReused)
// Set the content controller as the current one
self.currentContentController = targetContentController
// Update the transition state flag
Expand Down