-
-
Notifications
You must be signed in to change notification settings - Fork 443
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
PopTip does not show when calling show after hide #204
Comments
Hi @amohit94 |
This should do the trick: let poptip = PopTip()
poptip.showToolTip(attributedText: attributedText, popTipDirection: ToolTipManager.defaultTopTipDirection)
poptip.hide()
poptip.showToolTip(attributedText: attributedText, popTipDirection: ToolTipManager.defaultTopTipDirection) As the previous hide was in progress when 2nd showToolTip was called, the completion block of hide removes the view added by the 2nd showToolTip. |
Hi @amohit94 It is quite odd though, the |
I'll try creating a demo project. Till then, can you try if calling hide(forced:true) reproduces the issue? |
Is this still an issue? |
I'm afraid so, still trying to figure out why it does that. |
Here is workaround: |
Scenario: If a PopTip is visible and we hide that Poptip and show another Poptip in the same callstack, the second Poptip is not visible.
Severity: This is important in cases where the code is such that hide and show is called from multiple places and a scenario happens when hide and show are called from the same call stack.
This happens because in the completion block for hide PopTip, its views are removed from the hierarchy. When removeAllAnimations is called, this completion block is not called immediately, but after a slight delay. In the mean time if we call show on PopTip, it adds the views in the view hierarchy and completion block for the previous hide is called after sometime removing the view from the view hierarchy.
Fix: in the completion block for animation, we should check if the animation finished and only then remove the views from the hierarchy. And when we are calling removeAllAnimations, we should ensure that the view is removed from the view hierarchy.
The text was updated successfully, but these errors were encountered: