-
Notifications
You must be signed in to change notification settings - Fork 123
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
RetainCycle issue! #73
Comments
I also had the same problem. Then the following solution could solve the problem. /// Parent UIViewController
class ParentViewController: UIViewController, DismissMeControllerDelegate {
var animator: JellyAnimator?
func showViewController() {
let dismissMeController = DismissMeController()
dismissMe
var presentation = Jelly.SlidePresentation()
presentation.showDirection = .right
animator = Jelly.Animator(presentation: presentation)
animator?.prepare(presentedViewController: dismissMeController)
present(dismissMeController, animated: true)
}
func DismissMe(_ controller: DismissMeController) {
controller.dismiss(animated: true) {
// Import assign nil for strong reference
self.animator = nil
}
}
}
// DismissMeController.swift
protocol DismissMeControllerDelegate: class {
func dismissMe(_ controller: DismissMeController)
}
class DismissMeController: UIViewController {
deinit {
print("DismissMeController.Deinit?!")
}
func dismissMe() {
delegate?.dismissMe(self)
}
} |
Same issue here. Also not sure, but I think the workaround above would not necessarily work in the case where the view controller is interactively dismissed by the user. |
In my case, Jelly.Animator has retain pointer to UIViewController in prepare() function. |
Hey Guys, thanks for your Feedback. I will take a look into this if i am healty again. |
I didn't know you had a health problem. I hope your health will be restored. Thank you for providing a good library. |
I am working on it ... currently not 100% sure what causes the cycle. |
this is still an issue also in 2022 |
looks like
that |
Deleted it |
Is this still an issue? Any work around? Seems if it's just setting a variable to weak we could make a PR for Sebastian? |
I used this library in a project, and I realized that viewControllers that presented by Jelly, will NOT deinitialized!
I just added this, to Example project of the library:
the message is NOT printing after dismissing viewController.
The text was updated successfully, but these errors were encountered: