SegmentedPickerStyle.swift 870 B

123456789101112131415161718192021222324
  1. /// A picker style that presents the options in a horizontal segmented control.
  2. ///
  3. /// Only supported by UIKitBackend and AppKitBackend.
  4. public struct SegmentedPickerStyle: PickerStyle, _BuiltinPickerStyle {
  5. public nonisolated init() {}
  6. public func _asBackendPickerStyle<Backend: BaseAppBackend>(backend: Backend)
  7. -> BackendPickerStyle
  8. {
  9. .segmented
  10. }
  11. }
  12. extension PickerStyle where Self == SegmentedPickerStyle {
  13. /// A picker style that presents the options in a horizontal segmented control.
  14. ///
  15. /// Only supported by UIKitBackend and AppKitBackend.
  16. public static nonisolated var segmented: Self { Self() }
  17. /// An alias for ``PickerStyle/segmented``, provided for SwiftUI compatibility.
  18. ///
  19. /// Only supported by UIKitBackend and AppKitBackend.
  20. public static nonisolated var palette: Self { Self() }
  21. }