Search code examples
iosuikitdraggabledragdrawer

Is the iOS grabber drag handle a UIKit component?


Apple has begun using a pill-shaped "grabber" drag handle grip to represent draggable drawers in Apple Maps, Find My, etc.

A grabber is a visual affordance that indicates that a sheet is resizable. Showing a grabber may be useful when it isn't apparent that a sheet can resize or when the sheet can't dismiss interactively.

UISheetPresentationController: prefersGrabberVisible

The drag handle is similar in design to the iPhone X home screen and app-switching icon released in iOS 11.

Are grabber handles a standard UIKit and/or SwiftUI visual component available in iOS and Interface Builder? I'm unable to find one within Xcode.

If there is not a standard component, how can such a grabber be built from UIViews?


Apple Maps


Find My


Solution

  • The drag handle is a UIGrabber private class, not available in public UIKit:

    It's not a public component available to use within UIKit. However, in iOS 15+, the new UISheetPresentationController has a prefersGrabberVisible property. Setting to true will at least display the system grabber within that sheet in your app.

    Inspecting the item in Xcode's Debug View Hierarchy mode shows the private class name of _UIGrabber, as well as its properties:

    _UIGrabber in view hierarchy