Search code examples
swiftuikituitabbarcontrolleruitabbaruipangesturerecognizer

Draggable UIView is interacting undesirably with Tab Bar


I have a UIView that I can drag around the screen via UIPanGestureRecognizer. However, when I drag it down to the bottom of the screen, the view automatically starts to squish vertically when it touches the tab bar. If I keep dragging downward, it will eventually be allowed to drag under the tab bar.

I don't want it to interact with the tab bar at all though. It should just slide under it as if it weren't there. The view controller has Extend Edges Under Top Bars and Extend Edges Under Bottom Bars checked.

Why is the view interacting with the tab bar in the first place? And how do I prevent this behavior?


Solution

  • Finally fixed this by unchecking the "Extend Edges Under Bottom Bars" option on the view controller. The view now slides unimpeded under the tab bar.