iOS 抓取器拖动手柄是 UIKit 组件吗?

Is the iOS grabber drag handle a UIKit component?

Apple 已开始使用药丸形“抓取器”拖把手柄来代表 、“查找我的”等

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

拖动手柄在设计上与 iOS 11 中发布的 iPhone X 主屏幕和应用程序切换图标类似。

抓取器是否处理标准 UIKit and/or SwiftUI 可视化组件,可用于 iOS 和 Interface Builder?我在 Xcode.

中找不到一个

如果没有标准组件,如何从 UIViews 构建这样的抓取器?



拖动手柄是 UIGrabber 私有 class,在 public UIKit 中不可用:

它不是可在 UIKit 中使用的 public 组件。但是,在iOS 15+中,新的UISheetPresentationController有一个prefersGrabberVisible 属性。设置为 true 至少会在您的应用中显示 sheet 内的系统抓取器。

在 Xcode 的调试视图层次结构模式下检查项目显示 _UIGrabber 的私有 class 名称及其属性: