Dragging window on iPad from near the top

By default, a window on iPadOS 26 can be dragged by touching and dragging the top ~30 points of that window. If the window's root view controller is a UINavigationController with a navigation bar, the window can be dragged by touching and dragging anywhere in that navigation bar. In Apple Calendar, I can drag a window anywhere above the grid of weeks and days.

I have an app with a custom navigation controller. My navigation controller is not a subclass of UINavigationController. How can I define what portion of the window should let the user drag that window across the screen on iPad?

Answered by Frameworks Engineer in 851725022

You can add a UIWindowSceneDragInteraction to your view and setup any necessary gesture failure requirements from it. https://developer.apple.com/documentation/uikit/uiwindowscenedraginteraction

Accepted Answer

You can add a UIWindowSceneDragInteraction to your view and setup any necessary gesture failure requirements from it. https://developer.apple.com/documentation/uikit/uiwindowscenedraginteraction

Thank you so much, this is exactly what I needed. And it worked perfectly!

John

Dragging window on iPad from near the top
 
 
Q