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

Retain cycle in animator. Need to set completion properties to nil after animation. #5

Open
EugeneEl opened this issue Sep 16, 2016 · 2 comments

Comments

@EugeneEl
Copy link

Hi!
I was looking for already-made solution for custom transition. But when I checking your example for zoom transition https://github.com/xxxAIRINxxx/ARNZoomImageTransition
I noticed that deinit for detail controller never been called. After investigation I found that problem is in ARNTransitionAnimator.

public func animationEnded(transitionCompleted: Bool) {
        self.transitionContext = nil

        // also need to set completions to nil 
        self.presentationBeforeHandler = nil
        self.presentationAnimationHandler = nil
        self.presentationCancelAnimationHandler = nil
        self.presentationCompletionHandler = nil
        self.dismissalBeforeHandler = nil
        self.dismissalAnimationHandler = nil
        self.dismissalCancelAnimationHandler = nil
        self.dismissalCompletionHandler = nil
}

To be honest I didn't dive into iOS transition API deep enough to be sure where capturing occurs but I found this solution might help.

Please fix this as retain cycles cause crashes hard to detect.

@EugeneEl EugeneEl changed the title Retain cycle in animator. Need to set completion properties after animation. Retain cycle in animator. Need to set completion properties to nil after animation. Sep 16, 2016
@xxxAIRINxxx
Copy link
Owner

@EugeneGoloboyar
Thanks for the issue.
I working on creating a Swift 3 version.
Code varies greatly, but the problem is going to improve.

I'm so busy now...
please wait for a while..

@nfhipona
Copy link

ohhh.. cool then I think we'll just wait for your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants