1

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

pkamb
  • 33,281
  • 23
  • 160
  • 191
  • I think a common name is "bottom sheet" - There is no in-built component from Apple. You can roll your own or there are some open-source implementations – Paulw11 Sep 02 '21 at 22:34
  • I think [this package](https://github.com/mkko/DrawerView.git) may be what you are looking for. – Dscyre Scotti Sep 03 '21 at 09:35

1 Answers1

3

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

pkamb
  • 33,281
  • 23
  • 160
  • 191