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

fix: set VCs of views from recycling pool as UIAdaptivePresentationControllerDelegate #1535

Merged
merged 4 commits into from
Jul 25, 2022

Commits on Jul 18, 2022

  1. Configuration menu
    Copy the full SHA
    cd205dc View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2022

  1. chore: restore default value for stackPresentation in prepareForRecycle

    method
    
    We set this prop to default value here to workaround view-recycling.
    Let's assume the view has had _stackPresentation == <some modal stack presentation> set
    before below line was executed. Then, when instantiated again (with the same modal presentation)
    updateProps:oldProps: method would be called and setter for stack presentation would not be called.
    This is crucial as in that setter we register `self` as a delegate (UIAdaptivePresentationControllerDelegate) to
    presentation controller and this leads to buggy modal behaviour as we rely on
    UIAdaptivePresentationControllerDelegate callbacks. Restoring the default value and then comparing against it in
    updateProps:oldProps: allows for setter to be called, however if there was some additional logic to execute when
    stackPresentation is set to "push" the setter would not be triggered.
    kkafar committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    94fd0df View commit details
    Browse the repository at this point in the history
  2. fix: compare incoming stackPresentation prop value against actual sta…

    …te, not
    
    second-to-last props.
    kkafar committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    65f19b6 View commit details
    Browse the repository at this point in the history
  3. fix: mistake in comment

    kkafar committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    c16acb4 View commit details
    Browse the repository at this point in the history