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
Bug with displaying PopupContentViewController #24
Comments
Hello, I guess it's a conflict between the two gesture recognizers:
As they are public, can you try to implement your own delegates on them and play with? |
Sure. 👍 I have not worked with gestures yet, but it will be interesting. |
Can you try 3.6.8? I tried some updates. |
Hi 👋 I checked the update 3.6.8 and 3.6.9, but this error remained and is reproduced, as before. But I saw, after the mistake played -> I went into the background (without unloading from memory) -> opened the application, then “pressing” and the gesture “pull up” in PopupBar stop working. |
Please tell me, did you reproduced this bug? If not, I can give my test build, where this behavior is better reproduced than in your PBPopupSample I also tried to resolve the conflict between two gestures, but to no avail 🙁 |
Hello, I no longer reproduce this bug with my example. Can you provide an example project that would allow me to reproduce this more easily? Thanks, |
Of course, please check PBPopupSample in the last community updated library to 3.6.10 |
Also added 2 videos as on the latest version is reproduced https://drive.google.com/drive/folders/1u54fwfbhji9g0EDgndVxXS4zkAGZ6RO8?usp=sharing |
I'm pretty sure now that it's not a gesture conflict. But maybe a conflict with the controls of your content view controller. Can you test by disabling interactions with the content view controller during the presentation? func popupController(_ popupController: PBPopupController, shouldOpen popupContentViewController: UIViewController) -> Bool {
if let popupContent = popupContentViewController as? PopupContentViewController {
popupContent.view.isUserInteractionEnabled = false
return true
}
return false
} func popupController(_ popupController: PBPopupController, didOpen popupContentViewController: UIViewController) {
if let popupContent = popupContentViewController as? PopupContentViewController {
popupContent.view.isUserInteractionEnabled = true
}
} |
This bug still occurs, but its behavior has now changed In version 3.6.10, after I reproduced the bug again, I still cannot gesture and click on the PBPopupBar and the buttons it contains. Previously tapping on PBPopupBar I could call a method from a button in PopupContentViewController. For example, the AirPlay button. And another important thing to do, which was before but I did not mention it, is that the progressView that is in the PBPopupBar stops the progress. (But self-playing audio continues) If I bring the application to the background and bring it back to the front, then the buttons in the PBPopupBar will become clickable again, and the progressView in the PBPopupBar will correctly display the progress. But I won't be able to open PopupContentViewController with a tap or a "pull up" gesture.
I also checked version 3.6.7 Also added 2 videos «version3.6.7.MOV» and «version3.6.10.MOV» where the behavior is reproduced |
Another interesting detail:
func popupController(_ popupController: PBPopupController, shouldOpen popupContentViewController: UIViewController) -> Bool
If I do not fill in these values, then the bug is also reproduced but with more attempts (Suddenly this information will be useful) |
After some investigation, I noticed that in this case the pan gesture recognizer does not enters the UIGestureRecognizer.State.changed state. |
Maybe you should ask a question in Code-level support? dts@apple.com
Perhaps support will suggest a better solution (especially if the bug is on their side) |
I don't know much about this library LNPopupController, but you may have explored it more. Does LNPopupController use the same gesture interaction principle? Or do you not like this implementation of the "pull up" gesture? (So far I have no other ideas how we can implement a workaround |
I know the workaround. LNPopupController is a very good framework, but it was designed to animate a view, not to present a view controller. PBPopupController uses UIPresentationController coupled with an interactive animator (UIPercentDrivenInteractiveTransition) and an animator (UIViewPropertyAnimator). UIKit requests the start of the animation when necessary. When the pan gesture recognizer enters directly the ended state, it is too late. You can have a look here: LN also uses UIPanGestureRecognizer but this bug has no impact on the flow of the animation since it is programmed manually when the pan enters the changed state. Also you can see the differences between the features of LN and PB here: |
Wow, thanks for the detailed description.
👍 |
In PB I had called it "deck", since iOS 13 Apple called it pageSheet. |
Can you check 3.6.11? |
Hello. I checked 3.6.11 When I make a gesture "sharp swipe up" (conditionally call the movement that causes bug), the PopupContentViewController is now instantly displayed (There is no opening animation in this case)
But I wanted to clarify: If it possible 🤔 I attached the video fixbug.mp4 how it happens to me https://drive.google.com/drive/folders/1u54fwfbhji9g0EDgndVxXS4zkAGZ6RO8?usp=sharing |
When I do "sharp swipe up" gesture , it creates the visual effect ( of the PopupBar ) artifacts in the PopupContentViewController for half a second. I found a simple solution for this: Add animator.fractionComplete = self.progress to self.shouldComplete (func startInteractiveTransition)
This removes the visual effect.
|
Hello, animator.continueAnimation(withTimingParameters: UICubicTimingParameters(animationCurve: .linear), durationFactor: 0.5) instead of: animator.continueAnimation(withTimingParameters: nil, durationFactor: 1.0) You can test and I will update very soon. |
Fixed by 3.6.13 |
Awesome. I tested the new build 3.6.13. Everything works fine, and most importantly, there is no bug. |
Hello 👋
I have a bug displaying PopupContentViewController.
When I try to make a short gesture to pull up from the bottom of the PBPopupBar, sometimes there is a bug: where the PopupContentViewController is not displayed, but the system thinks that it is currently open.
On the screen I see a viewcontroller with PBPopupBar, but not a single button or cell is called.
And if PopupContentViewController has buttons, then they work (call their methods)
It is not always possible to cause a mistake, but if they try to make a lot of short swipe in the bar at some moment, all the elements on the current screen will stop responding (and, as I said, the PopUPContentViewController elements will begin to react)
This bug can only be removed when to roll up the application and expand.
Below I have added a screen recording video (to GoogleDrive) of how it is possible to play back:
https://drive.google.com/drive/folders/1u54fwfbhji9g0EDgndVxXS4zkAGZ6RO8?usp=sharing
Could you try to intervene this bug at home? (If it doesn’t work out, then I can provide logs)
The text was updated successfully, but these errors were encountered: