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
Incorrect tab bar height when user partially swipes up miniplayerview, let's go, and then changes orientation #6
Comments
I'am not sure to understand, could you upload some video / screenshot? Is this happens in the example project or in your project? |
Certainly! It’s more subtle when using your example, but it’s much more obvious when I use it on the app I am working on: https://drive.google.com/drive/folders/1QX07ickbD7U6ZihM8AV0PvVkuS0-qspP You can see how the space between the icons and the tab bar are different depending on when the user lets go of the mini player and whether the device rotated only once when popupContentView state is open. |
It look like it is a custom tab bar and a custom popup bar, right? Can you send a sample project? |
Oh wow! I can certainly send you a sample. I distilled my project so you have the bare bones project (cut 80% of the fat off my code :) ), all while being able to reproduce the issue: https://github.com/aguzmanballen/DebugPBPopupController. I tested this with 2.0.0 and the latest version in master and I still see the same thing. To reproduce an obvious issue, run it, click the black button, drag the miniplayer up a bit but only so much so when you let go it goes back down (looks like this is only done in portrait mode). Then change the orientation (which would be landscape mode). You'll see that the tab bar becomes quite distorted. You can continue to see strange behavior when you start to drag the bar upward. There are certain thresholds where the bar instantaneously changes. Other issue that is less obvious is when you pull the bar up so the popup changes from a .closed state to a .open state, if you change orientation and then slowly drag the view down, you'll see that the images in the tab bar are a bit different than they should be and it's only when you let go when it looks like it immediately changes to what it's supposed to be. I hope this is helpful and like I said, I can certainly help you try and debug to get it to work! You've done such an amazing job with this project and I don't want to just leave it up to you to figure it out :) |
The issue is here only for device with safe area. And as the bug occurs only under iOS 12 (works perfectly on iOS 11 and iOS 13), I do not see where to look. This is necessarily in PBPopupInteractivePresentationController.swift or in PBPopupPresentationController.swift. And this only happens when the drag is canceled. Any idea? I know that Apple has always had a lot of problems with its UITabBarControllert (bugs)... |
Also, the result is not exactly the same if you use storyboard! |
What very interesting findings; thanks for looking into it! This also seems to be appearing only on the iPhone X using 12.x it seems. Well, it looks like this isn't the issue I thought it was. Perhaps what I need to do is have my code check if it is an iPhone X and iOS 12.x and if so, to make sure orientation does not change while the PlayerViewController is displayed. I'd rather have users be mad at a forced UX than think my app is buggy :) Thank you! |
Ah, I suppose that still doesn’t solve the issue when drag is cancelled. I’ll look into what’s going on there. |
You're certainly right about the tab bar being buggy. It looks like the frame and insets of the bottomBar can get thrown out of whack. How exactly do I use my own custom bottomBar? I want to override the system's settings and use my own. I know I can do the following, but I can't figure out why the actual function is not being called:
|
Sorry for all the edits! I saw there were two other functions in the DataSourceDelegate that returns the frame and the insets too. I think this will be good since I can still use the original bottomBar but override the insets and frame. Of course, I can’t get these functions called, which leads back to the question above: is setting popupController.dataSource = self enough? I would think so. |
Coming back from vacation... I was on a boat with no Internet all the time. I'am looking for the tab bar controller... But with no success from now. If you want to use a custom one, there is an example in the repo (Custom container). DemoContainerController.swift and DemoChildViewController.swift, the child controller that adopts the protocol dataSource and implements the delegate functions. This can be done also by the container... |
The tab bar layout is OK, the problem is that inside it, the items (images and labels) do not have the right size (height), that's why they are displayed higher... |
Oh interesting. This means the problem is the way insets are being handled then, right? I think if I just add code somewhere that remembers what the insets are supposed to be, it should be good. What are your thoughts? |
Which insets? The position of the tab bar is correct, the items in it is do not have the right size. This seems to be an Apple bug. |
Ah, don’t know why I never got an email with your response :( Yes the tab bar position and frame is perfect. I thought the inset frame inside the tab bar is what is incorrect (due to an Apple bug). Aren’t the elements of the tab bar anchored to this inset frame so if we were to override the buggy frame with ours, it will then display correctly? |
You have to click on the Watch button
We cannot change the frame of the UITabBarButton (private class), I have tried with no success. I will update also the framework for catalyst in the same time. |
Close by 288dfeb |
I'm noticing that if a user were to slightly pull up the miniplayer, let go, and then change orientation from portrait to landscape mode, the tab bar is incorrect.
This becomes much more obvious when the user pull the minibar from the bottom, it reaches an open state, user changes orientation, and then user pulls the playerview down so it becomes a miniplayer again.
Changing orientation back and forth twice seems to bring everything back to normal but it would be nice for users to not have to do that for it to work.
I've been looking inside PBPopupInteractivePresentationController.swift to see if the source of this bug is here, but to no avail. Is there a place you can suggest I take a look? I don't want to just dump this issue on you; I can certainly help :)
The text was updated successfully, but these errors were encountered: