MenuPickerStyle.swift 804 B

123456789101112131415161718192021
  1. /// A picker style that presents the options in a drop-down menu.
  2. ///
  3. /// Supported by GtkBackend, AppKitBackend, and WinUIBackend. Supported by
  4. /// UIKitBackend when running on tvOS 17+, iOS 14+, or Mac Catalyst 14+.
  5. public struct MenuPickerStyle: PickerStyle, _BuiltinPickerStyle {
  6. public nonisolated init() {}
  7. public func _asBackendPickerStyle<Backend: BaseAppBackend>(backend: Backend)
  8. -> BackendPickerStyle
  9. {
  10. .menu
  11. }
  12. }
  13. extension PickerStyle where Self == MenuPickerStyle {
  14. /// A picker style that presents the options in a drop-down menu.
  15. ///
  16. /// Supported by GtkBackend, AppKitBackend, and WinUIBackend. Supported by
  17. /// UIKitBackend when running on tvOS 17+, iOS 14+, or Mac Catalyst 14+.
  18. public static nonisolated var menu: Self { Self() }
  19. }