marcosgriselli / SwipeableTabBarController

UITabBarController with swipe interaction between its tabs.
MIT License
1.54k stars 107 forks source link

Problem with iPad in split screen #98

Closed wasp898 closed 3 years ago

wasp898 commented 3 years ago

I have adopted this amazing solution in my app since I think July. I forked the project so that I could try to fix the black-screen-issue (and actually never got to it in the end 😅).

Anyways, only now I noticed a big issue that affects iPads in split screen (or with the app in floating mode), which is that the swipe transitions are computed based on the size of the device, and not the size of the view. This leads to transitions showing a huge amount of black nothing between two consecutive app screens.

My solution was straightforward and you can find it in this commit. There may be better solutions to take the current view width, that's why I'm not making a PR yet. The solution works fine for my app as far as I can tell though.

marcosgriselli commented 3 years ago

@wasp898 I think that solution is perfect, maybe I'd use the from view since it is the one where the gesture takes place. Would you send a PR with the changes?